propeller servo controller not communicating and basic stamp2
Antonuccio
Posts: 17
hello
I am currently buliding a servo powered robot using a Parallax Propeller servo controller (PSCU) and a basic stamp 2 microcontroller (bs2). Despite my best efforts I can not get the servo controller to operate properly. I have done a lot of reaserch and have set my electronics up as Parallax dictates. I am also using multipe test programs sent to me by Parallax that should work "out of the box." Despite my efforts every time I attempt to run a program my servos just twitch wildly.So what am I doing wrong? My setup is as follows: I have a 9v battery connected to my bs2. From the bs2 I have a jumper going from pin 15 of the bs2 to the PSCU. I have a 7.4v power source going to my PSCU and have servos attached to pins 1-9.
I have done many experiments to try and remedy this problem myself including: I have tested the communication between my bs2 and PSCU with an ocilloscope and as far as I can tell they are communicating. I set up a variable power supply to my PSCU and supplied a range of voltage from about 4v to 9v in an attempt to see if my 7.4v power source was the problem. It was not. I have replaced my original servo controller with a 2nd to see if a defective PSCU was creating problems. However my results were the same.
As I am a novice programmer and this is my first time working with Parallax gear I have a strong feeling that I am making some mundane mistake or overlooking something small that is inhibiting my electronics. If anyone could shed some light on this mystery I would be quite greatful because I am out of ideas.
I am currently buliding a servo powered robot using a Parallax Propeller servo controller (PSCU) and a basic stamp 2 microcontroller (bs2). Despite my best efforts I can not get the servo controller to operate properly. I have done a lot of reaserch and have set my electronics up as Parallax dictates. I am also using multipe test programs sent to me by Parallax that should work "out of the box." Despite my efforts every time I attempt to run a program my servos just twitch wildly.So what am I doing wrong? My setup is as follows: I have a 9v battery connected to my bs2. From the bs2 I have a jumper going from pin 15 of the bs2 to the PSCU. I have a 7.4v power source going to my PSCU and have servos attached to pins 1-9.
I have done many experiments to try and remedy this problem myself including: I have tested the communication between my bs2 and PSCU with an ocilloscope and as far as I can tell they are communicating. I set up a variable power supply to my PSCU and supplied a range of voltage from about 4v to 9v in an attempt to see if my 7.4v power source was the problem. It was not. I have replaced my original servo controller with a 2nd to see if a defective PSCU was creating problems. However my results were the same.
As I am a novice programmer and this is my first time working with Parallax gear I have a strong feeling that I am making some mundane mistake or overlooking something small that is inhibiting my electronics. If anyone could shed some light on this mystery I would be quite greatful because I am out of ideas.
Comments
Keep in mind that a 9V battery is a poor power source. It has a very small power capacity and can provide relatively little current. That given, a BS2 by itself draws very little current.
It's possible to connect the PSCU to a PC via the USB connector and there's software for the PC on the PSCU's product webpage that lets you control servos from the PC. Have you tried that? That's a good way to test the servo controller, servos, and power supply.
Dave
I am using Futuaba S3003 servos. I did not mention in my first post that I have my bs2 on a Board of Education and when I have the servos connected directly to the BoE I am able to controll them normally. I have also tried using multiple I/O pins with the same result.
For reference I have attached a diagram of the setup I am using.
Attached to this post is a pic showing my project and the exact setup I am using with callouts to the components in question. If anyone can see a bad connection or stupid mistake I may be making please let me know.
The easiest way to test the PSC is to just hook it you your PC with the USB cable. No not connect servo power or servos. Open the PSCI program and execute the version command. If the version numbers comes back, then you have a servo connection, power, or programming issue.
Your BOE power switch is set to position 2, correct?
Consider posting your PBASIC code.
A friend and I have made many attempts to get the PSCI software to talk to my PSCU with no luck. It does not respond in any way.
I am putting my BoE power switch to position 2.
Here is one of the many test codes I have tried to execute.
'{$STAMP BS2}
'{$PBASIC 2.5}
ch VAR Byte
'ch0 VAR Byte
pw VAR Word
ra VAR Byte
Sdat CON 15
baud CON 396
ra =6
DO
FOR ra = 15 TO 16
pw = 270
SEROUT Sdat, Baud+$8000,["!SC", 0, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
SEROUT Sdat, Baud+$8000,["!SC", 11, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 5000
pw = 1270
SEROUT Sdat, Baud+$8000,["!SC", 0, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
SEROUT Sdat, Baud+$8000,["!SC", 11, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 5000
NEXT
LOOP
It has been some time since my last post. In that time I have been trying all of the above suggestions given to get my project working. I am still having no luck. Is their anyone out their who can review the data i have provided and shed any more light on my sad situation?
Thanks
I switched one of my Futaba S3003 servos with an official Parallax servo and got some encouraging results. The Parallax servo did not start to twitch wildly the second I applied power. The new servo simply rotated to its 90 degree position and held that position until I cut power. Despite these results I do not want to buy more of the Parallax servos until I can confirm without a doubt that my old servos are indeed my problem
The following code was given to me from Parallax as a bit of test code for my Propeller Servo Controller. However since I am a novice programer I am not 100% on what my setup should be and what this program does exactly. If im not mistaken this program works with my jumper wire running from pin 15 of my BoE to my PSCU. Once I apply power to the BOE/ PSCU the servo attached to pin #6 in the PSCU should rotate roughly to the 0 degree position then to about the 180 degree position. Is my deciphering of this code correct? Is their anything I should add or take from the code to make it work better? I would greatly appreciate any advice anyone can give me as I feel I am now very close to deciphering my servo problems.
here is the sample code mentioned above:
'{$STAMP BS2}
'{$PBASIC 2.5}
ch VAR Byte
'ch0 VAR Byte
pw VAR Word
ra VAR Byte
Sdat CON 15
baud CON 396
ra =6
DO
FOR ra = 15 TO 16
pw = 270
SEROUT Sdat, Baud+$8000,["!SC", 0, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
SEROUT Sdat, Baud+$8000,["!SC", 11, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 5000
pw = 1270
SEROUT Sdat, Baud+$8000,["!SC", 0, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
SEROUT Sdat, Baud+$8000,["!SC", 11, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 5000
NEXT
LOOP
'for postion 63 you'll need a pause of 60,000 for full rotation
The code is as follows:
' {$STAMP BS2}
' {$PBASIC 2.5}
ch VAR Byte
pw VAR Word
ra VAR Byte
Sdat CON 15
baud CON 396
ra = 7
ch = 11
DO
pw = 1100
SEROUT sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
pw = 300
SEROUT sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
LOOP
If anyone out there can simply tell me what pin my servo needs to be plugged into/ confirm what this program or the program in my above post are supposed to do I would be grateful beyond words.
That means that the servo should be connected to P11 on the PSCU?
What happens then?
What results if "ch = 11" is changed to "ch = 0" and the servo is
connected to P0?
The code you posted assumes you have a servo connected to channel 11 and channel 0. ra=6 is the ramp value not the channel.
See the PSCU manual.
Im still not sure where im going wrong. Anybody have any ideas?
What happens when you run this?
Or this?
Or this with a servo connected to channel zero?
I would get in there with a meter and/or a scope, all of this fuss and bother. Did you buy the PSCU new from Parallax or is it second-hand?
[I'm going to leave this to Mike G, as too many cooks...]
PE - Checking in once every 24hrs is slowing down the process
To recap I have a Basic stamp 2 on a Board of Education connected to a Propeller Servo Control Unit. Attached to the PSCU right now is a single Parallax standard servo. When I apply power to my BoE and then my PSCU and play a program I seem to get no signal from my BOE to the PSCU. The servo I have connected to the PSCU simply rotates to 90 degrees and holds its position telling me I am at least getting power.
I am particularly curios to weather or not the jumper on the PSCU is to be remove, however I am not sure if there is something else in m y setup that may be inhibiting signal.
For some reason my PSCU thinks it is the 2nd in a series of two servo controllers.
In other words channels 0-15 think that they are channels 16-31. I'm not sure why this is but I have adjusted my programs accordingly and so far things seem to be working.
However I am perplexed as to why this problem is occurring.
PSS – Set Software Port (to range 0 – 15 or 16 – 31)
Syntax: “!SCPSS” <mode> <CR>
Reply: “PM” <mode>
"Somehow" that got changed.