Skip to content

Commit

Permalink
fix to qpid
Browse files Browse the repository at this point in the history
  • Loading branch information
camilo committed Feb 15, 2024
1 parent e4f58c3 commit 36c8020
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qpid.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ float qPID_Control( qPID_controller_t * const c,
e = 0.0F;
}
/*integral with anti-windup*/
ie = c->integrate( &c->c_state, e + c->u1, c->dt, false );
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 );
c->D = de + ( c->beta*( c->D - de ) ); /*derivative filtering*/
v = ( kc*( ( c->b*w ) - y ) ) + ( ki*ie ) + ( kd*c->D ); /*compute PID action*/

Expand Down

0 comments on commit 36c8020

Please sign in to comment.