Skip to content

Commit

Permalink
fix issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
josetomas committed Sep 24, 2020
1 parent a921df1 commit e8af8d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion WifiClient_ESP32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ const int motorSpeed = 255; //Motor speed, this variable will define the motor s
* maxPayload: PWM payload in wich the robot breaks the inertia.
* minPayload: PWM payload for the normal speed we want to aim for our robot.
* torqueRampSmoother: Will set te amount of cycles in wich the robot will reach the desired speed. A big number will take more time to reach the speed, but in a smoother way.
* delay: Time wich a PWM torque stays working.
The ramp time will be defines by the following equation: (maxPayload-minPayload)*delay/toqueRampSmoother.
*************************************************************************************************/

bool inMove = false;
const int maxPayload = 255;
const int minPayload = 120;
const int torqueRampSmoother =10; //The smaller this number is, the slower the acceleration will be.
const int torqueRampDelay= 10;

/*****************MOTOR DIRECTION**********/
bool motor1 = false;
Expand Down Expand Up @@ -339,7 +342,7 @@ void torqueRamp(String motor1Status, String motor2Status, String motor3Status){
analogWrite(pinEnable[3],payload);
}
payload=payload-delta;
delay(500);
delay(torqueRampDelay);
}
inMove= true;
}
Expand Down

0 comments on commit e8af8d6

Please sign in to comment.