Soft (smooth) start of DC motor - which driver ?

Hello guys

I have a problem. I m using L298N motor driver to drive a 12V DC geared motor (550rpm max) with a potentiometer and PWM.

As you propably imagine when potentiometer is at low leves, motor makes a sound and do not start. When potentiometer exceed a specific value, motor start spinning suddenly.

Propably my motor driver (L298N) is not the best for soft start. Can you suggest me a solution ?

Once you get it spinning, you can then reduce the drive level down below that point and it will keep spinning, won't it?

A soft-start procedure that wants to start a motor at low RPM needs to include a 'kick' of a few milliseconds of high power to get it started moving, then reduce to low level.

If you want to soft-start to a high power level, start with the kick voltage and then smoothly ramp up from there to full power over 10-100 milliseconds. If your load has a high inertia like a flywheel, you may use a longer ramp period.

Thank you MorganS. So what you are saying is something than can be done through Arduino code, right ? no need to search for another hardwar e driver.

Any sample code available ?

thanks

It may be overkill, but it would help if you have some means to detect the motor speed - or even to detect the fact that it is not rotating.

A simple solution might be a push-button that gives a high PWM value when pressed.

...R

I have a geared 12v DC motor of max 550rpm and a potentiometer to control speed.

a simplified code is this :

#include <SPI.h>  

#define in1   2
#define in2   4
#define pot_pin   3  //speed pin

void setup() {
pinMode(in1,OUTPUT);
  pinMode(in2,OUTPUT);
  pinMode(pot_pin,OUTPUT);
}


void loop()  {

int Speed = map(pot_pin,0,1023,0,255);

analogWrite(pot_pin,Speed);
  digitalWrite(in1,LOW);
  digitalWrite(in2,HIGH);
  
}

Can you tell me guys how to implement a soft starter code ?

I found that motor start spinning when mapped pot value (speed) = 80.

gspir:
Can you tell me guys how to implement a soft starter code ?

Reply #4 reads like a repeat of your Original Post. Have you considered the advice you have already been given?

...R

A basic way would be to add a variable to hold a pwm value. Initialize it to zero.
Every time around loop, compare pwm to your speed variable. If it's less, increment it; if it's more, decrement. Use pwm in your analogWrite statement. Delay for say 50ms at the end of loop. Tune the delay until the motor acts as you need.

Better to use the blink without delay technique than delay, but it will get you started.

Also, as MorganS remarked, you likely need to reduce the pwm value once the motor has started moving but I'd try the simple way first.

If you mean the push button solution at #4 it isn't an option since the motor is driven by a potentiometer in a ready closed box (thus cannot add buttons or other components).

Perhaps we can include this high PWM value in the code, something like if speed>10 (just an example value) then speed=150 (hus an example value) for 10ms and then speed again = map(pot_pin,0,1023,0,255);

something like this ?

but I don't know how to implement something like this in a code.

wildbill:
Every time around loop, compare pwm to your speed variable. If it's less, increment it; if it's more, decrement. Use pwm in your analogWrite statement. Delay for say 50ms at the end of loop. Tune the delay until the motor acts as you need.

I don't see how that is going to get the motor to "un-stick" and then rotate at a modest speed?

If the speed variable is coming from the potentiometer I don't see any value in the 50ms interval - the user could just turn the pot more slowly. In fact, introducing an interval may be more likely to cause the user to apply too much throttle.

I believe what's needed here is some means to anticipate what is required in the future and not the application of the recent past.

Maybe the OP could figure out the minimum reliable "un-stick" value and the minimum reliable running speed value and write some code that detects the user's desire to start the motor (pot moving from the zero position) and then applies the un-stick value for a specified time followed by reversion to the minimum running value. However this approach would really only work for a constant and predictable load.

...R

So, it seems like it's not so easy. Question still unanswered!

With more information from you, it would be easy. Which of the proposed solutions did you try? Did it work? What would you like it to do differently?

If you change your code, please re-post with your questions.

Have you tried the motor with a load on it?

A free running motor or gearbox will spin up pretty fast once its broken its friction but the problem might not even show itself or it could be not an issue once there is an actually load on the motor.

gspir:
Question still unanswered!

How can you say that?

There have been several suggestions.

...R

gspir:
Hello guys

I have a problem. I m using L298N motor driver to drive a 12V DC geared motor (550rpm max) with a potentiometer and PWM.

As you propably imagine when potentiometer is at low leves, motor makes a sound and do not start. When potentiometer exceed a specific value, motor start spinning suddenly.

Propably my motor driver (L298N) is not the best for soft start. Can you suggest me a solution ?

This is likely because you are not using the best decay-mode for control. Synchronous rectification gives
the most direct control of speed via PWM (and automatically gives braking when the PWM duty cycle
reduces).

Having said that there is always some hysteresis on starting a brushed motor due to the static friction
of the brushes - for full control at low speed you have to use a position or speed feedback loop (typically
based on an encoder.)