motor controller: motor 2 works but motor 1 doesnt
NsanecomX
Posts: 22
i have a bs2 and im using the micro dual serial motor controller to control 2 motors separetly. i have the reset on the motor controller in pin 15 and the serial out on the motor controller in pin 14 on the bs2.
im using this code for motor·two and it works:
HIGH 14···········
LOW 15············
HIGH 15
PAUSE 100
SEROUT 14,84,[noparse][[/noparse]$80,0,0,127]
it will keep spinning until i code it to stop.
im using this code for motor one and it moves for a few milliseconds then stops completely:
HIGH 14···········
LOW 15············
HIGH 15
PAUSE 100
SEROUT 14,84,[noparse][[/noparse]$80,0,2,127]
i have no idea why the second motor works just fine and the first motor bearly moves.
any ideas?
im using this code for motor·two and it works:
HIGH 14···········
LOW 15············
HIGH 15
PAUSE 100
SEROUT 14,84,[noparse][[/noparse]$80,0,0,127]
it will keep spinning until i code it to stop.
im using this code for motor one and it moves for a few milliseconds then stops completely:
HIGH 14···········
LOW 15············
HIGH 15
PAUSE 100
SEROUT 14,84,[noparse][[/noparse]$80,0,2,127]
i have no idea why the second motor works just fine and the first motor bearly moves.
any ideas?
Comments
·http://www.pololu.com/file/download/smc02b_guide.pdf?file_id=0J36
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
SEROUT 14, 84,[noparse][[/noparse]$80,2,0]
which from what i read in the manual should set it to two motor mode that controls motors 0 and 1.
i have no idea what im not doing. the same thing is still happening
is this even how you would configure it to control the 2 motors independantly?
any help would be great. thanks
p.s.
·if i set up the code like this:
SEROUT 14,84,[noparse][[/noparse]$80,0,0,speed]
·SEROUT 14,84,[noparse][[/noparse]$80,0,2,speed]
so that is controls both motors at the same time instead of testing each one independantly they both only run for a sec then stop completely
Post Edited (NsanecomX) : 2/22/2010 4:29:01 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
thanks for helping
i attached the motor controlling program and the motor controller configuration program
I bought a couple of these controllers last month and will pull them out and work with them if I get time today
Tony
See the thing is that this code was working just fine with motor 2 even with the pause at 20. Ill change it and see if that does anything.
Tony
Post Edited (T Bill) : 2/22/2010 8:58:45 PM GMT
my problem is back to motor 1 now. it will work for only about 1 second whether or not i add a pause 2000. i dont know why it doesnt work right.
since motor 2 works fine and motor 1 works for only the first second do you think it could be the configuration? since it works a little then stop would it be a power problem? i am stumped since motor 1 works without a problem.
Are the motors the same size? Maybe motor one is drawing more than the 1amp limit pure motor channel when running two motors.·
Could you post a picture of your setup?
Like I said I will try working with it tonight and see if I get the same results with your code. It would be great if you could also post your new code.
Tony
Post Edited (T Bill) : 2/22/2010 9:08:19 PM GMT
i attached the configure code and the code to run it. the top section of the code goes forward and backward for motor 2 then the second section goes forward and backward for motor 1. i also attached a pic of the bs2 set up. is that the set up you wanted to see?
EDIT - I added a DO..LOOP to the code so it would continually repeat making it easier to watch the LEDs.· I got to wondering how the motors would run it you use the attached file which is your code with a DO..LOOP added.
Since you have switched the motors and they both work fine in motor 2 postition and the code seems correct I believe it maybe time to contact Parallax's tech support. If tech support is able to help you solve the problem it would be good to post it as a future reference for others
Tony
Post Edited (T Bill) : 2/23/2010 4:29:18 PM GMT
Thanks for the help
I wonderful, back to the motor size thought, if your motors are drawing too many amps and shutting down the controller? After I tried the motor I had to reset the BS2 and controller to get the LEDs to light on the second motor pins 6,7 (tried motor on pins 8,9).
Hope this helps
Tony
I tried some motors I had lying around and they work fine. The new ones are bigger but they must not draw as much power
I would say I'm a little surprised. I thought I had a small motor and couldn't believe it drew that much current on start up.
You know you could hook one motor up to both channels and have 2 amps to work with. It does mean another controller, but you would only loose one pin for reset because you can run 2 controllers on one serial line. Just an idea.
I also tested a larger motor rated 12-24 volts and it only drew about .4 amps at the highest on 6 volt battery pack. So I connected it to the controller and it works great.
I guess the moral learned is - Never assume small means low current, test it to make sure.
Glad you got it figured out.
Tony
Post Edited (T Bill) : 2/24/2010 12:26:52 AM GMT