Specifications

42
Curtis 1310 Manual, Rev. B
5 — VCL
If (PWM2_Output = 32767)
;check if the Aux Contactor is closed (on)
{
If (ADC16_Output < 1000)
;the coil is drawing less than the minimum
;raw current reading
{
;put your low current coil fault detect code HERE...
}
}
Note that all ADC#_Output values are raw 10 bit value. The VCL program-
mer must experientially determine the reasonable values for this reading. In
the case of ADC15_Output and ADC16_output, a full scale reading (1024)
is equal to about 3.33 amps.
The current feedback signal in Outputs 1 and 2 can also be used to cre
-
ate a current-controlled output. This type of output is useful for accurately
positioning a flow proportional valve. In the basic wiring diagram, Output1 is
shown wired to such a valve coil.
In order to create a constant current with a PWM output, a PID loop is
added, using the current measurement as the feedback (see Section 14 of the
Common Functions manual for more detail). The PID controller automatically
regulates the PWM output so that the current reading matches the current
command. To keep a valve from sticking in one position, a small amount of
“jitter” is added to the command.
;setup code
Kp = 16767 ;Proportional gain
Ki = 2 ;Integral gain
Kd = 0 ;Derivative gain
Command equals User1
Command = 300 ;about 1 amp
Automate_PID(PID1,@Command,@ADC16_Output,@Kp,@Ki,@Kd,1,1)
Automate_PWM(PWM1,PID1_Output)
;Main Loop
Main:
If Command = 300
{
Command = 305 ;adding some jitter to the command
}
Else
{
Command = 300
}
;add some more code or force a delay HERE
Goto Main