LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

on off controller hysteresis?

Hello people, for our program at school we need to make an on/off controller with a hysteresis which we need to be able to change.

 

So for example: our setpoint is 50%, so the regulator needs to pop on at 45%, and turn off at 55% (hysteresis = 10%)

 

How to make this?

We already have the program for 0-45% and 55-100%.

 

Thanks in advance! 

0 Kudos
Message 1 of 4
(2,755 Views)

Hi Yves,

 

some pseudocode:

out(n) := [PV >= (SP - HY/2)] AND [PV < (SP + HY/2)];
with
  PV = process variable aka measurement value
  SP = setpoint
  HY = hysterese
  out(n)   = current output value (0=FALSE, 1=TRUE)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,740 Views)

You should read about the In Range and Coerce Function in the  Comparison Functions Palette.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(2,725 Views)

Hello Yves,

 

Your description isn't complete and could be either hysteresis or deadband (which is what GerdW has provided some psuedo code for). Hysteresis typically has to have some "memory", and there are many different forms of hysteresis. There are plenty of rescources online describe hysteresis functions - both graphically and mathematically.

 

Just did a quick search - and came up with this - looks a fairly complex function - depends if you need something smooth:

http://revue.elth.pub.ro/upload/66469907Motoasca.pdf

 

Maybe you can cope with a simpler hysteresis function that just has straight lines!

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 4 of 4
(2,658 Views)