NearZero1
NearZero1 copied to clipboard
Motors don't stop when PWM input signal stops
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; }