Picaxe servo control

Do you have a problem? Here is the place to appeal for help
User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Picaxe servo control

Post by philipy » Sun May 27, 2018 12:12 pm

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.
Philip

User avatar
tom_tom_go
Driver
Driver
Posts: 4824
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Picaxe servo control

Post by tom_tom_go » Sun May 27, 2018 12:52 pm

You are doing well Phil coding in this weather, it's too hot for me to go anywhere near my laptop!

metalmuncher
Cleaner
Cleaner
Posts: 95
Joined: Sat Oct 20, 2012 4:15 pm

Re: Picaxe servo control

Post by metalmuncher » Sun May 27, 2018 2:04 pm

philipy wrote: Sun May 27, 2018 12:12 pm
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.

User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Picaxe servo control

Post by philipy » Wed May 30, 2018 12:15 pm

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. :D
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! :oops:
Philip

User avatar
tom_tom_go
Driver
Driver
Posts: 4824
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Picaxe servo control

Post by tom_tom_go » Wed May 30, 2018 12:48 pm

Don't forget to post a video of it in action :thumbup:

User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Picaxe servo control

Post by philipy » Tue Jul 10, 2018 10:32 am

tom_tom_go wrote: Wed May 30, 2018 12:48 pm Don't forget to post a video of it in action :thumbup:
Bet you thought I'd forgotten, or given up?? :lol:

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...


https://youtu.be/NP97X1lkO94
Philip

User avatar
tom_tom_go
Driver
Driver
Posts: 4824
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Picaxe servo control

Post by tom_tom_go » Tue Jul 10, 2018 10:54 am

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?

User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Picaxe servo control

Post by philipy » Tue Jul 10, 2018 11:25 am

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.
Philip

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Picaxe servo control

Post by gregh » Tue Jul 10, 2018 10:50 pm

Very nicely done.
Always best to get the basics working first then to fine tune the speed or whatever.
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Picaxe servo control

Post by ge_rik » Tue Jul 10, 2018 11:02 pm

Impressive!! Nicely and neatly done!

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
FWLR
Driver
Driver
Posts: 4262
Joined: Sat Aug 05, 2017 9:45 am
Location: Preston, Lancashire, UK

Re: Picaxe servo control

Post by FWLR » Wed Jul 11, 2018 7:45 am

Wow!!! Now that is brilliant.

User avatar
IanC
Trainee Driver
Trainee Driver
Posts: 798
Joined: Mon Feb 15, 2016 9:15 am
Location: Nr. Warrington, Cheshire

Re: Picaxe servo control

Post by IanC » Wed Jul 11, 2018 9:47 am

:thumbright: Well done.

Ian
Ian

User avatar
dewintondave
Trainee Driver
Trainee Driver
Posts: 697
Joined: Mon Mar 07, 2011 8:52 am
Location: New Zealand

Re: Picaxe servo control

Post by dewintondave » Sat Aug 25, 2018 10:25 pm

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.

The Picaxe R/C system is so battery efficient

Best wishes,
Dave

User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Picaxe servo control

Post by philipy » Sun Aug 26, 2018 6:51 am

Thanks Dave. Nicely done.
Philip

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests