parallax servo controller, code?
magi
Posts: 35
Hi
I have a Mini SSC and to control it I send hexa decimal code "FF0240"
FF - is activationcode for Mini SSC
02 -is number two of eight servos that will react
40 - is the angel the servo is to move to.
Can somebody tell be what kind of code I must send to a parallax servo controller #28023
in hexa dec code?
or in byte?
how do i for instandce translate the first "!SC" and last "CR" to byte or hexa
and what about "pw.lowbyte" and "pw.highbyte"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
I have a Mini SSC and to control it I send hexa decimal code "FF0240"
FF - is activationcode for Mini SSC
02 -is number two of eight servos that will react
40 - is the angel the servo is to move to.
Can somebody tell be what kind of code I must send to a parallax servo controller #28023
in hexa dec code?
or in byte?
how do i for instandce translate the first "!SC" and last "CR" to byte or hexa
and what about "pw.lowbyte" and "pw.highbyte"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Or dont you know?
would it look like this:
[noparse][[/noparse]"!SC", 11, 7, 1250, 1250, 0D] = [noparse][[/noparse]?? 0B 07 4E2 4E2 0D]
So I dont need to send CR or $0D ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/5/2006 11:22:26 PM GMT
· SEROUT Sio, PscBaud, [noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
Note that with serial communications everything is byte-oriented, so the position value (in pw) is sent as two bytes -- PBASIC variable modifiers make this easy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Or maybe someone can give me a link to the document where the info is?
I need the documentation about the code in byte or hex to control the PSC.
Can somebody tell me what the code(SEROUT Sio, PscBaud, [noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR])
would look like in hex?
So I dont need to send CR (or $0D) ???
Peace and Love
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/5/2006 11:36:01 PM GMT
··· http://www.parallax.com/dl/docs/prod/motors/ServoController.pdf
As you'll see, the demo code is quite straightforward, and there's no need to make it harder than it has to be.· The code in that documentation will work as it's presented.· Remember that numeric systems (binary, decimal, hex) are for us humans; internally, the values are all 1s and 0s and looks the same, no matter how we choose to express them.
· "A" = %01000001
· 65· = %01000001
· $41 = %01000001
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 3/5/2006 11:40:51 PM GMT
I am coding in machine code and if it is possible to get the information of a
control string in hex or byte I would be happy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I still would like to know what "!SC", pw.LOWBYTE and pw.HIGHBYTE is in hex.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
The variable pw is just that, a variable, so you will designate it as such in your source code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Thanks.
Regards Magi
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
http://www.cs.mun.ca/~michael/c/ascii-table.html
"!" stand for "0x01" and not "0x21"
What is correct? [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 3/6/2006 2:56:28 AM GMT
Thanks... [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
I can send this code to a Mini SSC to move a servo:
Hexa decimal code "FF0240"
FF - is activationcode for Mini SSC
02 -is number two of eight servos that will react
40 - is the angel the servo is to move to.
To control the Mini SSC it needs three bytes.
Byte 1 = sync marker
Byte 2 = servo nr
Byte 3 = position
Can somebody tell be what kind of code I must send to a parallax servo controller #28023
in hexa dec code or byte to move a servo?
I try to send this:
21534300071901900d
215343 is !SC
00 is servo nr
07 is ramp speed
190 is hex for pos 400 lowbite
190 is hex for pos 400 highbite
0d is CR
I guess its the lowbite, highbite that is missing in hex or something..
Does anybody know why it doesnt react?
Can somebody give me the code in bits or bytes so I can transform it to hex code?
What does basic stamp send in bytes or hex when it set a servo?
Regards Magi
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/7/2006 12:26:27 AM GMT
PAR
·
A send command looks like:
/com/serial.cgi?write=FF0240
for the Mini SSC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/7/2006 1:14:13 AM GMT
if it is indeed supposed to be sent to the PSC from a PBasic "VAR WORD" as the Parallax documentation states, in two parts, low.byte and hi.byte order, then I get
90 for the low.byte and 01 for the hi.byte· (not 190 for each as you stated above).
(Your serial.cgi?write command requires hex-coded· (x= 0-->F)·byte-sized (xx)·data, I believe, as you stated).
Jon also mentioned the matter of lsb / msb (endian?) which might be an issue in your particular coding environement --dunno?
I don't recall you mentioning how you get the comm port data rate coordinated between your program and the board?
And, have you tried to get the board to tell you what version it is (that command sends all ascii char string data, so you should be able to represent the byte hex encoding of it straight-forward).
PAR
I sent
/com/serial.cgi?write=215343000790010d
but i got no reaction. [noparse]:([/noparse]
I dont understand what lsb / msb (Least Significant Bit, Most Significant Bit) have to do with this.
Can somebody explain?
I sent this to set baudrate as high as possible.
/com/serial.cgi?write=215343534252010d
The Mini SSC is set to recieve 9600 and it just works.
I have not set the speed of the transmitter. It just works betwen transmitter and Mini SSC. Transmitter can send up to 115 kbps.
Anybody got any idea?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/7/2006 3:39:15 AM GMT
The PSC documentation states:
···· Syntax: “!SCSBR” x $0D
····· where x is either 0 for 2400, or 1 for 38K4
So, it seems you need to send a suitable representation of "0" or "1" (when using your serial.cgi?..., I think you have to send the hex byte representation of 0 or 1· -- 00 or 01)
But, initially, you need to talk to the PSC at 2400bps; the documentation states:
····· The PSC does not support Auto-Baud. When your PSC starts up, the default
····· baudrate is 2400.
Once communication is established, then you can change to the higher bps rate (38400).
However, even before all this, note that the documentation states that communcations signal levels used with the PSC·are (swinging between) 0 and 5 volts (ttl levels). How are you connecting your PSC to your programming device?
PAR
"53" is "S"
"42" is "B"
"52" is "R"
"01" is "1" for 38K4
I have connected it just like the Mini SSC that works. [noparse]:)[/noparse]
www.seetron.com/pdf/ssc2_mnl.pdf
Page 4. Top picture.
"Figure 2. Wiring DB9 serial connector to a modular cable for use with SSC."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/7/2006 11:29:33 AM GMT
Lets take this slow. Are you sending the SBR (set baud rate) command at 2400 baud? In hex, to change the Baud rate you would send:
21 (!),53 (S),43 (C),53 (S),42 (B),52 (R),1 (to set the Servo controller to 38K4 rate),0D (CR)
but this must be sent at 2400 baud. The controller would then send back at 38k4 baud:
42 (B), 52 (R), 01 (indicating baud rate of 38k4)
If this doesn't happen, I would try just asking the Servo Controller for it's version number to verify you are communicating with the Controller.
Hope this helps.
P.S. Looking at the PDF for the SSC, it looks like you will also have to hook a +5V to the Servo controller, as the documentation indicates (Parallax Servo Controller documentation, page 2 "A three-conductor cable connects ground, +5VDC, and serial I/O line....)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
Remember - No matter where you go
There you are.
When I send
21 (!),53 (S),43 (C),53 (S),42 (B),52 (R),1 (to set the Servo controller to 38K4 rate),0D (CR)
21534353425210d
I get an error "#Error#Bad char in dataout# "
but with "01" instead of "1" I dont get an error, but no reaction.
21 (!),53 (S),43 (C),53 (S),42 (B),52 (R),01 (to set the Servo controller to 38K4 rate),0D (CR) [noparse]:)[/noparse]
215343534252010d
I have 5+ to both Mini SSC and PSC
Still no reaction. [noparse]:([/noparse]
Is this right code to set a servo?
215343000790010d for sure.
21 (!),53 (S),43 (C),00 (Servo nr 00),07 (Ramp rate 7),90 (LowBite of hex pos 190),01 (HighBite of hex pos 190),0D (CR)
Can somebody at Parallax confirm?
When I turn the PSC on the servo goes to midle position as it is supposed to.
So it can control a servo.
Maybe best to get some Mini SSC instead if nobody have an idea.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/7/2006 4:30:18 PM GMT
If you are sure your power connections are right, then the code looks good. Do you have a Basic Stamp you can test the PSC with? If so, try the Servo controller with commands from the Basic Stamp. If not, I'm not sure what your next step should be.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
Remember - No matter where you go
There you are.
Once you send the correct "01", then you get no reaction probably because your PSC is not receiving what it needs, either in electrical signalling and/or in logical data?
Earlier I responded,
"However, even before all this, note that the documentation states that communcations signal levels used with the PSC·are (swinging between) 0 and 5 volts (ttl levels). How are you connecting your PSC to your programming device?"
You have not indicated yet how your communications cable is connected to the PSC. The wiring diagram you cited from the Mini SSC document, to connect between a PC comm port and the Mini SSC suggests that the Mini SSC "understands" RS-232 level voltage signalling (which swings widely + and - ). The PSC's signal communications responds to swings only between 0 and +5 volts.
So, again, what signal source (not power source)·is _your_ PSC connected to?
The PSC is not a Mini SSC, and so following the Mini SSC documentation·for how to connect the PSC to a PC (or other non BS2 device) is just not going to help. And, the PSC documentation doesn't tell *how*· to build the electrical circuitry to connect it to non-BS2 signalling sources.
PAR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
But it didnt help eighter.
But I dont need to send SBR.
I have a IF232
http://www.equinox-tech.com/test/details.asp?ID=102
and I will try to use it between rs232 and PSC.
Maybe it fix the problem. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]
Post Edited (magi) : 3/8/2006 1:52:10 AM GMT