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

Algorithmic closed loop controller
Table of Contents

Advertisement

static float Error;
static float PV_old;
static float Setpoint_old; /* Last setpoint - for derivative
static float SD_out;
static float Status = 0;
/*
/*
/*PID algorithm code:
/* Test for Process Variable out of limits */
if ( (inchan
{
if ( !Status.B6 )
{
Status.B6 = 1;
alarmchan = 1;
interrupt();
}
}
else
{
Status.B6 = 0;
}
/* Do this when in the Manual control mode */
if ( Man_state )
{
/* Slew output towards Man_out */
if (Man_out
{
outchan = outchan + abs(Man_inc);
}
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 */
Appendix D
/* Error term
/* Last process variable
/* Setpoint derivative term
/* Algorithm status word
/*
/*
/*
/*
/*
/*
/*
/*
/*
>
PV_max) || ( PV_min
>
outchan + abs(Man_inc))
>
Man_out + abs(Man_inc))
B0 - PID_out at clip limit
B1 - I_out at clip limit
B2 - D_out at clip limit
B3 - SD_out at clip limit
B4 - in Manual control mode
B5 - Error out of limits
B6 - PV out of limits
others - unused
>
inchan ) )
/* PV alarm test
PID Algorithm Listings
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
351

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vxi e1415a

Table of Contents