Sunday, December 4, 2016

PSX DenshaDeGo Loconet controller

In my last trip to Japan I found an old PSX "Densha De Go" Japanese controller. This is a controller simulating a train cab and used with that train simulator game, very popular in Japan.


I don't remember if I found it in a BookOff second hand store or in Mr Potato, Last one is a very famous retro gaming shop in the heart of Akihabara district in Tokyo.

My idea was to use the controller to move trains in my layout, and to accomplish that I would use an Arduino acting as interface between the PSX controller and my Loconet network.

Let's check the hardware needed:

1 x Arduino UNO. (Another Arduino version is also possible)
1 x Loconet shield. As always that you want to interface Arduino and Loconet, you need a Loconet shield. You can build it your own, or buy it directly to the Rocrail guys. The item code is GCA185 and here you have all the information about it and the electrical schemes if you want to build it by your own: http://wiki.rocrail.net/doku.php?id=gca185-en
1 x Sensor Shield v5. This is not strictly needed, but makes it easier to connect wires and build the prototype before soldering everything in place. You can have it from ebay for 2$
You will need also some Dupont female to female jumper wires for easy connecting and testing of the prototype.

Connections:

Plug the Loconet shield GCA185 on top of Arduino UNO, and Sensor shield on top of GCA185. Then you have to connect the pins of the PSX joystic to the following Arduino pins if you want to use directly the Arduino sketch I'm providing later on in this post:

PSX pin 1 (DATA) to Arduino PIN 12
PSX pin 2 (COMMAND) to Arduino PIN 11
PSX pin 4 (GND) to Arduino GND pin
PSX pin 5 (VCC) to Arduino +5V pin
PSX pin 6 (ATT) to Arduino PIN 10
PSX pin 7 (CLOCK) to Arduino PIN 13

You can check in this page all information about PSX controller, also how to identify which is the pin number 1 of the connector: http://www.gamesx.com/controldata/psxcont/psxcont.htm


Here you have an image of my temporary connections of the PSX connector and the Arduino Sensor shield for further clarification:



Software:

Finally, you need to compile and upload the following sketch into the Arduino board:

https://github.com/ClubNCaldes/ArduinoDeGo

To be able to compile the sketch you need to add two libraries to the Arduino environment:

MRRWA Loconet library: http://mrrwa.org/download/
PSX library: http://playground.arduino.cc/Main/PSXLibrary

The first one is the library in charge of Loconet communications. You have many examples included in the library. I used of them, Loconet Throttle, as basis for making the current sketch. The example turns the Arduino in a Loconet Throttle receiving the commands through the serial monitor. You only need to change it a little bit to use any device connected to Arduino. In my case I changed it to use a PSX controller, but you can connect a potentiometer, a LCD display and a keypad or anything you imagine to build your personalized throttle.

The second one is a library written by Kevin Ahrendt and based on the PSX communication protocol analysis from Andrew J McCubbin. I also had to do some reverse engineering as this controller is not like the normal ones. And I found the brake throttle is not working properly, some times it is sending strange values. That's why you will find in the sketch some weird code to skip strange values that my controller sends some times. But if it works with my broken controller, I guess it will also work properly with a good one.



If you have any question just comment under the post or open an issue in the GitHub repository. If it works well and you try it, you can also comment.  :P




Saturday, November 26, 2016

First exhibition of ClubNCaldes

Last weekend we did our first N scale module exhibition. It was held in a small town called Sant Fost de Capcentelles, near Barcelona, by the shopkeepers association. This year they choose the slogan "Don't miss the train! Buy in San Fost,  local business". And they asked us to mount our modular layout during the whole weekend.



We were lucky to have a 14 meters long room to mount the layout, as it is exactly the total length of our modules together as we still don't have any curve module. We only had time to make two loops and eight straight ones, and now we have to produce more headers to build more modules. We plan to build some curved ones and a big train station.




