Hi everyone! I am using a NodeMCU to control a micro motor, which is driven using an L293D motor driver.. The motor operates a valve, thus I turn the motor clockwise for a few milliseconds, hold it there for a second or so, and then I reverse the motor to shut off the valve. However, sometimes the motor simply does not rotate. I can feel a small click sound from the motor but it doesn't rotate.
The motor consumes around 100mA at normal operation and around 220mA at stall at 5 volts. I am using a bench power supply for 5 volts since NodeMCU runs a 3.3V logic.
Today I attached an oscilloscope to the motor pins and recorded the curves (attached images). I can't understand why I am seeing these spikes. The left one is when the motor runs, and the right one is when it doesn't. I tried putting a 15pf and 1500pf capacitor across the motor but it didn't help.
What thing I am doing wrong? Any conclusion that can be drawn from these V-t curves?
Any help is highly appreciated. Thanks.
Most of the 'spikes' aren't spikes, they are simply variation of the output voltage of the L293D as the load
current varies. The L293D has darlington output stages which drop a lot of voltage (as you can see)
and that voltage drop is strongly dependent on current too.
The one spike I can see on the yellow trace is simply back-EMF when you stop driving the motor
but it is still turning. This back-EMF isn't acting symmmetrically for probably rather arcane reasons.
In the second case the motor is stalled (physical friction has not been overcome). This is probably
because you are using the same max drive in shutting the valve as opening it. Ideally you use
less current (and thus force) when moving the valve to its end-stop so that full motor drive is
guaranteed to move it out again. If you use the same force its pot-luck whether it will be stuck.
Remember static friction usually is a little bit greater from stationary than when moving.
Also if you pile into the endstop at speed momentum will wedge you there more securely.