View Full Version : motor controller: motor 2 works but motor 1 doesnt
02-22-2010, 06:41 AM
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:
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:
i have no idea why the second motor works just fine and the first motor bearly moves.
Did you properly configure the controller for 2-motor operation·with the·appropriate serial command?
·"If you build it, they will come."
02-22-2010, 11:45 AM
ya im pretty sure. i run this code first separetly then i run the other code:
SEROUT 14, 84,[$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
·if i set up the code like this:
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
Please attach your·full program (using the·attachment manager button, not just cut & paste)·so we can see it & try to help.
·"If you build it, they will come."
02-22-2010, 01:17 PM
i dont know what i did but now it pulses on and off for both motors. im confused.
thanks for helping
i attached the motor controlling program and the motor controller configuration program
02-22-2010, 09:15 PM
Just a quick glance, but shouldn't you have a PAUSE of something like 2000 between each FOR-NEXT loops to let the motor actually start and run and then change speed and/or direction and speed. As written the Basic Stamp would run through the code very fast and may give the results your experiencing.
I bought a couple of these controllers last month and will pull them out and work with them if I get time today
02-22-2010, 11:14 PM
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.
02-23-2010, 01:05 AM
Did you understand I meant for you to add a PAUSE 2000 between each for-next loop and NOT to change the Pause 20?
Post Edited (T Bill) : 2/22/2010 8:58:45 PM GMT
02-23-2010, 02:06 AM
Ok ya that makes sense. I'll try it this afternoon and let you know if it worked. Thanks
02-23-2010, 04:46 AM
ok so i figured out why motor 2 started messing up. i had the power source plugged in to the wrong spot. so now motor 2 works just fine. the pause 2000 makes it run better i think. thanks
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.
02-23-2010, 05:02 AM
What is your power source?·
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.
Post Edited (T Bill) : 2/22/2010 9:08:19 PM GMT
02-23-2010, 05:36 AM
i am using 3 AA batteries to power 2 motors that are the same size. im not sure if one is pulling more power than the other. how would i find out or code it to fix that?
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?
02-23-2010, 12:20 PM
If the #2 motor is working and the #1 motor is causing problems I would suggest switching the motors to make sure it isn't a problem with one of the motors. It should eliminate one variable and help you narrow down the problem.
02-23-2010, 02:37 PM
ok i switched them and its the same. no matter what motor is connected to the place for motor 1 it bearly moves then it stops altogether
02-23-2010, 11:44 PM
Using LEDs I verified your configuration and controller code to work. I will try working with motors tonight.
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
Post Edited (T Bill) : 2/23/2010 4:29:18 PM GMT
02-24-2010, 12:43 AM
Ya I agree. Ill try to contact them today and see what they think. If I figure out the problem ill definitely post and let everyone know what's going on
Thanks for the help
02-24-2010, 03:01 AM
I have attached two pictures of what I call a small motor. Too my surprise it didn't work with the controller. I checked with my meter and found that it averaged near or just over 1 amp draw at start up. 1 amp is the limit for each motor channel.
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
02-24-2010, 04:16 AM
Actually that makes sense. I contacted the tech help and while waiting for them to respond I was doing more looking around online for an answer and I came across a thread about a guy that had a similar problem and it was his motors. He was using fa-130 motors like I am and it sounds like the motors draw too much power. It sucks but I think I have to replace the motors.
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
02-24-2010, 08:20 AM
I would say that's about the size of the one I tried.
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.
Post Edited (T Bill) : 2/24/2010 12:26:52 AM GMT
02-24-2010, 01:26 PM
Ya thanks for all the help man. If I get everything working I'll try to post something