First Servo Pulsing?

willis192

New Member
Hi guys,

I'm new to all this robotics malarkey and seem to have come accross a snag and was wondering if someone would help me.

I'm running a Pic28 board with a 28X1 with the servo upgrade DIL chip. I have two Hitec HS-81 servo's which I have adjusted for continual motor drive using seperate 22 turn pots. I have two microswitches which i'm going to use as front sensors. The problem I have is when using the following code:

main:

IF pin4 = 1 OR pin5 = 1 THEN drive

servo 3, 128
servo 6, 128
pause 400

goto main

drive:

servo 3, 70
servo 6, 70
pause 400

goto main

The first servo always has a constant jitter like pulse, in this case servo 3.

Am I missing something vital from the code or is that just the way the picaxe works?

Thanks

Andy
 

Rickharris

Senior Member
No it should be solid. If you swap the servo will it still jitter (i.e. is it the servo?)

Try placing a slight pause before and between the 2 servo commands to give things a chance to settle down.

 

BeanieBots

Moderator
As stated by Rick, they should be rock solid. Certainly worth putting a pause20 between any servo updates.
Also worth just changing the order in which you update them and/or different pins.
For applications that require frequent updates such as variable speed walking robots I have had to resort to using pulsout and generating the 20mS frame in code but your application should not suffer in that way.

Edited by - Admin on 09/08/2007 16:20:17
 

alpacaman

Member
I'm having the same problem. I'm using 2 servos in a clock application. Whenever the minutes servo gets a command the hour servo pulses. There's a 60 minute pause between the 2 servo commands - so I know that's not the problem. The servos are running on a seperate power supply than the picaxe - with the commons tied together. I'm using the latest and greatest software from Revolution Education.

 
 

Technical

Technical Support
Staff member
You are constantly re-issuing the same servo command in the loops, which is unnecessary and disrupts the 20ms timing to the servo. This can cause jitter.

Change to this, which is functionally the same but does not re-issue the command every loop.

main:
servo 3, 128
servo 6, 128
pause 400

loop1:
IF pin4 = 1 OR pin5 = 1 THEN drive
goto loop1

drive:

servo 3, 70
servo 6, 70
pause 400

loop2:
IF pin4 = 1 OR pin5 = 1 THEN loop2
goto main
 

alpacaman

Member
Since I'm having the same problem I reviewed my code. Every second I update the minute servo which causes the hour servo to jitter. I'm not resending the hour servo command until I need to advance the servo.

symbol minutes = b0
symbol hours = b1
symbol minServo = 1
symbol hrServo = 0
symbol hrAdvance = b2

hrAdvance = 0
hours = 100
minutes = 208
servo minServo,minutes
servo hrServo,hours


main:
minutes = minutes - 2
hrAdvance = hrAdvance + 1
servo minServo,minutes
if minutes = 88 then
minutes = 212
end if

if hrAdvance = 12 then
hours = hours + 2
hrAdvance = 0
servo hrServo,hours
if hours = 220 then
hours = 90
end if
end if

pause 1000
goto main

 

Edited by - alpacaman on 09/08/2007 19:51:51
 

Wrenow

Senior Member
Could also be power glitches. Have you checked out the schematic of the AXE024? It gives an example of how to filter. I had some servo glitches until I started using the AXE024. Now, not so much.

Wreno
 

alpacaman

Member
The PICAXE (08M) and the servos each have their own power supply using 7805 regulators.
I phyisically swapped the 2 servos around to see if it was the servo. The problem moved to the other servo.
The servo that would pulse when I sent a signal to the other servo is connected to pin 7 of the chip. I programmatically reversed the function of the 2 servos and it seems to have fixed the problem.

Could there be a problem using pin 7 since it is also the seriel out used for programming the chip?

Was wondering if Willis has fixed his problem.

 

Edited by - alpacaman on 10/08/2007 14:26:48
 
Top