I literally searched the whole internet for 2 days but I can't find any answer to my problem. In my current project I am trying to build a balancing robot. I wasn't statisfied using geared motors, so now I am trying with Stepper motors instead.
I am using following compontents:
Arduino Mega
Bipolar Stepper motor (2x)
DRV8825 driver (2x)
toggle switch
wires
LiPo Battery (11,1V & 3000mAh)
Here's my problem: If i just run one motor everything works fine BUT the other motor and other driver board have to be fully disconnected!.
As soon as I connect the second motor (don't run it, just connecting the driver to the arduino and power supply and the motor to the driver) the first motor stops working.
To sum it up driving one motor works, but when connecting the second with the exact same wiring, motor 1 stops working (code stays the same).
What I did already:
I already checked the voltage at the driver board
Also checked all the wires
Switched the driver boards
Checked and switched all pins
Tried a Step Down Converter to 5DC to connect the driver boards to the battery instead of using Arduino 5V pins
tried different codes
decreased and increased the current using the potentiometer
I am really confused about this. I thought it's supposed to be pretty straight forward using two motors. As an mechanical engineer I am at the end of my knowledge now. I would be really happy if somebody could help me out with this.
highfish1:
If i just run one motor everything works fine BUT the other motor and other driver board have to be fully disconnected!.
As soon as I connect the second motor (don't run it, just connecting the driver to the arduino and power supply and the motor to the driver) the first motor stops working.
To sum it up driving one motor works, but when connecting the second with the exact same wiring, motor 1 stops working (code stays the same).
What happens if you connect motor 2 only, without motor 1 connected?
The code you mention refers to a single motor not two !
I am aware of that. But first I want to make one motor running while both driver boards are connected. Afterwards I can try to make them run at the same time.
But for now I can't run one motor while the other one is connected. It only works if the other one is disconnected.
This is likely to be a power problem - as LiPo's can usually produce huge currents without trouble I suspect
that your wiring is too thin or the switch is inadequate. If you have a multimeter monitor the voltage from
the battery when the second motor+driver are added to the circuit - it shouldn't drop very much, a fraction
of a volt.
Then monitor the voltage at the driver boards - this should be very close to the battery voltage.
By the way its a very good idea to use fuses with high current batteries, since otherwise a short circuit might
set the wiring on fire which is a "bad outcome".
If you have a multimeter monitor the voltage from
the battery when the second motor+driver are added to the circuit - it shouldn't drop very much, a fraction
of a volt.
I already monitored the battery voltage with a multimeter (10,8V at the poles).
Then I monitored the voltage at each motor driver when both are connected. --> both got constant ~10,78V without any drops or something like that.
Then I disconnected the battery and tried with a power supply instead of a battery. Same thing. So my conclusion is, that the needed current can't be the problem.
I confess I can't see anything wrong except that you don't have 100 microfarad capacitors across Vmot and GND at the DRV8825s. See the diagram on the Pololu DRV8825 web page.
Do you have the same problem if you switch the code to drive the other DRV8825?
I presume you have tested both motors and drivers separately.
What happens if you disconnect the 5v step down and just power the Mega using the USB cable?
Thank you for helping out.
Already thought about the capacitor but I don't have any around.
Do you have the same problem if you switch the code to drive the other DRV8825?
Yes, same Problem.
I presume you have tested both motors and drivers separately.
Yes, if I use them separately everything works fine.
What happens if you disconnect the 5v step down and just power the Mega using the USB cable?
Without the step down and powering Arduino via. USB was my first setup.
Friend of mine then told me to use the step down and do not power the Arduino via USB, so that the Arduino and DRV8825 got the same ground.
But didn't work either.
Also tried different codes in the meantime (also libraries). But none of them are working either, so no need to post them.
highfish1:
Friend of mine then told me to use the step down and do not power the Arduino via USB, so that the Arduino and DRV8825 got the same ground.
But didn't work either.
When you are powering the Arduino through the USB connection you still need the 5v and GND connections between the Arduino and the DRV8825.
Just to clarify, my suggestion is to take the step-down device out of the system completely - at least for testing. The logic side of the DRV8825 uses very little current and can easily be powered from the Arduino 5v pin.
No I am using no plastic breadboard but I am using a few jumper wires.
Just because I didn't know if I will have to modify something.
@MarkT
Yes, I adjusted the potentiometer from low to high. Just because I thought that could be a problem.
Afterwards I set the current while measuring a winding in series with a multimeter.
I am pretty sure that the setup is right because they work when they are connected sperately.
When you are powering the Arduino through the USB connection you still need the 5v and GND connections between the Arduino and the DRV8825.
Just to clarify, my suggestion is to take the step-down device out of the system completely - at least for testing. The logic side of the DRV8825 uses very little current and can easily be powered from the Arduino 5v pin.
Tried it but unfortunately it didn't make a difference. Same problem still there