The assembly and set up of the modules was pretty fast, it only took us 2 hours to have all them assembled and ready to run trains. There was no problem in the track alignment between modules, and trains ran in a very smooth way between modules. That was the first time we were mounting all our modules together, so the system is proved to be reliable.

It took a bit longer to have the digital part and Rocrail up and running as some modules were not tested and needed to be configured properly. The truth is in the last two weeks all of us had to finish many things and were quite stressed finding were to buy the skirt, how to fix it, installing the electronics in some modules, preparing the Rocrail plan, .....

But, I still don't know how, everything was ready and trains were able to run in automatic mode when the mayoress of Sant Fost came to open the exhibition:



The event was well attended and each of the members had also many visits from friends and familiars who never before had the chance to view the results of our hobby. During all this time I had my modules upside down, pending of decoration, and it was almost impossible to access the garage where I spent so many hours building them.

The digital system has been proved also to be reliable and easy to manage. All of us were able to use our tablet or smartphone to manage trains, lights or accessories of the whole layout. And even our youngest club member managed alone all the traffic with no problems. And everything built by us, only using Arduinos and Open Hardware and Open Software.



Here you can see a couple of videos, one of them recorded with an on-board camera:



We really spend a fantastic weekend, we are looking forward to organize a bigger train exhibition soon, with more modules for sure.


We want to thank this opportunity we had to San Fost mayoress, the Shopkeepers Associacition, and specially to Juan, the most active member of the club who prepared the complete event.

Thanks Juan!!!!





Monday, October 31, 2016

Module tests

I couldn't write any post in the last months but I was a little bit stressed trying to finish my two first modules. If you read previous posts, you know ClubNCaldes created its own digital normative for N scale modules. The base and module headers are according EuroN standards. But as there is no standard norm in N scale for digital exploitation, we created our own.

We have our first "public appearance" in less than one month and all club members were quite stressed in finishing the modules with an acceptable decoration, and also quite concerned about the technological part as we are making also our own electronics, despite all the system is fully compatible with Loconet and any Loconet device can be used. One of our main goals is to create an Open Source and Open Hardware digital system, but compatible with the main standards in the market.

Each of us had until now his own layout at home. Each one depending on the space restrictions of his home was building a bigger or smaller layout, but none of us has never finished it. There is people in this club investing time and money in his layout for more than 15 years, others less, but nobody has finished his layout. Probably is because none of us wants to face the question that would arise once the layout is finished: "And now, how should I continue my hobby??". Probably destroying it and starting again from scratch. I still remember when I placed last piece of track in my layout and closed the track circuit, and instead of being a happy day I was quite sad, because I realized I won't place any more piece of track in the future. And it was a pity as I had to go through many errors until I learned the good way to do it. But then I learned about modules, and today I would never start a traditional layout again.

Modules are an enclosed work of 91.5 x 40 cm (size is free, but this is a standard size for a module as it has the exact length of an straight Peco 55 track). Wiring is very simple if you don't want to install switches, and even with them you don't have to worry about current loops or short circuits as in our norms all this has been solved. And create a simple decoration in a board of this size is quite fast and very satisfactory. Because you see it finished very fast, you can always enhance the decoration, exchange modules, create and substitute them with newer ones with better designs, join your modules with your friends' ones and run long trains that will never fit in your layout.

And the fact is in July 11th we started building our module headers ordering them to a local professional woodworking company:


And this weekend, October 29th, that's what we accomplished:





You see the decoration theme is not uniform. Some of you may be was shocked seeing a JR Freight train from Japan crossing a Spanish RENFE. But over being a railroad club, ClubNCaldes is first a friends group and each member puts a remembrance, lived experience or personal image when building a module that deserves all the respect, so we decided not to have any type of restriction in decoration themes, epoch or rolling stock type. This makes our meetings even more funnier and interesting.

I have many photos stored to write more articles about the process of building and decorating those modules, I promise to do it soon.

Meanwhile I hope you like these videos and get inspired to create N scale modules like us.