Hello there. I am currently working on speed control for a DC motor using PWM for my project but have some problems which I'm not clear about. I've attached my codes here. A brief overview of how my code runs is that it checks the voltage to run the respective PWM.
My problem now is that when controlling the motor, I want it to run when at speed 1 but it doesn't even though I've already make it run at 100% for 0.6s so that it can get enough power to run at 30% duty cycle. It works as desired in the beginning but then doesn't after I've decreased voltage to zero and then increase my voltage again. Any ideas on solving this?
My problem now is that when controlling the motor, I want it to run when at speed 1 but it doesn't even though I've already make it run at 100% for 0.6s so that it can get enough power to run at 30% duty cycle. It works as desired in the beginning but then doesn't after I've decreased voltage to zero and then increase my voltage again. Any ideas on solving this?