Need help with servo move

Ok guys, I’m at a loss here:

I tried running my HI-Tec 422 servo using a simple servo program that is to move it in any position. I tried moving it to 750 but it wants to bounce and gitter. I tried 500 and it moves al the way to one side then I tried 1600 and it moves to center? 3000 moves it to the other side but still plenty of room before the mechanical stop.

Can some one provide me a simple program that will move the servo to center, then left, then right? I want to test it out to see if I might have damaged the servo. Servo VS is @ 7.8v VL is 9v.

I tried using the SSC-32 and the ABB and the servo is not behaving they way it should.

The code below is what I tried and it would not move. Servo is on P0

[code]counter VAR Word
PINx CON P0 'Pin0 uesed, change this number to the pin you want to use.

Main:

FOR counter = 400 TO 728 STEP 5
PULSOUT pinx,counter
PAUSE 20
NEXT

FOR counter = 728 TO 1000 STEP 5
PULSOUT pinx,counter
PAUSE 20
NEXT

FOR counter = 1000 TO 728 STEP 5
PULSOUT pinx,counter
PAUSE 20
NEXT

FOR counter = 728 TO 400 STEP 5
PULSOUT pinx,counter
PAUSE 20
NEXT

GOTO main[/code]

This code caused it to move back abd forth but not consistantly. I don’t understand why it randomly falls short of completing its cycle. Somtimes it goes through the full 180 deg range and another time it only goes through a 90deg range.

[code]counter VAR Word
PINx con P1 'Pin 1 uesed, change this number to the pin you want to use.

main:

FOR counter = 1 TO 20
PULSOUT pinx, 1000 ; 1000 seems to send the servo to CC 90deg
PAUSE 20
NEXT

FOR counter 1 TO 20
PULSOUT pinx, 4500 ; This does not seem right yet it works on my servo
PAUSE 20
NEXT

goto main
[/code]

Well I made some progress but I don’t understand.

The code below I changed the for next count loop to 30 and it made things a bit more stable. With the BS2, it would normally be like the following:

for counter = 1 to 150
PULSOUT PINx, 750 <— 750 would be center
NEXT

The Atom Pro has a cenet value of 2800?

[code]counter VAR Word
PINx con p1 'Pin 5 uesed, change this number to the pin you want to use.

main:

FOR counter = 1 TO 30
PULSOUT pinx,4500
PAUSE 20
NEXT

for counter = 1 to 30
pulsout pinx, 2800
pause 20
next

for counter = 1 to 30
pulsout pinx, 1000
pause 20
next

[/code]

The second parameter to pulseout uses .5us increments, so the value will be double what it would be for a Stamp or Atom. If you were expecting the center point to be 3000, the difference is probably due to the spacing between the servo horn splines. It’s impossible to get it exactly mechanically centered, which is why RC transmitters have a trim function. Since you found an adjusted center point of 2800, you have trimmed it to center. You will also have to find your endpoints in the same manner. :slight_smile:

Thanks A-Bot,

At least I have not lost my mind.

I have learned that there are significant differences between using a BS2 and an AtomPro. They said in the manual that the Syntax is about 99% compatible with a BS2, however, finding what’s different is the challenge.

If anyone else has any tips or comments about this please feel free to do so! :smiley:

It looks good until you start trying to convert code.

I have not done work converting BS2 to Atom Pro, but I have worked on converting Atom to Atom Pro. For example making my CHR3 to work using a pro. There are several threads on some of the differences, such as this one: lynxmotion.net/viewtopic.php?t=1169

Actually I don’t mind when dealing with changes in Syntax as the compiler will usually catch these for you. What can be really difficult is when the meaning of things changes. For example the duration values passed to functions such as sound commands.

Ok guys, I made a new discovery last night.

I hooked up my parallax servo to the ABB and it worked fine. The servo moved with smooth consistent operation. If I try the Hi-Tec servo (442 if I remember correctly) it’s all over the place and only on one side of the angle; always left of center regardless the pulse width. It on occasion will move right of center.

I’m thinking I fried the internal circuit board of the servo some how with all the experimentation I was doing with the sensor board. When the Hi-Tec servo was new, it worked fine with the wall adaptor I was using for several hours of operation.

you don’t have an ssc-32 or a rc radio of some sort you can test the servos with?

Yes the SSC-32 and the ABB provide the same results with the Hi-Tec standard servo. If I use the Parallax standard servo, it works fine with both the ABB & SSC-32.

I am so sorry I missed this post. Your problem is you are not providing a definition to the I/O pin that is generating the pulse. Because the pulse can be positive going or negative going you must set the I/O pin high or low first. In this case you need to set it to a low first. This will make the pulses positive going. If this is not done, it’s basically random. Plus your counts are to short… I dunno why this would effect one servo more than another.

[code]counter VAR Word
PINx con p1 'Pin 5 used, change this number to the pin you want to use.

low 5

main:

FOR counter = 1 TO 300
PULSOUT pinx,4500
PAUSE 20
NEXT

for counter = 1 to 300
pulsout pinx, 2800
pause 20
next

for counter = 1 to 300
pulsout pinx, 1000
pause 20
next

goto main

[/code]

Thanks Jim,

I’ll give this a shot today after work and post my results.

I tried setting the output pin to low as suggested but it did not work.

The Parallax standard servo works fine but the Hi-Tec 422 does not. I’m thinking the servo is bad. It worked when it was new but now it’s not. It seems to be confused as to it’s position. I wanted to post a video of it but the cameras battery charger is missing. :unamused:

It could be that the servos are bad, but don’t remove the low command, It’ll bite you in the rear if your not careful. :wink: