when using the controller, ramping up the output speed i noticed that motor 0 wasn’t ramping it just started at a medium speed then ramped. motor 1 is working fine.
to troubleshoot i wrote a simple ‘for next’ loop to ramp up the speed and used a scope to check the output. motor 0’s duty cycle jumps from 0 to 50% then ramps to 100%. motor 1 ramps as expected.
That is strange. My first guess is that there’s something wrong with your code. Are you sure it’s correct? What happens when you gradually lower the speed? Does the motor controller cut out at the same speed going down as it kicked in going up?
i changed the code to ramp down and it has the same range.
just now discovered that it has something to do with the fact that i send the speed commands to the motors consecutively. if i only address motor zero everything is ok. so i tried reversing the order that i sent the commands to each motor, no difference. i added a pause between the commands, no difference. i reconfigured from motors 0,1 to motors 2,3 no difference. i sent commands in reverse as well as forward, no difference. makes me think there is a timing issue with the way i’m sending the commands. not really sure. i could post the code if you like.
edit. also sent static speeds (without ramping), same results.
thanks for your response Jan.
I don’t know what you mean by “no difference” and “same results”. Does it just work in one case, or does it not work in just one case? I’m especially interested in your single-speed tests since they would be the simplest. Are you saying you can send a single command, and whether or not it works is purely a function of the speed setting? If so, can you show us the two commands you send (the working one and non-working one)?
sorry, i will try to be more clear.
what i mean is, motor zero’s lowest duty cycle is approximately 50%. that is whether i ramp up, ramp down, static values, forward, or reverse. the only exception is when i send speed commands to motor zero alone instead of both motor zero and motor one consecutively, in this case the duty cycle ranges from 0 to 100% as i understand to be normal.
**this does not work, meaning motor zero’s lowest duty cycle is 50%, and motor 1 ranges from 0 to 100%.
FOR speed = 127 TO 0
**this works, meaning motor zero’s duty cycle ranges from 0 to 100%.
FOR speed = 127 TO 0
no matter what i try, if commands are sent to motor one, motor one “works”.
Given that the unit is generally working, I think it’s unlikely that your unit is defective relative to other units, and I instead suspect some subtle timing issues. With your static test, are you saying that you can, for instance, send speed 50 to both motors, and output zero just won’t do anything? Have you tried different baud rates? I’m not sure what your code is running on, but it’s conceivable that it’s beyond the limit if it is running with a faster clock than intended or one of the faster basic stamps.
thanks for your input Jan. i thought it might be a timing issue, but the things that i have tried just aren’t working. i haven’t tried a static test with the value 50, i did test with the value 1 and the output is 50%. i am using a basic stamp 2. is there a recomended test code i could try that would send a speed value to both motors so i can confirm proper operation? the sample program in the documentation works but it just tests a single motor. i would really like to get it working. i think its a great product. if you think its an issue that should be addressed by parallax i can post on their forum, i just thought this was the more appropriate place to inquire. i will test different baud rates tonight, i didn’t think of that.
once again, thanks.
I don’t think the problem would have anything to do with the basic stamp, so this is definitely the right place to discuss it. Your unit is definitely not behaving correctly, so at this point, the best thing is probably for us to take a look at it. Can you send it back?
yes i can send it.
let me know how. do i need an rma, or other?
I’m pretty sure I saw your post with just the “yes I can send it” line, so I assumed you had already sent it. Did you add the extra question later?
You can contact us more directly if you want, but you can also just send the unit however you want to our address. Please make sure to include all of your contact information and a way for us to connect the package to this forum thread (e.g. include a note that says something like, “I’m ‘quick’ from the forum and Jan approved this return”).
I tried your unit with our standard test, which ramps both motors up and down in both directions, and I tried sending individual commands with low duty cycles to each motor in each direction, and the controller always behaved as expected.
I’m attaching a screen shot of the scope capture for you to see; all four outputs looked like this, and you can see that the duty cycle gradually changes from low to high and back to low.
you definitely went above and beyond with this.
obviously i’m doing something wrong. sorry i was unable to identify it before sending it in. let me know if there is anything i can do to help while you have it, if not, is there a charge for your services? i would appreciate it if you or someone on the forum could help me identify the problem. what hardware did you use to test it? is there any pretested code available for the BS2 that would help me identify what i am doing wrong .i know parallax also carries it, i’ll see if i can get some guidance on the BS2 side from parallax.
Unfortunately, the test rig got set up many years ago, and I don’t know exactly what the code on it is. However, I sent the individual commands using a little serial transmitter utility similar to the one we have available on our web page, along with a transistor-resistor level converter. This let me send a single command to verify that I did indeed get a duty cycle below 50%.
We won’t charge you for this. It looks like you’ve had this motor controller for close to a year and a half, and your posts from last year made it seem like you had things working. If that is the case, it would have been nice for you to begin this thread with that background. Did the motor controller stop working for you, or did you never have it working?
to be honest i don’t remember if i ever used it with two motors. shortly after i got it, i had to put my hobbies to the side. i just recently tried it again. when i started this post i thought i was fighting configuration, or something on my end, not the controller. didn’t occurr to me to that background would help. i will try it with the serial utility you mentioned and see where that gets me.
i received the controler today. and retested using the serial transmitter utility found on pololu’s web page, along with a transistor-resistor level converter. the controler is powered with regulated 5 volts on both the motor supply and the logic supply. a scope connected to pin 8 of controler, grounded to logic ground, nothing else connected to any of the controler’s motor outputs.
i send 128,0,0,1 to start motor 0,and get the expected duty cycle (less than 1 %) at aprox. 600 Hz.
i send 128,0,2,1 to start motor 1, and motor 0 output jumps to aprox. 50% at aprox. 300 Hz.
i send 128,0,2,0 to stop motor 1, and motor 0 output returns to the original duty cycle at original freq.
no ramping just static values. if i ramp both motors at the same time motor 0 ramps from 50% to 100%. the symptom has remained the same no matter what setup or commands i’ve tried.
if you see any issues with this setup, that could be the cause of this symptom, or if you have any suggestions that would help me eliminate the problem, please let me know. if not then thanks again for your help.
Can you post some pictures of your setup?
OK. i got it working, at least on the proto board.
i think it was generating noise on the pwr supply. placing 2 caps one on pin 1 to ground and the other pin 3 to ground corrected the problem. i never thought noise would be an issue without the motors. i couldn’t see it with the scope, and my previous experience noise caused eratic unpredictable behavior.
so sorry, thanks for your patience.
I’m happy to hear you figured things out. Noise really shouldn’t be much of an issue without the motors there, so that makes me think your power supply might be really bad or you’re doing something else that is adding the noise.
i don’t know. i got the same symptom with 2 different supplies. 2 different breadboards, and two different serial sources. the symptom on each identicle, and consistantly predictable. ???