I am programming a L293D motor driver with a BLDC motor to spin at speeds of 60-300 RPM. It is for a hybrid drone/car where I want the motors to spin slowly while having the necessary torque to drive.

So far, I've followed instructions in the spirit of this guide in MatLAB:


I've attached a picture of my coding, where i tried various methods of controlling the motor, via "micro-stepping", spwm signals, and simply a sine wave function.

I've had the most success with the sine wave function, where the motor initially runs smoothly, but progressively the motion becomes jolted. On the oscilloscope, there was also a lot of voltage spikes, which I request your help in understanding and fixing. Perhaps I can somehow implement some diodes into the circuit? Also, the torque was non-existent.

I used a 12 volt DC supply, which gave out 0.5 amps to the driver.

Sine Wave Function to the pins This is a pic of the Sine Wave function at 2 rad/s frequency. The value of sine wave goes directly into the pwm pins. Here I'm trying to run the motor like a stepper. It stepped a couple times at first, but then... it behaved erratically.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.