propeller USB servo controller HELP
RN
Posts: 28
I am using the propeller USB servo controller which can control 32 servos at a time. When i use the PSCI GUI it is working fine and giving the version when asked but when i control it using the USB and send commands serially it is not responding at all. I am sending "SCVER?"$0D from the parallax serial terminal. Please help. Also tell me can i overwrite the code in the propeller USB servo controller and the code provided on their site(FIRMWARE) should be their in the chip...
thanking in advance
thanking in advance
Comments
You can overwrite the existing firmware with your own program using any of the Propeller programming tools (like the Propeller Tool or BST).
When you receive the Propeller USB Servo Controller, it has already been programmed with the code provided on the Parallax webstore page for the Controller (PSC Propeller Firmware).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dennis B. Page
If this does not work you know something with the cable or the board is wrong
best regards
Stefan
I think your question has been answered, but just to confirm, can you attach the code that you are currently using? The servo controller works off of an 8-BYTE packet. ... "!SCVER?" counts as 7 BYTES, and "$0D" or decimal 13 counts as the 8th byte.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
from pst.exe you got an answer if you send !SCVER?
did you try to send !SCVER? from the propeller and get an answer back from the board?
Anyway the forum can help MUCH BETTER if you ARCHIVE your code inside the propellertool, and then ATTACH the zip-archive like shown in the attached picture
In the obex there is an object Parallax Servo Controller (Serial) driver V2
Original it is for the serial servo-controller. But the USB-controller works the same way. The only difference between the USB servocontrollerboard and the serial board is,
that an FTDI USB-to-serial converterchip is inserted between PC and propeller-chip
Serial board: PC
MAX2323
Propellerchip
USB board: PC
FTDI
Propellerchip
best regards
Stefan
Post Edited (StefanL38) : 7/30/2010 8:33:42 AM GMT
I am using pst.exe and not propeller chip. the commands !SCVER? is getting a response 1.0 and now !SCSBR1 is also changing the baud rate to 38.4kbs. The doubt is that right now i am sending eight bytes(seven infact) as a string. Now suppose i want to change the servo position in that case the command should be !SC<channel><ramp speed><LB><HB> so it will be transmitted as a string like !SC1243....where 12 is the channel and 43 is the ramp speed . I dont think this should be the format because how will it distinguish b/w 12 and 43. So will they be separated by spaces or rather 1 byte should be transmitted at a time. I am resistant to try this because i have hitec servos and i dont want to damage them....
Position Command – Set Position of a Servo Channel
Syntax: “!SC” <channel> <ramp speed> <lowbyte> <highbyte> <CR>
Reply: None
To move a servo to a location you must write a position command to the PSCU. Each position command
is comprised of the preamble, the channel, the ramp speed, lowbyte/highbyte of the pulse width in 2 μs
increments and a carriage return ($0D). The preamble is “!SC”. The channel is a byte value from 0 – 15
(16 – 31 if this is the second unit in a network). The ramp speed is a byte value from 0 – 63 that
controls the speed the servo moves to its new position.
this means that the set position-command consists of 8 bytes
byte1: "!"
byte2: "S"
byte3: "C"
byte4: 12 look at the different writing without hyphens!
byte5: 43 look at the different writing without hyphens!
byte6: 0 look at the different writing without hyphens!
byte7: 2 look at the different writing without hyphens!
byte8: 13 (ASCII-Code of carriage return
for sending strings with ASCII-codes outside the range of typable characters (space ASCII-code 32 ...) PST.EXE is not very suitable
for this it is better to use
the software Brays terminal
You can define macros with brays terminal
best regards
Stefan
Post Edited (StefanL38) : 7/30/2010 1:07:37 PM GMT
thanks for the reply but this i know. My doubt is how to send that data. i want to know whether i should transmit 1 byte at a time or i can transmit eight bytes in 1 stretch. in pst.exe should i write all the eight bytes and then press enter or single byte at a time and this for every byte.
If you want exact defined delay you can use the scripting-function of brays-terminal.
I don't think that servos get damaged when the pulse-length is too short or too long.
The position is controlled by the pulselength. Usually between one millisecond and two milliseconds.
Do you have an oscilloscop?
Then you could measure the minimum and maximum pulse-length
Do you have a second propeller-board?
then you could measure the pulselength with that
best regards
Stefan
see as soon as i type !SC0 only of the whole command it shows ERR! this means that it is not reading·byte 0 from the 0 we are sending from the keyboard. my qn is how to transmit the command to change the servo position from pst.exe or brays terminal. Please tell me is someone has changed the servo posn from pst.exe what is the syntax.
As StefanL38 showed you from the manual, each of the parameters is a single byte. From a terminal program like PST, you have to type these as control characters. Look at a table of ASCII character codes. You'll see that each character has a numeric value from 0 to 127. The first 32 character codes are used to do things like backspacing and carriage returns. Character codes 32 and above are "printable" and correspond to various characters like letters, digits, etc.
If a "caret" prefix (^) is used to imply that the control key of your keyboard is held down, the sequence StefanL38 showed ("!", "S", "C", 12, 42, 0, 2, 13) would be typed as ! S C ^L * ^@ ^B ^M
The ^M could be typed using the RETURN key
(edit: thanks Mike for explaining that. Anyway my opinion is that brays terminal is much more comfortable for things like that
(because you can define macros)
I have attached a picture that shows how to define a macro in brays terminal to send the servo-controller-commands
!SC0#012#032#255#000#013
"!SC" is clear
"#012" means DECIMAL value 12 to choose channel 12
"#032" means DECIMAL value 32 to set ramp-speed t0 32
"#255#000" means DECIMAL lowbyte 255 and highbyte decimal 0 setting pulsewith to value 255 which is estimated middle-position of the servo
"#013" means decimal 13 = carriage return
in spin strings are represented as byte-SEQUENCES
you have to define an array of bytes
then this array can be filled with ASCII-values
this is ONE way of two dozens to do that I guess there are more clever ways. That's just what comes first to my mind
All that I have written here is just theory with no real testing. Just what I conclude from the servo-controller manual
best regards
Stefan
Post Edited (StefanL38) : 8/1/2010 3:21:31 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dennis B. Page