Motor Controllers. An Anoying saga.
John Board
Posts: 371
G'day,
As most of you are familiar, I have been having some quite distressing troubles with motor drivers. I have bought a nice Li-po batt for the robot, and put some caps (100 uf and 0.015 (I think) uf). No avail. This problem is quite getting to me, I am quite anoyed with this... to the point of taking a hammer to the darned machine. So, I'll recap, if you could help me, I'd be obliged:
Power, no problem, I have a 3.6 AMP 7.4v power source, the power bus light not flickering indicating insufficient power supply. I also have the caps mentioned above in parallel with it.
Comms, no trouble.
Wiring, could be the fault, not sure yet
Motor: Well... how could a motor fail (Rehtorical)
So the actual trouble I have been having is this: The prop starts pulsing the PWM pin of the motor controller. The motor starts turning. Then for some reason the prop stops. The time between PWM'ing the pin and the chip stopping changes. So in other words, the motor starts, then stops, the time between starting and stopping varies.
Please help me before I destroy everything within reach...
-John
[EDIT] This is the web page for this driver: http://www.pololu.com/catalog/product/713
As most of you are familiar, I have been having some quite distressing troubles with motor drivers. I have bought a nice Li-po batt for the robot, and put some caps (100 uf and 0.015 (I think) uf). No avail. This problem is quite getting to me, I am quite anoyed with this... to the point of taking a hammer to the darned machine. So, I'll recap, if you could help me, I'd be obliged:
Power, no problem, I have a 3.6 AMP 7.4v power source, the power bus light not flickering indicating insufficient power supply. I also have the caps mentioned above in parallel with it.
Comms, no trouble.
Wiring, could be the fault, not sure yet
Motor: Well... how could a motor fail (Rehtorical)
So the actual trouble I have been having is this: The prop starts pulsing the PWM pin of the motor controller. The motor starts turning. Then for some reason the prop stops. The time between PWM'ing the pin and the chip stopping changes. So in other words, the motor starts, then stops, the time between starting and stopping varies.
Please help me before I destroy everything within reach...
-John
[EDIT] This is the web page for this driver: http://www.pololu.com/catalog/product/713
Comments
Thanks for your reply,
John
Just burned out the my prop board. I had my batt attached, turned on the switch, it released the "blue smoke".
This robot is... was going to be entered into the regional/state/nationals robot comps... now...
I guess I could do something at least, I have 3 prop sticks just sitting here at home, but the whole second deck of the robot was custom built for this robot.
It just came at the wrong moment. I think I must have shorted the wiring, not a good thing with a 7.4v 3.6 amp battery. I just don't know what I did...
Thanks for your help, I'll try keep you posted.
-John
With motors voltage spikes around the circuit are the main issue.
The simplest way to fix it is to have two battery packs, one for the motor and servo part and one for the "picky" electronics. This second battery can be very small, with common ground.
You have two independent power supply circuits, and a shared ground. This way signals are consistent but the propeller is working with a steady voltage.
100uF is too small in my opinion...
Sorry, it was 1000 uf, 'twas just a typo.
@Allen: The problem is the propeller chip restarting for some reason. That is why the motors stop, is because for some unknown reason the prop restarts.
Good news! Only the switch/terminal block of my Gadget Gangster burned out, I bi-passed it by plugging my power into the "VIN" and "GND" breadboard connections. In this case, I can continue using my Gadget Gangster! Ohh... I pulled out all my circutry in the process of testing the board... That was a good 2 day's work.. Ohh well, atleast I have a chip to go on with
-John
Will see what I can do ASAP.
My last thread for this: http://forums.parallax.com/showthread.php?138545-Prop-Unexpectedly-Restarting&highlight=Unexpectedly+restarting
The "Guide" I used to wire this: http://www.meanpc.com/2012/01/how-to-use-tb6612fng-motor-driver-with.html
-John
For larger motors, I've found I had to add a big capacitor to the input to the Prop's 3.3V regulator to keep it from resetting...
It's when the motor first starts moving that causes the trouble. It draws a lot of current then. I wouldn't be too sure it's not dropping the battery voltage.
If you still have trouble, I'd recommend using a second battery pack to power the Prop and use that battery just for the motors.
As I said, I have a 1000uf cap in parallel with the battery. I have also tried a second battery pack before, no avail, will try again though.
-John
But, an extra capacitor on the input to the 3.3V regulator fixes it for me.
Note that I have a Schottky diode between the battery and the 3.3 V regulator input to Quickstart.
That way, even if the battery does get pulled down, power won't get sucked backwards...
But, if you're having trouble, the way to be sure is to use a second power source for the Prop...
Not sure if I quite get it, I can't modify the input to the voltage regulator. I'm using the Gadget Gangster Prop platform board (usb).
I didn't bring a motor into the mix till I was satisfied with those results.
http://incredulist.blogspot.com/p/h-bridge.html
>>> Focus On Fundamentals <<<
At this point, I'd recommend you use a second battery to power the Prop Platform.
Later, maybe you might want to try using a diode to allow you to use the same battery for both...
BTW: 3.6 A might sound like a lot. But, motors start out as basically short circuit loads.
And, these motor drivers only have internal resistance of about 1 Ohm.
So, if you drive 2 of them from a dead start, you can easy draw more than that current rating...
-John
If they are drawing too much current, use PWM to control the current draw...
3.6A or 3.6Ah ?
(Vin - MotorVoltage) / i
So we need to know the current draw for the motor or i. Plug that into the equation and that will give you the resistor you need.
EG. 8 volt supply, 3 volt motor, 200ma.
(8 - 3) = 5 / 0.2 = 25 ohms ? *I think*
Not to try to give you a hard time, but as some friendly advice. This is about the 5th time you have stated that you have gotten the motor working, then you are posting that there are problems shortly afterwards. People have offered a good deal of good advice over several different threads regarding this particular issue, and still you have yet to provide a real schematic so that the forum can actually see what you are doing. It is a good thing to be enthusiastic about a project, but when you enlist the forum to help solve problems, then it is a good idea to provide the forum with the basic info. In an earlier thread regarding the motor issue, your code was not in fact PWM but was just a pin toggling on and off at different wait times, that is not PWM, and could very well be a problem for the driver. I mentioned that is was not PWM you were sending, and do not recall that you addressed it. In this thread, you were asked to post code, to which you have stated that code is not the issue. So the forum continues to guess at the problem blindly. PJ stated, fundamentals come first. The competition may be a good motivating factor to push you along, but controlling motors requires a lot of work to understand a number of electronic basics as well as software basics, and you are trying to tackle too much at once it looks like. Regarding the driver voltage output, does the datasheet for that driver state that the voltage is adjustable? Does the datasheet state that the motor driver can operate between a range of voltages that you provide via the battery or power supply? That info would be best handled by contacting the driver manufacturer or a forum related to that driver. Not the Propeller forum. Using waitcnt as you were at some point earlier, you are not providing PWM, but rather bursts of full on and full off. A full on from a dead stop is a serious load on a battery or power supply, almost a dead short as mentioned earlier. True PMW could be ramped from a dead stop to the max speed you want to run the motor at, so that the shock is not so radical, just ramp from 0 duty to MAXSPEED duty with a little loop.
This code example will start out the motor at it's slowest possible speed and accelerate it to the highest speed you want. The ramp up reduces the initial power supply hit.
I have just recently been working on a server in france... now I know what it means to "work blind".
Curious.
However, what puzzles me is that so many people have given advice to a situation where there is no concrete information given. In a case like that, what it comes down to, is essentially mindreading. I am sure, John wants this problem out of his hair, but without something tangible, like the code and the schematic, all of this is basically like throwing a dart at a barndoor.
Heh, sorry, didn't explain enough, here is the "revised edition":
Sorry, my bad, I now know what it means to "work blind", I have been working on a VPS server in france latley, I only had access to it using SSH and FTP.
Hope that cleared it up, I am really new to this sorta stuff, and I don't really know how to make a schematic, like, do I take a picture of what I have done, or do I draw one, or what?
Sorry for everything again,
John
T_Chap has given you a solid lead.
That looks like a fair lot.
Hint: Post your code and any drawings you might have done in putting the project together and include a photo or two as this also speaks volumes.
Schematic:
I hope that you can understand my schematic. Note, none of the wires that cross over are connected.
Sorry, I can't currently take a picture of my board, will try and post one in a little while
Manufacturer's Page: http://www.pololu.com/catalog/product/713
At the moment, everything seems to be operating as per normal. Note, I forgot to add in the schematic that the battery is 7.4v @ 3.6 AH. I am wanting to add in a 1M resistor inline with the motor as the driver is pumping out 8V when it should be only 3V. I have tested with a multimeter and a variable resistor, and a 1M resistor is the closest match to what I need (that I currently have).
What I am wanting to achieve now is to get proper PWM, as someone (slips my mind who) noted that I wasn't using proper PWM, could anyone give me a few pointers on how to get proper PWM?
Thanks again, and any suggestions would be appreciated,
John
P.S. I've learnt my lesson now, in future I'll post the schematic along with the code and a picture
OUTA[16..19] := %xx
It is supposed to be:
OUTA[16..19] := %0101
I am currently located at Baralaba, Central Queensland, about 6-8 hours from Brisbane, and 170km South West of Rockhampton (2 hours) , and about 2-3 hours from Emerald.
Baralaba's a bit far but still what we would call "in the country" rather than "outback"
BTW, just to answer your original problem - If your frequency is too low then the motor will draw a lot of current at the ON voltage which will be close to the battery voltage. It sounds like you were saying indirectly that the motor is a 3V motor so you will find that the battery will probably not be able to supply the current and so the battery voltage droops. Increasing the "PWM" frequency will alleviate this problem. You probably need to isolate the logic supply from the motor load by using a diode fed into a capacitor which will hold enough charge to supply the controller when the battery voltage droops (any diode plus a 470uf or more capacitor perhaps).