¿ªÔÆÌåÓý

Locked Re: Turntable


 

I've found a workaround that seems to work. I'm sure there's a better way, but I'm still learning!
It may be specific to my hardware, but this is what I've done.
System Hardware:
I'm using a DCC++ base station (Mega 2560 Arduino and motor shield) . JMRI allows the DCC++ Arduino's? abundant output pins to be mapped to turnouts, sensors and lighting.? I built my own 50mm diameter turntable (3d printed)? for my 009 mining layout. It is stepper motor controlled using one of he cheap geared motors and an Arduino. The stepper motor moves the head of the turntable to each of the 4 rays.?Photos??I've made a few changes so some of the panels don't relate exactly to the model. I will be tidying it all up and improving the appearance once the issues are sorted,? The servo motor in the photos lifts a couple of Neodymium magnets that stops a gravity run truck on the turntable and then lowers to release the truck to? continues down the correct siding.? Four momentary push buttons allow manual selection of the desired ray. The hardware panel push buttons are at each ray of the turntable but are under the printed plastic sheet . I connected 4 DCC++ arduino? pins, configured as turnouts in parallel with the manual switches. I am using pull-up resistors so a signal that is +5v (high) is "off" and a grounded signal 0v (low) is "on"., so both the DCC signal and the manual pushbuttons can live happily together without shorting.
The Arduino mini controlling the turntable needs a momentary 0v to trigger a move to a new position (I also have a turn knob for calibrating the positions) so that just leaves the JMRI bit:
JMRI:
I set up 4 internal sensors STT1, STT2, STT3 and STT4? from the sensor table and 4 external turnouts for the turntable rays TTT1, TTT2, TTT3, TTT4. I attached these turnouts to DCC++ arduino pins so that "closed" puts High (5V) and? "thrown" puts Low (0V)? on each pin. (Configure base station on the DCC++ menu on the main Panel Pro window.)
(Each pin connects to the TT arduino mini along with the respective manual ray switch.) I placed a turntable on the layout panel ensuring to uncheck the DCC turntable box
I placed a sensor on each raypoint and made them all momentary.
I then created a route RTT1 triggered by sensor STT1 "active" to set TTT1 to "thrown".? A second route RTT1rel (release) triggered by STT1 "Inactive" sets TTT1 to "closed".
I repeated this process for the remaining 3 turntable rays creating a set and release route for each sensor. Clicking the sensor sends a signal to the respective ray input on the Arduino.
To get the turntable to animate on the layout panel, set up 4 dummy internal? turnouts from the and set the turntable to DCC attaching a dummy turnout to each ray. Ensure the sensor icon is over the control circle of each ray. clicking the sensor also triggers the turntable circle.??
If anyone would like diagrams, BOM, Arduino sketch (software), 3D files (.stl or sketchUp)? ?I would be very happy to post them here. I can even print out the plastic parts? if you cover my expenses, but it is only a 50mm turntable for 9mm peco setrack, and scaling it up won't work!?
My total spend on the turntable has been around ?10 ( $15)? ?not including the DCC++ base station.

@ John Wragg. : Wirral. where are you?.

Steve


Join [email protected] to automatically receive all group messages.