I am wondering about the slave part:
Quote:
Originally Posted by Ether
Code:
// P + I controller for M2 (slave)
error2a = RLPC - e2pos; // closed loop error for Proportional part
cmd2a = Kp2*error2a;
error2b = e1pos - e2pos; // closed loop error for Integral part
error2bi += error2b; // integrate the error
if (error2bi>i2bLimit) error2bi = i2bLimit; // clamp the integrated error
else if (error2bi<-i2bLimit) error2bi = -i2bLimit;
cmd2b = Ki2*error2bi;
cmd2 = cmd2a + cmd2b;
|
Are you intentionally basing the P value on the error from the set point, but the I value on the error from the master? If so, I'm going to have to puzzle a bit as to what would happen if the master jammed.