¿ªÔÆÌåÓý

Locked Re: Controlling Servos directly connected to Arduino with DCC++ Base Station #arduino #dccpp


emmanuel ALLAUD
 

I did something like this, you can find it on GitHub:
To avoid the problem that the servo keeps pushing because the endpoint is a bit too far, my sketch does a "detach" when the end point is reached.
This prevent a really annoying buzz, servo wear and power consumption.
Bye
Manu

Le dim. 28 juil. 2019 17:51, Andy Reichert <andy_r@...> a ¨¦crit?:
A basic R/C servo is a machine that uses force to reach a particular set
position against any fixed or variable resistance.? It's not
specifically designed to be appropriate or convenient for model railway
turnout throw bar applications.

If you set the servo position to end with the points 0.001" away from
the stock rail, it will stop pushing entirely at that point. If you set
the position to 0.001" past the stock rail, it will continuously try to
reach that position with all the force (and current draw) it can
provide.? This mismatch can be compensated by placing a soft spring
between the servo output and the throw bar and setting the servo
position to slightly over throw the turnout in both directions.
Otherwise the turnout construction is required to be strong enough to
withstand the repeated full force of the servo, as well as being a
realistic model.

However in order to correctly set the position for a particular servo
mounting , it is most preferable to have the setting controls to hand
where you can closely observe the throw bar setting movement. This
implies, to me at least, that the setting controls are mobile.

One sobering thought is that all this extra technology can be saved for
model railway applications by merely pulling the electronics out of the
servo and driving the motor L or R directly. Again something that is
simpler to operate by an on/off bit output from JMRI controlled
hardware. It also implies that a servo without electronics should be
somewhat cheaper than a servo with electronics. But the actual landed
cost of servos in the West has a lot to do with mass production and
overseas lower wages. Which is something that cannot necessarily be
counted on indefinitely.

Andy


On 7/28/2019 6:29 AM, bluetobits wrote:
> I use servos to control turnouts on my DCC++ layout.
> It's not really practical to hack the DCC++ code to produce outputs
> that can be directly connected to servos without compromising the DCC
> timing. - at least it's way beyond my programming skills!
> The outputs from the mega can be soft and hard patched to inputs on
> one or more separate Arduinos. It is theoretically possible to control
> 10 servos with one arduino pro mini or nano, but it really helps to be
> able to calibrate the maximum and minimum throw of the servo for the
> open and closed turnout positions. To do this will require a
> potentiometer input, and a? calibrate button, perhaps an LED to
> signify calibration mode and pot wiper position, this will leave (say
> ) 8 inputs (say D11,D12 and A1-A6) from the mega and 8 turnouts (D2 to
> D9), Calibration Switch (D10) ,Calibration pot wiper (A0) & LED (D13).
> The Arduino sketch needs to scan inputs from the DCC++ mega, change
> position value for any that have changed, and output that change to
> the servo. Pressing the calibrate button allows the position value for
> the last servo moved to be re-set by changing the pot value.. The
> sketch would need to write all values to eeprom so they can be loaded
> on power-up in the setup routine.? Of course there are plenty of
> opportunities for refinements.? I am happy to upload a mini tutorial,
> sketch and wiring diags if you would like to try it. (at ?3 per
> arduino and ?1.50 per servo it's not really expensive)
> Steve 009 in UK
>



---
This email has been checked for viruses by AVG.





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