PDA

View Full Version : problems with Servo Motors...



saturnX
- 9th March 2006, 00:57
Yet again this project of mine involves a couple of servo motors only this time not in a walking robot but rather in a small fork lift put together using Lego pieces. But i seem to have this unusual problem where the servo motor behaves in an erratic manner when power is apllied (6v). After turning on and off the power a few times it finally behaves. I was wondering is this was due to the power supply to the 16F84 and servo motors? This also happens to my bipedal robot from time to time when power is applied to it.

also, i seem to have regular problems with the pulsout to the servo motors. does the time interval affect pulsout in codes? i can't seem to catch on to it for some reason.

ps. was not too sure where this post should go so pls dun kill me Melanie ;)

Acetronics2
- 9th March 2006, 09:15
Hi, Saturnix

Servos always have little movement at power up ... that's it !

For PULSOUT, just read ( very) carefully your manual,( Pulsout section + "driving large capacitive loads" section ) and you'll discover why a simple " LowPortX.Y" before PULSIN can avoid any signal problems.

Think to let a while to the servo-amplifiers to settle ...before asking them movements. The current draw, for few ms may reach 3/4 amp per servo ...
so, the PIC must have a private regulator to work properly.

Not so bad nor to have a separate batt just to feed the servos ...

For time interval, let's say signal period must be 20 to 50 ms ... for conventionnal servos, to have enough output power ;

a period change in that interval doesn't disturb too much the servo.

note a shorter period CAN be applied to "High end" Gyro servos ( 5 to 8 ms ).

For the end, Using the internal reset of the PIC is not a good idea here ... read µChip 16F84 Datasheet for info about reset circuitry.

read you next time
Alain

picster
- 9th March 2006, 17:04
I use HIGH and LOW instead of pulsout, with a pauseus in between, repeated every 16mS and it seems to work out fine for a futaba S148. Pulse width for the S148 is defined as 600uS-2400uS, with a midpoint of 1500uS.

By running the servos off a different power supply than the PIC, you'll avoid any brownout resets, which are particularly noticable under any significant servo load. Obviously you have to provide a common 0V reference voltage (ground) between the two.

---------------------Picster--------------

saturnX
- 10th March 2006, 07:29
thanks for the replies guys.. i never knew servo motors would do that on start up.. never had it happened before so found it strange. Is it common though?

this is how i have written the pulse to the motor:


Servomotor:
pulsout portb.0, b(0) 'Send current servo 1 position out

pause 5 '5 milisecond delay to generate 50 Hz signal
return 'To servomotors
'-------------------


That's like a standard common way of writting the pulsout code isn't it? Although i might consider separating the power supply to the pic and the servo motor but that is really a strange thing to do and adds more weight to the robot.

@Acetronics
Would u mind if i PM you later on to further discuss this topic related to another project of mine which took forever to complete. Again it deals with servo motors. Let me know.

Cheers guys for the feedback. will have a tweak at the project later on. oh is the Code tags available in the forum? can't seem to get it to work

Acetronics2
- 10th March 2006, 09:09
[QUOTE=saturnX]Servomotor:

pulsout portb.0, b(0) 'Send current servo 1 position out

pause 5 '5 milisecond delay to generate 50 Hz signal
return 'To servomotors
'-------------------


Hi, Saturnix ...

Pause 5 is much too short !!! pulsout is 1 - 2 ms, so pause must be ~18ms for ~ 50 Hz framerate.

Some servos do not like like that at all !!! DANGER !!!

Alain

picster
- 11th March 2006, 01:43
Also, be sure that your pulse widths are within the design specs of the servo - if you use a simple pulsout command with a 4MHz clock, you'll have to some math to figure out your MINIMUM and MAXIMUM widths that you can allow, and then spread that range out over 256 steps.

For example, if your servo specs say 600uS to 2400uS then your pulsout would have to be a MINIMUM of 60 and a MAXIMUM of 240 with a 4MHz clock. Beyond that, you'll start overheating (and grinding the gears of) the servo, pushing it past its mechanical limit. If you look at the range in this example, you have a range of 240-60=180, so you can calculate what you should output as 60+(180n/255) where n is your "real" range of 0-255. Thus for a 'n' of 0, you'll have a pulse width of 600, and for a 'n' of 255, you'll have a result of 2400.

It's probably also a good idea to initialize the pin as LOW, just as a housekeeping measure.

--------------------Picster-----------------