High Country Tek DVC80 User Manual
Page 77

P/N: 021-00154, Rev. A.6 - updated for V4.7 Tools
Page | 77
This example makes use of the Process PI selection. The Process PI selection will adjust the current output up
or down in an attempt to make the Set point and the Feedback equal. This kind of regulation requires three
lines of code.
PWM_3.Setpoint = EngineSetpoint
Update the set point variable. The variable is a value from 0 to 1023 or
0% to 100%.
PWM_3.Feedback = EngineRPM
Update the feedback variable. The variable is a value from 0 to 1023
or 0% to 100%.
PWM_3.enable = true
Enable the current output.
Fan Control Example
Below is the actual code for this example
' Fan control to maintain fan speed at 2750 rpm with a pot to control
' varying the speed between ~3000 and 2400 rpm
' 3 inputs are defined and 1 PWM output for a 24 volt Sauer Dan-Foss valve
' Input 1 - Dig start switch
' Input 2 - Univ - proximity switch 10 teeth per revolution
' Input 3 - Analog - potentiometer to control varying the rpms
' Output 1 - PWM Sauer Dan-Foss valve type to control Fan rpm
' Implementation Process P/I loop for PWM/RPM control
' 24 volt controlled valve
' Desensitize the pot movement control
Dim Actual_Sp as Uint
'Trim the Setpoint, from 0 to 100% range to 10 to 90% Range
Actual_Sp = ((Setpoint * 80%) / 100%) + 10%
Dim SError as Uint
Dim Sum as Uint
Dim I_Timer as Timer
Dim EE_I as EEmem
Dim EE_I_Time as EEmem
Dim EE_Error_Max as EEmem
Output.Enable = enable
If (I_Timer = 0s) Then
I_Timer = EE_I_Time
If (Feedback > Actual_SP ) Then
SError = (Feedback - Actual_Sp) * EE_I / 100
If (SError > EE_Error_Max) Then
SError = EE_Error_Max
End If
If (Sum < SError) then
Sum = 0%
Else
Sum = Sum - SError