RBinsonB / Nox_robot

Nox robot project
GNU General Public License v3.0
94 stars 38 forks source link

arduino firmware [Fixed] #1

Closed bekirbostanci closed 4 years ago

bekirbostanci commented 4 years ago

Hello Your arduino firmware there is lots of different variable and some constant values. Some of them don't have any comment. Can you write comment for these lines ?

//990 and 1000 ?
speed_act_left=((pos_left/990)*2*PI)*(1000/LOOPTIME)*radius;           

//0.882 and 0.00235 ?
PWM_leftMotor = constrain(((speed_req_left+sgn(speed_req_left)*0.0882)/0.00235) + (speed_cmd_left/0.00235), -255, 255); 
bekirbostanci commented 4 years ago

0.00235 is a scale factor to turn the speed in m/s into PWM value (0 to 255) The coefficient is a slof of the pwm and cmd value. Second coefficient is dead range of the motor driver so that we are adding sgn(speed_req_left)*0.0882 Thanks @RBinsonB