Roy Vegard Ovesen wrote:
On Friday 19 August 2005 23:58, Hans-Georg Wunder wrote:

Hi all,

I try to configure a P-Controller, but I have problems with the
anti-windup logic:


The velocity form of the PID control algorithm _needs_ to have an integral component. If you need to use a P only controller, try the <pi-simple-controller>.

Snip! ...

I took a P only controlller to simplify the problem.

Snip! ...


I think, this is not okay. delta_u_n = 0; has to be replaced by
something like that

        delta_u_n=u_max - u_n_1;


It doesn't work !!! :}}}}

But after a looooooooooot of testing I found a solution:

        // Integrator anti-windup logic:
        if ( delta_u_n > (u_max - u_n_1) ) {
            // We have to add the maxium, which is posibble and then
            // to reduce the input value for the next cylcle accordingly
            ep_n = (ep_n * u_max )/(delta_u_n+ u_n_1 );
if ( Td > 0.0 ) edf_n = (edf_n * u_max ) / ( delta_u_n + u_n_1 );
            delta_u_n =u_max - u_n_1 ;
            // delta_u_n = u_max - u_n_1;
            // ep_n = delta_u_n / Kp;
            //ep_n =- u_max/Kp;
if ( debug ) cout << "Max saturation " << " New delta_u_n = " << delta_u_n << " New ep_n = "<< ep_n << " ew edf_n = " << edf_n << endl;
        } else if ( delta_u_n < (u_min - u_n_1) ) {
            // We have to add the maxium, which is posibble and then
            // to reduce the input value for the next cylcle accordingly
            ep_n = (ep_n * u_min )/( delta_u_n + u_n_1 );
if ( Td > 0.0 ) edf_n = (edf_n * u_min ) /(delta_u_n + u_n_1 ) ;
            delta_u_n =u_min - u_n_1 ;
            // delta_u_n = u_min - u_n_1;
            // ep_n = delta_u_n / Kp;
            //ep_n =- u_min/Kp;
if ( debug ) cout << "Min saturation " << " New delta_u_n = " << delta_u_n << " New ep_n = "<< ep_n << " New edf_n = " << edf_n << endl;
        }


I tested it for a P and a PI-controller. I haven't tested yet the D-part, but I hope, it will work too


Any comments are welcome


Hans-Georg

_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to