Quantcast
Channel: Rocrail – Mi Tren
Viewing all 14 articles
Browse latest View live

Actualización Rocrail SpeedCurve 3482


MGV101 y pruebas completas con el sensor IR

$
0
0

Estas últimas semanas me he tomado un descanso de la reparación del vagón grúa – dónde me he quedado atascado en el código de control.

He aprovechado para concluir el montaje de las placas de Peter Gilling  publicadas en la página de Rocrail. Se trata de una solución que utiliza el protocolo de Digitrax Loconet.

En concreto las placas que he montado son la MGV-101 (ahora GCA-101), que hace de interfaz con el ordenador mediante Ethernet, y las MGV-50 (ahora GCA-50), que es la que propiamente actúa como elemento de entrada y salida en Loconet.

El montaje me ha permitido probar la solución que preparé para la detección por reflexión de infrarrojos.

El resultado ha sido perfecto, las dos placas están ampliamente documentadas en la página de Rocrail, y aunque requieren una configuración minuciosa, no ha habido ningún problema. Lo único a recordad:

  • Hay que decirle a Rocrail, que central programará los módulos de Loconet: SV-IID= IID del controller MGV-101… que lo elegimos nostros
  • Hay que arrancar Rocrail con el parámetro de interrogación al inicio (-x), y teniendo ya alimentado la MGV-101… de lo contrario hay un comportamiento aleatorio con las entradas… no las detecta y rocrail es incapaz de detectar los módulos.. aunque las salidas sí que son gobernables.

Con estas placas el esquema eléctrico que tenía pensado para el tren cambia definitivamente, abandonando la idea de usar placas s88 para la detección de trenes.

Queda pendiente ver como porto la solución par detección por IR a la MGV-50. Peter tiene su propia solución (enlace MGV.IR), pero se requieren dos placas… y preferiría ahorrarme una.

Actualización Rocrail SpeedCurve 3969

$
0
0

He compilado una nueva versión de Rocrai con la curva de velocidad, con las nuevas funcionalidades de la revisión 3969.

Dejo e enlace para el ejecutable y los ficheros del código con la modificación.

SPEEDR

rocrail-setup_SpeedCurve-rev3969

Rocrail and the raspberry-pi

$
0
0

Por fin he podido probar la raspberry pi que recibí en verano con rocrail. Como también voy a publicarlo en el foro de rocrail, lo he documentado en inglés… pero si cualquiera necesita ayuda en castellano, no hay más que pedirla.

Finally, I have been able to test the raspberry pi with rocrail, at least I have been able to compile and execute the program. I still need to check if the library use to generate the control signal over the serial port (ddx) works properly, and if the configuration for Loconet explained in the last posts is also working in raspberry. Anyway, the result is pretty cool and I do think ther rpi could become a nice DIY central station with my favourite control software.

Having rocrail in the rpi, makes it possible to have different contrlo clients: android, iphone, ipad, etc…

I have created a document trying to explain step by step how to make rocrail running in raspberry. It also contains some instruccions  to customise the rpi:

Setting up rocpi_v1.4

Please note that most of the information in the manual is coming from the forum and web-site in rocrail. The document, was built for my own use as repository of the ideas and steps I was following. Hope it is useful. I have also created a debian distribution for the raspberry… but I have not tested (feedback is welcome):

rocrail-setup-rev4011-rocpi-armhf

Actualización rocrail SpeecCurve 4177.. y ahora también para la rpi

Nueva versión rocrailSpeedCurve 4453

Raspberry Pi and Rocrail test, RS232 adapter

$
0
0

Finally I have been able to prepare an adapter for the uart port at the rpi and check that rocrail works perfectly (so far). Hereafter a small video demonstrating the achievement.

Rocrail is using the ddx library to send the commands through the serial port of the rpi. The booster board (ord-3) is powering the test track. Peter Gilling, designer of the board, advised on reducing the value of the resistor R1 – I am currently using 390 ohms- , this is also convinent for usb-rs232 converters. He was also concerned about the rpi being able to generate the signal… This is something that needs further tests… so far, with just one loco and without launching rocview, it seems to work OK.
The raspberry has been adapted with a connector to generate the right voltage levels. It is based on this design I found on internet.

