Mel - I would think the key would be to count the steps and hope the motor you are using has good repeatability. Another way would be to use a servo, you'd have to run linkage up the post but you could definitely stop it facing the right way.
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
WOW and I thought Latin was hard to learn . you guys are on a whole different level!
Gary
rrinkerI started thinkign about my CMRI node design.
could you summarize what CMRI defines? I assume it's rs-485 based, so what is the packet structure/size?
rrinkerMy basic node will have 5 of these (they are less than $1 each!) for 64 output ports for signal LEDs and turnout control, and 16 input ports for block detectors and switch position feedback
is each node fixed? Have you considered making the number of inputs/outputs configurable at startup through a configuratoin command?
rrinker Most implementations (other than Bruce Chubb's SMINI and SUSIC boards) leave the CMRI node address selection in code, so you have to change and recompile the sketch for each node. Since all I/O on my board comes from the 23S17's, I have plenty of pins to put in jumpers or a DIP switch to set the address in hardware.
are you dedicating 5 inputs for address?
you could use optional pull-up/pull-downs on 5 of the outputs that are read at start up to determine the address before programming the I/O pins as outputs
another alternative is to program the address in the atmel EEPROM
rrinkerD10 for the slave select line for the output bank D9 for the slave select line for the input bank
D9 for the slave select line for the input bank
can you explain the purpose of these?
rrinkerThe library for the 23A17 allows you to specifiy which data pin is used as the select. So I am dividing up the inputs from the outputs)
can explain this more? why divide the inputs and outputs?
I assume there are 16-bit transmitted to/from the device during each interval. The master (arduinoe) sends an output bit while the salve (MCP) sends the corresponding input.
It's been a while since I worked on I2c. Doesn't it precede data with an address. I see the 23S17 uses a !CS. Does this require a separate data pin to select each chip?
greg - Philadelphia & Reading / Reading
Marc_Magnus Mel, I beleive but not sure you can find may be an answer on the following blog for step by step motor contol by Arduino. In the case of not, you could probably answer this bloger, he answer at any question about Arduino and share the answer. Good luck. Marc The address is http://model-railroad-hobbyist.com/blog/geoff-bunza
With the turnout controller nearly done, I started thinkign about my CMRI node design. Like the turnout controller, prototyping is being done using Arduinos, but the final product will be built using bare Atmel ATMegas328P chips since the in use boards don't need things like extra voltage regulators, USB ports, or unused pins.
To get enough digital pins, I am using Microchip MCP23S17 port expanders. These communicate to the Arduino with SPI, and each one has a pair of 8 bit ports. My basic node will have 5 of these (they are less than $1 each!) for 64 output ports for signal LEDs and turnout control, and 16 input ports for block detectors and switch position feedback (not sure if I am going to do that). That should cover any interlocking I can think of, but just in case I will lay the boards out with a space for an extra chip each on the input chain and output chain (simple code change to add the extra bits - or leave off a chip or two when not needed).
Most implementations (other than Bruce Chubb's SMINI and SUSIC boards) leave the CMRI node address selection in code, so you have to change and recompile the sketch for each node. Since all I/O on my board comes from the 23S17's, I have plenty of pins to put in jumpers or a DIP switch to set the address in hardware. So far I have the following pin arrangements:
A0-A5 for the address selection, which allows 64 of these nodes. I looked at my prelimiary track plan and it looks like I will need no more than 1/4 that number at most.
D13 for the SPI SCK clock line
D12 for the SPI MISO line - data from the 23S17 to the Arduino
D11 for the SPI MOSI line - data from the Arduino to the 23S17
D10 for the slave select line for the output bank
(note on the last two, the 23S17 has 3 address pins of its own, which allows up to 8 of them on one SPI line, or the 2317 which uses I2C can do the same). The library for the 23A17 allows you to specifiy which data pin is used as the select. So I am dividing up the inputs from the outputs)
D0 and D1 are the serial port
D2 for transmit enable to the RS485 transceiver chips
D3 for a status LED that tells me the loop is running.
Questions? Comments?