Help with a serial motor controller
Bootsy
Posts: 22
Hey guys!
I'm trying to use a serial motor controller but it won't run for more than a little while and when it does run, it doesn't follow the commands I send it. Does anyone know how to use this or can anyone help me? Thanks!
Here's my code:
and here's how I've configured it:
I'm trying to use a serial motor controller but it won't run for more than a little while and when it does run, it doesn't follow the commands I send it. Does anyone know how to use this or can anyone help me? Thanks!
Here's my code:
' {$STAMP BS2} ' {$PBASIC 2.5} controller PIN 14 reset PIN 15 HIGH controller LOW reset HIGH reset DEBUG CLS, "start" PAUSE 150 DEBUG CLS, "Startup done" 'SEROUT 14,84, [noparse][[/noparse]$80, 0, 0, 0] DEBUG "1" PAUSE 25 DEBUG "2" SEROUT 14,84, [noparse][[/noparse]$80, 0, 3, 0] DEBUG CLS, "stopped" 'PAUSE 1000 DEBUG CLS, "GO!" SEROUT 14,84, [noparse][[/noparse]$80, 0, 0, 127] DEBUG "3" PAUSE 50 DEBUG "4" SEROUT 14,84, [noparse][[/noparse]$80, 0, 3, 0] DEBUG CLS, "done send" PAUSE 10000 DEBUG CLS, "done 5" PAUSE 2000 DEBUG "stop" END
and here's how I've configured it:
' {$STAMP BS2} ' {$PBASIC 2.5} controller PIN 14 reset PIN 15 HIGH controller LOW reset HIGH reset PAUSE 200 SEROUT 14,84, [noparse][[/noparse]$80, 2, 2] LOW reset PAUSE 1000 END
Comments
Thanks, though.
I suspect as well that it is a power problem, but why would that make it not respond to my commands and persist in running the motors at full forward at all times. The troubleshooting tips just said to check if it was overheating for these symptoms, but it isn't warm at all.
_________________________________
| |
| Serial Controller |
| |
| 1 2 3 4 5 6 7 8 9 |
| | | | | | | | |
Power VDD P14 P15 Motor1 Motor2
+ - + - - +
Thanks!
Pin 1 -> Battery +
Pin 2 -> Battery -
Pin 3 -> VDD
Pin 4 -> P14
Pin 5 -> P15
Pin 6 -> Motor 1 +
Pin 7 -> Motor 1 -
Pin 8 -> Motor 2 -
Pin 9 -> Motor 2 +
I am using only one battery pack for the stamp, controller and motors. Is that an issue? If I never want to reset the controller, could Pin 5 -> VDD too?
Thanks!
Do you think you could take a picture of your setup and put it up? From the connections you have described it sounds correct, the syntax would need all 4 bytes sent to control the Pololu; $80, 0 is always needed, and then the next two bytes are motor/direction and speed. The reset pin is nice to have in operation so I would suggest connecting it to Vdd.
Pololu Sample:
·· SEROUT CONTROLLER, 84, [noparse][[/noparse]$80, 0, motor_and_direction, speed]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
Thanks, guys (and/or girls)!
Unfortunately those pictures didn't help a great deal; but Mike brings up a really good point. What type of battery do you have?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
Thanks as always.
Good idea; if that doens't work, swap the 9V and the 4 AA supplies. The 4 AA's have more juice than the 9V battery, the motor will pull more current than the BS2 circuit.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
Checking with the volt-meter, we are getting 4.18 volts on the reset pin. Is that low enough to cause it do drop?
Thanks!
[noparse][[/noparse]Are the Grounds/V_ss/Batt- all connected together?]
Other than that, I'm sorry but I don't quite understand your question.
The question was to verify that you had a common ground amongst all the power supplies. Which would mean, do you have all the grounds connecting together? That would give the project a reference to ground regardless if the source is from the 4-AA or 9V.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
All battery packs and power sources should be connected to the same Ground.
We've established that it is configured in one motor mode by commenting out one serout command. It follows motor 0 and 1, but outputs to both motors.
We tried running the configuration program with an LED connected like they recommend to see if it's being configured right, but the LED does not light up when plugged in either way on either Pin 8 or 9.
Any ideas?
Thanks a bunch, though, you guys have been a huge help already.
I'm not a Pololu-meister, somebody else may have an insight on your Ops question/s.
The variable for the motor/direction should range from 0 - 3; giving a motor and direction selection for each motor. Replace the command that is sent to the Pololu with the following command, and what are your results?
SEROUT IOPIN, 84, [noparse][[/noparse]$80, 0, 0, 127]
SEROUT IOPIN, 84, [noparse][[/noparse]$80, 0, 1, 127]
SEROUT IOPIN, 84, [noparse][[/noparse]$80, 0, 2, 127]
SEROUT IOPIN, 84, [noparse][[/noparse]$80, 0, 3, 127]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
Thanks!