PWM: Duty cycle is varying by itself.

Thread Starter

Xavier Pacheco Paulino

Joined Oct 21, 2015
728
Hello,

I programmed a microprocessor (STM32F1 Core board) to output a pwm signal which I can vary its duty cycle by using two push buttons. One is used to increase duty cycle and the other to slow down it. Every time I push the respective button, the duty cycle increase or decrease by 10%. I tested my circuit using a light bulb and it worked nice. But my main objective is to control a motor speed. When testing the pwm with the motor, the speed changes by itself like crazy without pushing any button. It's like noise, but I am not sure. What could be happening?
 

DickCappels

Joined Aug 21, 2008
10,661
There is a chance that electrical noise from the motor is affecting the circuitry either inside the controller or outside. This is especially true when motors with brushes are involved.

If that is the cause the solution involves careful circuit layout, filtering, buffering and in extreme cases shielding.

In one instance a temporary firmware fix minimised the problem (a camera film back would crash and eject a whole pack of Polaroid film onto the floor -expensive!) until the electrical
interference problems were corrected.
 
Top