NearZero1 icon indicating copy to clipboard operation
NearZero1 copied to clipboard

Motors don't stop when PWM input signal stops

Open slomobileAdmin opened this issue 4 years ago • 0 comments

Functions.ino line 760 if(pwm1_t > 0){ //Is the pwm active?

pwm1_t and pwm2_t are only set to 0 prior to setup() until the first pwm signal is received. After that, they always hold some positive value. That value is only set by ISR_pwm1() which will not occur if the R/C transmitter is switched off or goes out of range. The result is motors keep turning at the last speed unless R/C transmitter is switched back on and signal is set to neutral, or power is disconnected. There needs to be something like // PWMtimeout around 100mS if (micros() - risemark1 > PWMtimeout) { pwm1_t = 0; pwm2_t = 0; }

slomobileAdmin avatar Sep 16 '20 01:09 slomobileAdmin