HP VXI 75000 C Series User's And Scpi Programming Manual page 358

Algorithmic closed loop controller
Table of Contents

Advertisement

}
else if (outchan
{
outchan = outchan - abs(Man_inc);
}
else
{
outchan = Man_out;
}
/* Set manual mode bit in status word */
Status.B4 = 1;
/* No error alarms while in Manual mode */
Status.B5 = 0;
/* In case we exit manual mode on the next trigger */
/* Set up for bumpless transfer */
I_out = outchan;
Setpoint = inchan;
PV_old = inchan;
Setpoint_old = inchan;
}
/* Do PID calculations when not in Manual mode */
else
/* if ( Man_state )
{
Status.B4 = 0;
/* First, find the Process Variable "error" */
/* This calculation has gain of minus one (-1) */
Error = Setpoint - inchan;
/* Test for error out of limits */
if ( (Error
{
if ( !Status.B5 )
{
Status.B5 = 1;
alarmchan = 1;
interrupt();
}
}
else
{
Status.B5 = 0;
}
/* On the first trigger after INIT, initialize the I and D terms */
if (First_loop)
{
/* For no abrupt output change at startup make the I term cancel the P term */
I_out = outchan + Error * ( I_factor - P_factor );
/* Zero the derivative terms */
PV_old = inchan;
Setpoint_old = Setpoint;
}
/* On subsequent triggers, continue integrating */
else /* not First trigger */
{
I_out = Error * I_factor + I_out;
}
/* Clip the Integral term to specified limits */
if ( I_out
{
I_out = I_max;
358 PID Algorithm Listings
>
Man_out + abs(Man_inc))
*/
>
Error_max) || (Error_min
>
I_max )
>
Error) )
Appendix D

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vxi e1415a

Table of Contents