Stepper motor causes voltage drop when running

I am a bit new to the electronics hobby so I am trying to understand what is going on with my circuit. I am using a pic microcontroller to control a stepper motor, an LCD and an RTC using USB to provide power as shown my circuit diagram below

I am using a power bank or USB phone charger for power, both can supply 5V and 2.4 amps. What I found out is that when the stepper motor runs, the voltage in the circuit drops down from 5.2 volts to 4.6 volts, causing a dim in the LCD and sometimes it caused a hang in the PIC or the RTC.

The stepper motor is NEMA 17 HS4401 which has phase voltage of 2.6 volts and phase current of 1.7 amps but I am limiting the current to less than 1.2 amps

After adding a 100 uf capacitor in parallel with PIC and increasing the motor capacitor from 100 uf to 220 uf, things became better. Getting the motor power wires (VMOT and GND) closer to the power supply somehow reduced the drop, voltage now drop to only 4.9 volts.

So my questions:

1- Why is this voltage drop happening? as far as I understand, it should not happen as long as I am drawing below the 2.4 amps the power source can supply

2- Is there any way to eliminate that drop? would using a bigger capacitor for the motor make any difference?

3- The motor completes a cycle, stops a bit then moves again, which keep changing the voltage between 5.2V and 4.9 volts, is there a risk that the constantly changing voltage would damage any components?

Any help is appreciated

• (1) "power bank/USB phone charger for power, both can supply 5V and 2.4 amps" - Their no load voltage might be 5.4V, but drop to 4.5V at full load. (2) "any way to eliminate that drop? would using a bigger capacitor" - Yes, usually the bigger cap the better. Me usually use 20,000uF, when there are too much noise, glitches. Commented Jan 29, 2021 at 0:42

I am using a power bank or USB phone charger for power, both can supply 5V and 2.4 amps. What I found out is that when the stepper motor runs, the voltage in the circuit drops down from 5.2 volts to 4.6 volts, causing a dim in the LCD and sometimes it caused a hang in the PIC or the RTC.

The stepper motor is NEMA 17 HS4401 which has phase voltage of 2.6 volts and phase current of 1.7 amps but I am limiting the current to less than 1.2 amps

After adding a 100 uf capacitor in parallel with PIC and increasing the motor capacitor from 100 uf to 220 uf, things became better. Getting the motor power wires (VMOT and GND) closer to the power supply somehow reduced the drop, voltage now drop to only 4.9 volts.

So my questions:

1- Why is this voltage drop happening? as far as I understand, it should not happen as long as I am drawing below the 2.4 amps the power source can supply

Wires have resistance, and when current flows through a resistance, it creates a voltage drop over that resistance proportional to current and resistance. More resistance or more current means more voltage drop. This can cause a decrease in output voltage right at your regulator, or the regulator may just have variation while it tries to keep up to the surges, so you should apply max load and measure output right at the regulator to see if you need a regulator with better load regulation. The capacitors you've added/increased the size of act as pressure reservoirs to feed the surges so the regulator can have a more constant and therefore predictable output, but they can only charge up to the actual output voltage of the regulator, so if your regulator output is dipping when the load is applied and recovers it's output voltage with a constant load, the capacitors will help more. In the other case, the caps might not be able to cancel the voltage drop at the regulator output, but they can reduce it a bit and help keep it constant by smoothing the regulator output.

Your current rating can't easily be changed in this case, but your wire size may be an issue. Measure the length of your wire and look up it's resistance per length and calculate it's resistance, then decide if larger wire is in order. Use a voltmeter to measure voltage drop under load.

2- Is there any way to eliminate that drop? would using a bigger capacitor for the motor make any difference?

A regulator with better load regulation might be necessary depending on your tests, and you may need to use larger or shorter wires. You could also use a separate regulator for your logic, which is more sensitive to voltage than a motor, although with a stepper motor you want to make sure regardless of voltage change it has enough power to make a full step when activated. If you don't want to separate the regulators, increased capacitance does help, but be aware when you first connect your regulator to capacitor, you'll have a current surge to charge the capacitors and your regulator may treat this as a fault and shut down or perform in other unexpected ways. The larger the capacitance, the longer it will take to charge, resulting in a slowly rising source voltage. From experience I've had logic circuits misperform when they're turned on too slowly and had to add a delayed enable so one part of the circuit didn't activate before the rest, so if you go overboard on the capacitor band-aid there are disadvantages.

3- The motor completes a cycle, stops a bit then moves again, which keep changing the voltage between 5.2V and 4.9 volts, is there a risk that the constantly changing voltage would damage any components?

This is the part where an engineer would guess better than me, but for hobby purposes, .3V variation isn't that much, especially if you can improve the variation on the logic circuit. You have 6% variation, but logic circuits use so little power I'd usually aim for 1% or better. Some circuits are more sensitive than others. I had one circuit that produced it's own regulated reference voltage to compare to output voltage, so its output was fairly resilient to input power changes.

In another part of the circuit I was timing by charging capacitors off the varying input voltage, and comparing that to a regulated reference. Even though the reference half of the circuit was resilient to input changes, the rate of capacitor charge was changed and varied the frequency of my timing loop.

So how much variation you can afford depends on each individual load and I don't know how each of your digital loads deal with voltage ripple. If the voltage ripple is slow enough and within the acceptable input range of your load, nothing bad will happen at all(IE battery output voltage slowly dropping), but your ripple is much faster than that.

Whenever the load regulates the voltage, we can define it in terms of % voltage error which then can be used to compute the source impedance ratio to the load. This is called % Load Regulation Error.

For a battery this source impedance is the total of effective series resistances or ESR.

The motor coil is 2.5 Ω ±10% per phase thus 4A worst case with a drop of 0.6V/5.2V=11.5% which is rather high.

means 600mV/4A = 150 mOhm ESR so you expect the load to be 150 mΩ / 11.5%= 1.3 Ω (1.25 +5%)

The drivers have an RdsOn of 280mΩ & HS 290mΩ LS. These are all expected losses are normal for you what. Minor improvements can be done with twisted pair (UTP or STP) wiring for everything to reduce crosstalk and low ESR caps. Otherwise the batteries are showing their age or quality. This is the challenge with low voltage motors to get low losses for each circuit as the currents demand heavier gauge and shorter wire or upgrade the power supply.