I am attaching hereafter the schematics and the board.

serial

serial_pcb serial

I have left some jumpers to select the signal being generated in the UART pins or other GPIO pins. In this way, if I want to play to generate the signal directly, and not though ddx, I could have a test board… this could also help to experiment and activate certain functionalities not available with usb converters -i.e. shortcut detection or programming track. In the same way, power can be selected (5v or 3v).

Note that the connections of this board would require a null-modem cable. The ORD-3 is expecting the signal in pin 3 (where the RS232 port of a PC would provide it), and the adaptor is generating the signal in pin 2. In fact, the adaptor is prepared to connect the rpi to a PC.

Obviously, it is possible to create a board with the right pin layout to directly interface the ord-3:

serial_cross_pcb

serie_cross serial_cross_pcb

Last but not least the guideline to use rocrail in a raspberry pi has been updated:

Setting up rocpi_v1.3

RPI and Rocrail… bad news with the 2013

$
0
0

This afternoon I extended the tests. Some extra information:

The serial port in the rpi ttyAMA0 does not seem to be able to generate the dcc signals. The tests I made where with a Motorola loco.

ttyAMA0

TAMS (motorola) OK

Loksound (dcc) Not OK

DIY acc decoder Not OK

The work around so far is to make use of a USB-Serial adaptor:

ttyUSB0

TAMS (motorola) OK

Loksound (dcc) OK

DIY acc decoder OK

I will post if I found out more…at this point it is clear considering the fifures above that the ttyAMA0 is no generating the entire signal. It seems the ttyAMA0 is not capable of changing the baudrate.


Rocpi and serial port

$
0
0

I have been trying to find out why the ttyAMA0 port is not working with rocrail.
So far, I have not found the answer… but it is clear that the port generates with no problem the Motorola packets, but not the dcc ones.
I have been capturing the output with the oscilloscope and decoding them, with only dcc active… and including one loco and no loco.
The outcome should be the idle packet as sent by rocrail:
11111111111111101111111100000000001111111110
When I used an USB converter, that is precisely what is obtained…now, when I used the AMA0 port… it seems not being able to generate even the right bit code:
In the picture: 11X…

20130217_513648

After two 1 received… there is a weird signal… neither a ’1′ nor a ’0′
I have also tried to measure directly from the GPIO pins… and the results are the same – discarding any problem with the board I prepare to adapt the voltage levels.

20130217_512849

So next step… see if the problem is in the way rocrail manages the serial port… or if it is just a problem with the AMA0 port – for that I would need some help form the rocrial community.
PS:I have made test to send a file of 2MB at the baudrate used to generate dcc packets… and it arrived with no problems to my PC.

Rocrail and RPI… still

$
0
0

Just a quick finding:

DDX with only DCC is not managing to send the idle packet….

DDX with MM activated does  8-O

I have made the test with the option of MMLP (long pause for motorola)… and still, the idle packet is sent.., but the normal packets (in the experiment for loco 23) is never sent.

RPIC, raspberry pi, rocrail and rocpi!!!

$
0
0

In the last weeks I have been working on a new approach to use the raspberry pi and rocrail: RPIC.

The raspberry and PIC (RPIC) is a very basic electronic circuit to have a multiprotocol central station running in the raspberry pi.

rpic

RPIC is basically code running on a Microchip microcontroller (currently a pic16f1825)

