Here is an adapted test program that shows the position value
that a servo at channel 0 is moved to (var preset) and the position
value that is returned from the psc class (var pos).
Just to check how the psc board returns the position.
I searched the basic stamp forum and found this BS1 program by Jon Williams (so it works) http://forums.parallax.com/attachment.php?attachmentid=39171
It has the following piece of code
Wait_For_Position: · SEROUT Sio, Baud, ("!SCRSP", 0, 13) · SERIN· Sio, Baud, id0, posHi, posLo · DEBUG #thePos, CR · IF thePos <> 1000 THEN Wait_For_Position
which confirms that the get position command returns x y z
where x=channel and y:z is position, not z:y as the manual states.
Bulkhead, Thanks a lot for jumping in to attempt to help me with this weird problem.
I am running the servo's with it's own power supply. I am only testing one servo at a time. I did not make any changes to the test program and I am using the PSC provided in the Javelin code group. So, is there any more ideas?
Also Like I had mentioned before, something real stange happened to the PSC, it was generating random values for the position of the servos, and it moved the servo slightly to the right! I remember swapping grounds in our whole circuitry and all of a sudden the servo moved once, the treminal window did not show up, but when I accidently removed the serial line of the PSC from pin0, the terminal window showed up displaying new values for the current position of the servo. Do you or anyone know what this is all about?
Did you use coninuous servos? Because my continous servos won't stop moving as soon as I turn the PSC switch on. Do you have an idea of why that is happening?
Continuous rotation servos are supposed to do that. They only stop moving if you give them a PWM value that is equal to their center position. You can adjust it's center position by turning the potentiometer built into the servo.
Sorry, yeah the continuous rotation servos can be used just like regular ones. The only difference is that the potentiometer on cont rotation servos is disabled. Imagine the PSC telling the servo to go to position X, and the servo will keep spinning until it gets to position X. However, with a continuous rotation servo, it never gets there, since it's potentiometer is disabled (no position feed back).
You use cont rotation servos by giving it a "home position" value, then adjusting the potentiometer on the servo until the servo stops moving. I usually use the center position of a servo as the home position, just to make it easy. Basically, you have your PSC/javelin send out PWM at that pulse width and then manually set your servo to 0 (that is, make it stop moving). This is a lot easier than trying to find the 0 movement pulse value on the PSC/javelin.
I hope that makes sense. If it doesnt, just hook up a cont rotation servo, have your PSC output a certain position value, then use a screw driver to turn the potentiometer on the servo. Keep turning in either direction until you find the point where the speed changes (and probably reverses directions).
Comments
that a servo at channel 0 is moved to (var preset) and the position
value that is returned from the psc class (var pos).
Just to check how the psc board returns the position.
regards peter
http://forums.parallax.com/attachment.php?attachmentid=39171
It has the following piece of code
Wait_For_Position:
· SEROUT Sio, Baud, ("!SCRSP", 0, 13)
· SERIN· Sio, Baud, id0, posHi, posLo
· DEBUG #thePos, CR
· IF thePos <> 1000 THEN Wait_For_Position
which confirms that the get position command returns x y z
where x=channel and y:z is position, not z:y as the manual states.
So I updated the psc class and uploaded it here
http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/peripheral/servo/psc/
regards peter
I am running the servo's with it's own power supply. I am only testing one servo at a time. I did not make any changes to the test program and I am using the PSC provided in the Javelin code group. So, is there any more ideas?
Also Like I had mentioned before, something real stange happened to the PSC, it was generating random values for the position of the servos, and it moved the servo slightly to the right! I remember swapping grounds in our whole circuitry and all of a sudden the servo moved once, the treminal window did not show up, but when I accidently removed the serial line of the PSC from pin0, the terminal window showed up displaying new values for the current position of the servo. Do you or anyone know what this is all about?
Did you use coninuous servos? Because my continous servos won't stop moving as soon as I turn the PSC switch on. Do you have an idea of why that is happening?
Thanks
You use cont rotation servos by giving it a "home position" value, then adjusting the potentiometer on the servo until the servo stops moving. I usually use the center position of a servo as the home position, just to make it easy. Basically, you have your PSC/javelin send out PWM at that pulse width and then manually set your servo to 0 (that is, make it stop moving). This is a lot easier than trying to find the 0 movement pulse value on the PSC/javelin.
I hope that makes sense. If it doesnt, just hook up a cont rotation servo, have your PSC output a certain position value, then use a screw driver to turn the potentiometer on the servo. Keep turning in either direction until you find the point where the speed changes (and probably reverses directions).