Interactive web site of Télécom ParisTech's ELECINF344/ELECINF381 Robotics and Embedded Systems classes (a.k.a. ROSE, 2012 session).


Some news from SaMoRa


during the previous week I had time to do quite some work for SaMoRa.

I first ported the existing code to our new STMF207VE. In order to do this, I had to create the corresponding linker script and to patch ChibiOS (or more precisely, to hack it) in order to use TIM11 on our board. I also made the CAN implementation of the HAL avalaible for the STM32F2XX family.

I also finished the implementation of most of the OpenLCB standards we will use. This includes most of the Data Link and Network layers, the datagrams and events protocols from the Transport layer and the train control protocol from the Application layer. The CAN specificities are also taken care of. The specific control messages are used and the OpenLCB messages are translated in both ways. The only problem is the translation of messages from nodes not on the CAN. The bridge at the entry of the CAN should automatically create new aliases to send them on the CAN. It was considered unpractical and not useful for our use so they use the alias of the bridge. Furthermore, as some things were not exactly defined, I had to decide on some points. So, even if the code is compliant with the spirit of the standard, it may not work well with another OpenLCB implementations. We finally asked for a range of adresses and received it instantly. We now have the ID range. It allowed us to determine the exact IDs for all our cards and the exact events we will generate, both for controlling the lights and for receiving information from the sensors.

Next on line is the controller. Based on the file describing the layout of our rails, a python script now generates all the required structures. These structures contain all the necessary information in a usable format, creating an oriented graph with some extra information in independent arrays. The actual implementation of the controller manages all the locomotives, given a complete path for each one (an empty one is valid). It takes care of the reservation of all the segments and switches necessary to a given traject and so prevents crashes. Anyway, that’s the theory, as our railroad is actually unavailable and so the software is untested.

Finally, Guillaume was able to run a program compiled with the -fpic option and launched from his bootloader. Below is an example of blinking LEDs with a program put at address 0×1000.

SaMoRa : CAN and PCB

During the previous week, we were able to send messages to both individual trains and switches. Today, Clement looked at more advanced DCC commands in order to be able to implement them. We also implemented a first working draft of the CAN protocol. Based on the events API of ChibiOS, a single thread manages all the transmissions to and from the CAN bus. It already takes care of the Data Link level of the OpenLCB protocol.

Following a discussion with Alexis, we decided to drop the support for Wifi on the base station. Guillaume was thus able to finish the schematics of the PCB before the end of the day and calculated its total consumption. He then sent it for approval by the teachers.

DCC and Morse code

Today we implemented DCC control on the central station, using ChibiOS and PWM. At the end of the day, we were able to successfully send a command to a train. We also implemented a simple module sending messages using Morse code in order to familiarize ourselves with the timers provided by ChibiOS.

Finally, we looked at some micro controllers in order to plug a remote controller in the CAN bus.

SaMoRa : more reading

Today, Clement read the DCC specification and Brice continued to read NMRANet from the Data link layer up to the Transport layer.

Guillaume, Clement, Brice

SaMoRa : studious readings

Today, we mainly looked at various normes.

Guilllaume worked on the CAN specifications, taking his informations from there.

The others began to read the S-9.7 NMRANet norme and the corresponding OpenLCB draft.

Guillaume, Clement, Brice