We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4f58c3 commit 36c8020Copy full SHA for 36c8020
qpid.c
@@ -269,8 +269,8 @@ float qPID_Control( qPID_controller_t * const c,
269
e = 0.0F;
270
}
271
/*integral with anti-windup*/
272
- ie = c->integrate( &c->c_state, e + c->u1, c->dt, false );
273
- de = qNumA_Derivative2p( &c->c_state, ( ( c->c*w ) - y ) , c->dt, true );
+ de = qNumA_Derivative2p( &c->c_state, ( ( c->c*w ) - y ) , c->dt, false );
+ ie = c->integrate( &c->c_state, e + c->u1, c->dt, true );
274
c->D = de + ( c->beta*( c->D - de ) ); /*derivative filtering*/
275
v = ( kc*( ( c->b*w ) - y ) ) + ( ki*ie ) + ( kd*c->D ); /*compute PID action*/
276
0 commit comments