Quote:
|
Originally Posted by X-Istence
Quote:
|
Originally Posted by Qbranch
...remove your deadband around neutral on the victors,...
|
Where would one stick this in a PID loop?
|
It doesn't go "in" the PID loop. It's part of the output of the pwm value. Here's one way to do it:
Code:
#define minimum 0
#define neutral 128
#define maximum 254
#define deadband 7
// make sure we won't overflow/underflow the value 0-254 range
if (value <= minimum+deadband)
value = value + deadband;
if (value >= maximum-deadband)
value = value - deadband;
// move the value away from neutral by enough to overcome the deadband
if (value < neutral)
value = value - deadband;
if (value > neutral)
value = value + deadband;