I am building a project, that includes an Arduino pro-mini 5V, a small, but relatively strong slot-car 12V ~5A DC motor and 6 servos.
My problem is, that when the DC motor is working, the servos start jiggling and jerking and not going exactly in their programmed path. I have used a 4000 mAh 30C battery, so i think it can not be the battery current capacity.
Can you help me solve this please?
P.S.1
Someone just told me, that it might be an issue of noise reduction, because of the disturbance emitted by the DC motor.
If this is indeed the most probable cause, what is the easiest way for a layman to add noise reduction to the circuitry?
P.S.2
When i had the exact same configuration, but with 2 servos, instead of 6 and an Arduino Uno, instead of an Arduino pro-mini, there was no problem.
The servo uses timer(1 or 2) in arduino so if you are using another library (such as software serial) that use the same library, you'll run into trouble. Post your code.
4000 milliAmps 30C battery, so i think it can not be the battery current capacity
Should that be "4000mAh"?
The capacity of a battery may have little bearing on the instantaneous current it can supply - a standard alkaline D cell can have a capacity of 14 000mAh, but only at very low drain rates.
Edit: Oops, missed the "30C" - is your wiring heavy enough?
Hi, can you please post a picture of your project and a CAD or picture of a hand drawn circuit diagram, in jpg png or pdf.
And please post your code, use code tags in the menu above the text box. the # tag.
What are you controlling your DC motor with and do you have enough bypassing around your project to suppress motor controller noise?
Do you have a DMM, if so what does the battery volts do when you accelerate the motor?
The reason we ask these things is because you have the project in front of you, we don't so you are way ahead of us, we need this info to catch up and give you hopefully the right answers.
If you keep the code logic the same and just disconnect the circuit to the motor, does the problem go away? If so this would indicate it's an electrical issue rather than a problem caused by the Arduino itself.
Peter, Yes,
If i keep the code logic and just disconnect the motor, the problem goes away. It is probably an electric problem, probably noise disturbance, caused by the DC motor.
I have soldered 0.1M capacitors in several places (between the DC motor + and - legs, between the Arduino + and - outputs to the bluetooth dongle and before the + and - power to the servos), but it only changed a bit the manner of the servos jerking in the following way - a few servos stopped jerking, while other servos, moved from strong jerking to either mid-strong jerking or most of the time, they just move to a certain position and then not respond at all, until the DC motor is switched off.
All these problems occur, only when the DC motor is switched on, when it is switched off, the servos respond good.
Tom,
I am almost confident, that the problem is noise caused by the DC motor. I am only using the Servo library in my code, so how could the code cause the problem?
I will make the circuit drawing tomorrow and post it, in the meantime -
Can you please read the reply i wrote to Peter above, and tell me, what would be the best way to reduce noise in general? Is it using only capacitors or also a ferrite with twisted wire around it? What are the 'strategic' places to position these components? (the circuit includes also wireless communication through a BlueTooth dongle). Are there any other types of component or ways to reduce noise?
For the few motors I've seen, the capacitor was soldered across the motor leads at the motor itself, not out in the rest of the circuit. Motors have heavy starting current that may be causing a disruptive low voltage condition for the other electronics. Do the servos jerk all the time when the motor runs, or just when the motor starts?