PDA

View Full Version : Parallax Servo Controller



Bill Chennault
11-09-2006, 11:44 PM
All--

Does the Parallax Servo Controller board--and its software--have functionality for continuously rotating servos?

--Bill

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.

don_s
11-09-2006, 11:56 PM
Bill,
here is a thread that I starte on the PSC.

http://forums.parallax.com/forums/default.aspx?f=5&m=153358.

They tell me that it does, I am having trouble getting good results. Now I am a relative newbie so take that with a grain of salt.

Don_S

Special_K
11-10-2006, 12:27 AM
I use it on a project to control 4 continuous rotational servos and 8 standard servos. I had a little trouble at first with the full stop and even forward movement. I did some testing and matched up the servos per side (most similar responses grouped on a side together) found the right values. Set those values in a subroutine
.

fwd: 'go forward
whspr = 654 '
whspl = 859 ' | | f
jpos = 750 ' | | f
jpos2 = 750 '
GOTO implmnt

implmnt:
SEROUT Sdat,baud+$8000,["!SC", flj, 0, jpos2.LOWBYTE, jpos.HIGHBYTE, CR]
SEROUT Sdat,baud+$8000,["!SC", frj, 0, jpos2.LOWBYTE, jpos.HIGHBYTE, CR]
SEROUT Sdat,baud+$8000,["!SC", rlj, 0, jpos.LOWBYTE, jpos.HIGHBYTE, CR]
SEROUT Sdat,baud+$8000,["!SC", rrj, 0, jpos.LOWBYTE, jpos.HIGHBYTE, CR]

SEROUT Sdat,baud+$8000,["!SC", flw, 0, whspl.LOWBYTE, whspl.HIGHBYTE, CR]
SEROUT Sdat,baud+$8000,["!SC", rlw, 0, whspl.LOWBYTE, whspl.HIGHBYTE, CR]
SEROUT Sdat,baud+$8000,["!SC", frw, 0, whspr.LOWBYTE, whspr.HIGHBYTE, CR]
SEROUT Sdat,baud+$8000,["!SC", rrw, 0, whspr.LOWBYTE, whspr.HIGHBYTE, CR]
RETURN



hope that helps

Post Edited (Special_K) : 11/9/2006 4:33:18 PM GMT

don_s
11-10-2006, 12:39 AM
Thanks Special_K, I will give that a try tonight.
Last night with testing, I finally got one servo to do what I wanted, but when I changed pins. It wouldnt work again.
Have you ever had this happen?

Don_S

Bill Chennault
11-10-2006, 01:13 AM
don_s (http://forums.parallax.com/member.php?u=44469)·and Special_K--

Thanks to both of you!

--Bill

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.

Special_K
11-10-2006, 01:20 AM
here is some of the set up info..



'-------[STAM/PBASIC]----------------------------
'{$STAMP BS2}
'{$PBASIC 2.5}

'-------[PROGRAM DESCRIPTION]---------------------

'-------[CONSTANTS]-------------------------------
flj CON 03 'forward left joint
flw CON 02 'forward left wheel
frj CON 05 'forward right joint
frw CON 04 'foward right wheel
rlj CON 07 'rear left joint
rlw CON 06 'rear left wheel
rrj CON 01 'rear right joint
rrw CON 00 'rear right whee
Sdat CON 15 ' PSC Module
baud CON 396 ' BS2 baudmode (2400 baud, 8-bit, no parity)

'-------[VARIABLES]-------------------------------

whspr VAR WORD 'Variable for right wheel speed
whspl VAR WORD 'Variable for left wheel speed
jpos VAR WORD 'Variable for joint position
jpos2 VAR WORD 'Varriable for other joint

Chris Savage
11-10-2006, 01:31 AM
Hello,
·
·· The PSC is simply sending out the pulses based on the width you specify in your commands.· These would be the same pulses sent by a BASIC Stamp or an R/C Receiver to the servos.· It doesn’t matter if the servos are standard or continuous rotation since they all accept the same range of pulse widths for control, however no 2 servos are exactly the same and results can vary from one servo to another on the same pin at the same pulse width.· Continuous rotation servos are a little more difficult sometimes because they can have different center/stopping values, especially if not calibrated.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

Special_K
11-10-2006, 01:35 AM
don_s,
if you changed pins ether physical or program did you change the the other physical or program to match.
Also the PSC pin / servo numbers are not that intuitive to me. They alternate between sides so 0 is on one side and above it is 2 then 4...ect. Got me twice in late night programming.

don_s
11-10-2006, 10:46 PM
Special_K,
Yes I did. I created a step program and found the values that would allow my servos to go forward/Reverse and stop. I modified a program then with these vallues and ran the program. The servos never moved.

After much frustration I decieded to do the one program that I know works and check the version. Now the Stamp could not find the version of the PSC. I pressed both the rest button on the PSC and the BOE-Bot with no effect. I then remeoved all power to both the stamp and the PSC board for a few minutes..

Plug everything back in and the stamp now finds the PSC and get the version.. Ran out of time and could not try the orginal program..

I am guessing that the stamp and PSC got out of sync. Whould you use a timeout on the SERIN command to determine if the two were still talking? Will the servos stay at the rate/postion of the last command if they did get out of sync?

Thanks
Don_S

Special_K
11-11-2006, 01:00 AM
Ok.
I know the values that control the PSC are basically the same ones that control the servos using the Basic stamp. So you were able to send code (data from the BS 2) to the PSC and get servos to move? If this is the case then you are halfway there. What is different about the code you are using to make the servos move and the actual program code.
I have not tsted it since I do not have a PSC at work.
Try this code.

Special_K
11-12-2006, 02:00 PM
any luck on that?

TechnoRobbo
11-13-2006, 12:44 AM
If you send the code below at the beginning of the program it will garauntee that the PSC will sync with the BS2 when you reset or upload a new program revision.

Also, remember servos are analog devices not digital therefore they don't have an exact·value for "Stop". All your servos may have been calibrated differently since in essence they (or you) are fooling the servo to rotate continously.

A part in the continuous servo, that tells it's little electronic brain what postion it's in, has been removed and the servo is fooled to thinking it's in the center of it's rotation. Therefore when you tell the servo to go full clockwise or counterclockwise (anticlockwise for those of you across the pond) , the servo chases it's tail like a dog in that direction because it never knows it got there. When you tell it to go to the "center" position it stops because thats where it thinks it is.

Once you find that "stop" value for each servo, it may go out of calibration 5 years from now. Thats why the have a calibtation screw. Standard servos (unmodified) never need calibration but they don't all respond to the same position for the same value but they're close.

Sync code- run once at the beginning:

SERVO PIN 15 'Servo Interface yours may be different.
BAUD CON $818C 'initial baud
HiBAUD CON 6

SEROUT SERVO, HiBAUD,["!SCSBR",0,CR]'Slow PSC down if reset occurs
PAUSE 100
SEROUT SERVO, BAUD,["!SCSBR",0,CR]'Send at low baud also - just my paranoia
PAUSE 100
SEROUT SERVO, BAUD,["!SCSBR",1,CR]'set high baud

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun


TR

Post Edited (TechnoRobbo) : 11/12/2006 6:54:50 PM GMT