The main motivation to produce this firmware has been the failure in making DDX running on the rpi (http://forum.rocrail.net/viewtopic.php?t=4763). In the best scenario, the rpi was capable of use ddx through an usb adaptor, consuming a considerable amount of resources in the raspberry.

Thus, and inspired by the MDRRC Digital RailRoad Control by Robert Evers (http://vhaenchen.homepage.t-online.de/mdrrc/mdrrc.html), I decided to develop my own ucontroller central station.

Yes, it is yet another solution for managing model trains. The main difference with other solutions is that rpic is born to be used jointly with rocrail and the raspberry pi. Of course, with the right HW adaptor, it could be used with other platforms, and with the right protocol, it could be also used by other pieces of SW… but for that purposes there are already many available solutions. The objective was to complement the raspberry pi with the minimum pieces of HW to get a full control center.

RPIC works together the rocpi library created for rocrail. There are basically two modes of use: as an auxiliary command station, or as the main command station.

RPIC as auxiliary command stations

The rocpi library can be used as a secondary station to make use of the GPIO port of the raspberry pi. In this case, the ucontroller and max3232 of the schematic, can be removed.

In the current version, what the user will obtain is:

  • A led informing the daemon is up and running or not
  • A button to reset the daemon (short pulse) or turn off your raspberry pi (pressing the button for more than 4 seconds).

RPIC as main command stations

The current features included in the firmware are:

  • Support for MM1 and MM2 protocol
  • Support for NMRA (long and short addresses) – 14,28 and 128 steps
  • Support for NMRA accessories (no extended accessories so far)
  • Support for writing CV.

There are some other eastern eggs – as the capability to generate MFX messages). The development is not completed and coming features include:

  • Full support to reading and writing cvs, only on the main
  • Segregated programing track (PT), with the possibility to run both the trains and send commands to the PT.
  • MM accessories, MM1Fx and the special protocols MM3, MM4 and MM5 available in ddx (under demand)
  • Capturing of power consumption from ORD-2 and ORD-3 boosters.
  • At least complete the research on MFX

As usual I am releasing all the code and updating the manual:

  • rpic firmware (and also the compiled file)
  • rocpi source code. Just extract the content in your rocrail source code folder and compile. I will be requesting to the rocrail community to accept this contribution and include it in the usual distribution packet
  • rocrail-4981-wheezy-armhf. A compiled version of rocrail with the rocpi library.
  • rocrail_save. An example of the rocrail.ini file and the daemon scripts
  • Setting up rocpi_v1.5. The updated version of the “book”

Next weekend I will try to prepare a specific page in the web-site to gather all the information related to the raspberry pi and rpic. And of course a good PCB coming soon.

IMG_0050p

RPICD: RPIC with daemon

$
0
0

After checking in the forum of rocrail, I have moved from the original idea of having everything package in the rocpi library  to a more HW independent approach.

In this new version, the rocpi library is just forwarding the commands through a TCP connection to the RPIC daemon, which is the one interfacing the GIPO in the raspberry pi and the serial port to access the ucontroller.

In this way rocrail can actually run on the raspberry –as it is my intention – or in any other platform, leaving the daemon the responsibility to interface the HW.

The firmware in the ucontroller has not changed from the previous post… Yeah, and I need to create a repository and a page to gather all the info related to the rpi.

Repositorio para el material relacionado con la raspberryRepository for the material related to the raspberry

$
0
0

A partir de ahora todo el material relacionado con el proyecto RPIC (raspberry and a PIC for rocrail) estará en un repositorio en launchpad, para facilitar el acceso al código y a las últimas versiones del manual “Setting up Rpic”.

From now on, all the material related to the RPIC project (raspberry and a PIC for rocrail) will be hosted at a reposinoty in launchpad, in order to make easier the access to the code a nd last versions of the manual ”Setting up Rpic”.

CODE AND HW

DOWNLOADS and MANUAL

RPICD en Arch Linux

$
0
0

Estoy probando a migrar mi instalación Rocrail con RPICD a Arch Linux.

De momento la compilación ha ido bien (actualizo el manual) y sólo me falta probarla.

Por otro lado, estoy haciendo una versión nueva del daemon rpicd para que sea independiente de rocrail y pueda comunicarse con diferentes programas de control mediante protocolos estándar.

Viewing all 14 articles
Browse latest View live