An international forum for garden railway modellers in all scales and gauges. It is free to join and is funded through voluntary contributions by its members. Many thanks to all those who keep it going. https://gardenrails.org/forum/
gregh wrote: ↑Sun May 27, 2018 12:05 pm
The Picaxe manual recommends using a 330 ohm resistor on the control output pin to a servo. Ie in series.
I don't know why.
Thanks Greg. Yes, I heard that as well. Whilst searching for an answer to my problem yesterday, I came across numerous references to it on R/C and Robotics forums, and nobody seems to know why! I can't help wondering if it's another case of "it's on the 'net so it must be true"!
Having said that, the consensus seems to be that it can't hurt so do it anyway, which I have done.
On the basis of one quick test, I think I have two servo's doing what I want, but I'm saying no more until I'm sure.
Re: Picaxe servo control
Posted: Sun May 27, 2018 12:52 pm
by tom_tom_go
You are doing well Phil coding in this weather, it's too hot for me to go anywhere near my laptop!
gregh wrote: ↑Sun May 27, 2018 12:05 pm
The Picaxe manual recommends using a 330 ohm resistor on the control output pin to a servo. Ie in series.
I don't know why.
Thanks Greg. Yes, I heard that as well. Whilst searching for an answer to my problem yesterday, I came across numerous references to it on R/C and Robotics forums, and nobody seems to know why! I can't help wondering if it's another case of "it's on the 'net so it must be true"!
Having said that, the consensus seems to be that it can't hurt so do it anyway, which I have done.
On the basis of one quick test, I think I have two servo's doing what I want, but I'm saying no more until I'm sure.
I think it's to protect the outputs on the microcontroller, in case the output accidentally gets shorted to ground or power. Say the output is on at 5V, and you short it to ground through a 330 ohm resistor, the current will be 5V/330ohms = 15mA, gives a nice safety net below the maximum rated 25mA sink/source current for an output pin on a PIC. Without the resistor, the current could be very high and blow output transistors inside the uC.
Re: Picaxe servo control
Posted: Wed May 30, 2018 12:15 pm
by philipy
After a short delay due to the need to do some gardening, fix a garden feature waterfall and other 'essential' non-railway activities, I can confirm that I have got my servo's working nicely and driving a spare Peco point on a piece of Plywood.
All I want now is for the weather to warm up, and dry up again, so that I can go down the garden and install the stuff!
Thanks once again for the advice and help, guys, and especially to Greg.
I think my basic problem stemmed from trying to do it in theory without being able to test out small steps along the way, and in doing so making everything far more complicated than it needed to be!
Re: Picaxe servo control
Posted: Wed May 30, 2018 12:48 pm
by tom_tom_go
Don't forget to post a video of it in action
Re: Picaxe servo control
Posted: Tue Jul 10, 2018 10:32 am
by philipy
tom_tom_go wrote: ↑Wed May 30, 2018 12:48 pm
Don't forget to post a video of it in action
Bet you thought I'd forgotten, or given up??
Well, there are very good reasons why I've been quiet on this subject for the last 6 weeks and all will become clear in due course, but for now here are the points working. As always, it's difficult to do three things with one pair of hands, so it won't win any Oscars for cinematography...
Well done Phil, it's more effort getting points motorised above the base on the track so I can appreciate the time you have put into it.
Are you able to slow the movements down though in code?
Re: Picaxe servo control
Posted: Tue Jul 10, 2018 11:25 am
by philipy
tom_tom_go wrote: ↑Tue Jul 10, 2018 10:54 am
Are you able to slow the movements down though in code?
I'm sure it can be done. In fact Greg did suggest how to do it back earlier in the thread but I haven't tried it yet, I was more concerned with getting it to work at any speed! I think I may need to just tweak the two throw limits anyway so I'll have a play when I do that.
Re: Picaxe servo control
Posted: Tue Jul 10, 2018 10:50 pm
by gregh
Very nicely done.
Always best to get the basics working first then to fine tune the speed or whatever.
Re: Picaxe servo control
Posted: Tue Jul 10, 2018 11:02 pm
by ge_rik
Impressive!! Nicely and neatly done!
Rik
Re: Picaxe servo control
Posted: Wed Jul 11, 2018 7:45 am
by FWLR
Wow!!! Now that is brilliant.
Re: Picaxe servo control
Posted: Wed Jul 11, 2018 9:47 am
by IanC
Well done.
Ian
Re: Picaxe servo control
Posted: Sat Aug 25, 2018 10:25 pm
by dewintondave
I'm sorry I came upon this thread so late. I've used a 433MHz Tx and Rx with Picaxe to automate my first live steamer, it was a lot of fun. I had Picaxes controlling two servos, whistle and regulator, and counting axle speed. Pressing one button would sound the whistle and start the train and control its speed. Pressing the same button again would sound the whistle and slow the train to a halt. Pressing any other button would just sound the whistle, the whistle was automated to sound peep-pip-pip.