Hi guys,
I'm currently testing my DC motors, as I provide the PWM signal through analogWrite(ENA, 30), the motors didn't rotate until I change the value up to at least 40. My question is that if I change the PWM frequency, will it able to rotate at low PWM signal (because I use default setup in which I measured 980Hz on pin 8 and 490Hz on pin 9 and 10 on Arduino Mega 2560).
And if the changing of frequency works, should I increase or decrease the frequency? Thank you
We need to see your complete Sketch, use code Tags.
We definitely need to see a schematic and a good image of the actual wiring.
It is possible the motor needs at least a value of 40 to start moving.
You will probably find that different motors, even ones that look the same, will start at slightly different PWM values, and won't always start at the exact same PWM value every time.
Changing the frequency will probably change the PWM value they start at, but they won't start reliably at a lower PWM at any frequency.
The trick is to give the motor a brief (~100ms) "kick" at 255 to get them started. Then you will probably find they will run at lower speeds than they would normally start at.
Well it just a l298n, an Arduino mega and a DC motor, pin ENA of l298n connect with pin 10 in arduino.
A more modern and efficient motor driver might start your motors at a lower PWM value. L298 is an old and inefficient design.
Could you explain the "kick" part, as the way I understand, start at 255 then reduce to 30 to see if it's possible to rotate the shaft right ?
There will always be a lower limit below which the motor won’t start - at very “low” there is just not enough power.
Motors at very low rpm also are very inefficient and may get hot .
Hi, I''m just measuring the speed of each PWM value to get the data for PID controller, so I don't think the rpm is mattered here, 30 is the lowest point of PWM in my project
IF you want motor rotation at low pwm values, you need a HIGHER voltage for the motor. Then each pulse will result in higher current, which is what the motor need to turn.
Right! Once it's moving it's easier to keep it moving.
You can try a circuit which has a small current (bias current) always flowing through the motor; a current that does not, in its self, make the motor move.
Then a short PWM pulse should be able to start the motor to turn.
This, however, does waste power.
Well I tried, but it didn't work though.
So it means that as I'm having a 12V DC motor with encoders, I should supply the voltage of >12V DC right, will it damage the motor.
All depends on the length of time you intend to move the motor. You could use a higher voltage only when you need low speed.
Voltage is (usually) not what kills your motor. It is the current that may kill the motor.
When the motor is not turning, the resistance (impedance) is very low --> high current --> all power will be converted to heat instead of movement.
No air will move around the motor.
All energy will be dissipated in one coil of your motor (not three).
All this will easily cause overheating.
I propose to choose a minimum PWM where the motor starts and runs reliably. Below this value you will easily move into the danger zone described above.
Unless you really need a very slow turning of your motor. But then you would be better off with an extra gearbox or a stepper motor. Stepper motors are designed to run at low RPM and can be controlled very accurately.
No man, I'm using JGB37-545 DC motors. The one with encoder. This is too small and week to my project.
Hi,
Can you please post link to data/specs of your motor?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Thanks.. Tom...
![]()
Thank you, I had an experiment and the motor rotated at the PWM of 40/255. It just I want to control the motor at 30 PWM so that it can followed the formula I had calculated earlier.
Hi;
What formula?
What is the application of your project?
Thanks.. Tom..
![]()
