REPALphilread / ReP_AL-3D-Lawn-Mower

Code and Other for the ReP_AL Lawn Mower
104 stars 53 forks source link

Max speed slow ramp #15

Open shaggy63 opened 4 years ago

shaggy63 commented 4 years ago

When a drive motor starts moving or changes direction it would be beneficial for the life of the motors to ramp the speed up instead of having a sudden jump from 0 to max speed. Also recommended for blade starts.

Something like:

while (speed_now < PWM_MaxSpeed) delay(20); analogWrite(ENAPin, speed_now ); analogWrite(ENBPin, speed_now ); speed_now =speed_now +20;

 if (speed_now > PWM_MaxSpeed) 
 {
  speed_now = PWM_MaxSpeed;
 }

}