LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How could the output of PID controller converted into Boolean to allow "SSR" Solid State Relay for Heater Controlling system using LabVIEW?

I'm working on a project for controlling Heater. As i used PID Controller the Output is Numeric I set the Range  (0-100). Now the Solid State Relay can only get an ON/OFF Signal. 

what shall I do to transfer the PID output range to be a readable signal for the Relay? 

- As the output has to be Function in time. for example,  (PID=0 output the SSR =0, PID Output = 10% relay has to be open for x seconds, ....) how can I initiate such a function using LABVIEW

- OR are there any other options to get this Done?

 

The system that I used is: "Master Brick connected with SSR Bricklet and Thermocouple Bricklet" Tinkergorge third party and Programmed using LabVIEW.

 

Thanks 

0 Kudos
Message 1 of 8
(3,604 Views)

@Ahmed_Shoihy wrote:

- As the output has to be Function in time. for example,  (PID=0 output the SSR =0, PID Output = 10% relay has to be open for x seconds, ....)


You are going to have to code this yourself. But basically you need to come up with a "timing interval" and use the PID output to set a "duty cycle" for the relay during that timing interval.

 

  1. Lets say you are measuring your temperature at 10 second intervals
  2. %10 duty cycle would be Relay ON for 1 second and OFF for 9 seconds.
  3. %20 duty cycle would be Relay ON for 2 seconds and OFF for 8 seconds.
  4. See where I am going with this?
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 8
(3,556 Views)

@RTSLVU wrote:

@Ahmed_Shoihy wrote:

- As the output has to be Function in time. for example,  (PID=0 output the SSR =0, PID Output = 10% relay has to be open for x seconds, ....)


You are going to have to code this yourself. But basically you need to come up with a "timing interval" and use the PID output to set a "duty cycle" for the relay during that timing interval.

 

  1. Lets say you are measuring your temperature at 10 second intervals
  2. %10 duty cycle would be Relay ON for 1 second and OFF for 9 seconds.
  3. %20 duty cycle would be Relay ON for 2 seconds and OFF for 8 seconds.
  4. See where I am going with this?

This could work but could also have the temperature have swings that are pretty big instead of steadying out.

 

Most SSRs could probably switch on in under a millisecond.  So instead of 1 second on and 9 off, consider you could speed it up a lot and turn it on for 5 milliseconds then off for 20 if you needed a 20% duty cycle, and it would be a lot closer to an analog value.

 

What hardware do you have for this?  Is it a NI DAQ or something else?

 

 

0 Kudos
Message 3 of 8
(3,538 Views)

@Kyle97330 wrote:

@RTSLVU wrote:

@Ahmed_Shoihy wrote:

- As the output has to be Function in time. for example,  (PID=0 output the SSR =0, PID Output = 10% relay has to be open for x seconds, ....)


You are going to have to code this yourself. But basically you need to come up with a "timing interval" and use the PID output to set a "duty cycle" for the relay during that timing interval.

 

  1. Lets say you are measuring your temperature at 10 second intervals
  2. %10 duty cycle would be Relay ON for 1 second and OFF for 9 seconds.
  3. %20 duty cycle would be Relay ON for 2 seconds and OFF for 8 seconds.
  4. See where I am going with this?

This could work but could also have the temperature have swings that are pretty big instead of steadying out.

 

Most SSRs could probably switch on in under a millisecond.  So instead of 1 second on and 9 off, consider you could speed it up a lot and turn it on for 5 milliseconds then off for 20 if you needed a 20% duty cycle, and it would be a lot closer to an analog value.

 

What hardware do you have for this?  Is it a NI DAQ or something else?

 

 


That was just a simple example but... Our Thermotron thermal chambers default to 60 second integral time for heating and they don't overshoot by more than a degree or two when using a static setpoint.

 

BTW: Tuning the PID can be a task in itself.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 8
(3,536 Views)

@RTSLVU wrote:

@Kyle97330 wrote:

@RTSLVU wrote:

@Ahmed_Shoihy wrote:

- As the output has to be Function in time. for example,  (PID=0 output the SSR =0, PID Output = 10% relay has to be open for x seconds, ....)


You are going to have to code this yourself. But basically you need to come up with a "timing interval" and use the PID output to set a "duty cycle" for the relay during that timing interval.

 

  1. Lets say you are measuring your temperature at 10 second intervals
  2. %10 duty cycle would be Relay ON for 1 second and OFF for 9 seconds.
  3. %20 duty cycle would be Relay ON for 2 seconds and OFF for 8 seconds.
  4. See where I am going with this?

This could work but could also have the temperature have swings that are pretty big instead of steadying out.

 

Most SSRs could probably switch on in under a millisecond.  So instead of 1 second on and 9 off, consider you could speed it up a lot and turn it on for 5 milliseconds then off for 20 if you needed a 20% duty cycle, and it would be a lot closer to an analog value.

 

What hardware do you have for this?  Is it a NI DAQ or something else?

 

 


That was just a simple example but... Our Thermotron thermal chambers default to 60 second integral time for heating and they don't overshoot by more than a degree or two when using a static setpoint.

 

BTW: Tuning the PID can be a task in itself.


I think a while back, there were cars with poorly tuned cruise control which was just a closed loop PID, and they would end up oscillating wildly out of control and cause crashes.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(3,527 Views)

Hi,

 


@Kyle97330 wrote:

Most SSRs could probably switch on in under a millisecond.  So instead of 1 second on and 9 off, consider you could speed it up a lot and turn it on for 5 milliseconds then off for 20 if you needed a 20% duty cycle, and it would be a lot closer to an analog value.

Depending on the switched circuitry you are limited to main supply frequencies: 50Hz in most of Europe, 60Hz in the US.

In this case you (should) use AC-SSR switching at zero voltage crossing.

 

In our lab we used an interval of 4s, which relates to 50Hz*4=200 full sine waves or 400 half waves. This allows us to set the PWM at 0.25% steps while avoiding switching ON at higher voltages…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 8
(3,520 Views)

As Hardware I used: 

It is a third party from a company called Tinkerforge.

  1. Connecting PC throw USB to Masterbrick which is responsible for I/O ports to get and Send Signals.
  2. For measuring Temp. Master Bricks connected to something called Bricklets which get the Temp from Thermocouple.
  3. Another Bricklet used to run the SSR and give 24 VDC to allow SSR with 230 VAC load to be initiated which is in my case the Heater. 

 

 

 

 

 

0 Kudos
Message 7 of 8
(3,492 Views)

Thanks for replying! really Appreciate it! 


I divided the Output Signal into 11 stages using event structure starting form PID.

 

For this, i used a Numeric Slider "represent Virtual PID output just for testing now" in the range 0 %_ 100%. 

 

  • 0% means off 
  • 1..10% = 1000 ms * x "which is variable factor so i could tweak the time more or less"
  • 11..20%,
  • ...
  • ..
  • .
  • 100 % Heater ON for time exceded the While loopt time sothat the heater keeps ON until something else happend.

 

by the way: There is block that allows the Relay to be On in a specific time, which is used it for this Loop.

 

 

Now i have 3 different time range that needed to be in right sequence: 

  •  dt(s) of the PID.
  • Time Ration that i have to put it in each cycle.
  • The while loop waiting time for each cycle. 

I put it in a way that:

  1. The slowest cycle has to be the While loop with 500 ms.
  2. Then dt(s) of the PID "10ms + waiting until until ms block". 
  3. Then the the ON/ OFF Cycles for the heaters.

 

Questions: 

 

  1. Is that what u meant or i should do it in another way? 
  2. Would this work fleuently for the SSR as it gonna excute in a very short time span under 500 ms. ?
  3. What possibilities would be better as i know need to change different parameters, such as PID tunning variables, duty time for each process , ect.  ?

 

Attached the  desired code named:  Heater_Control.Vi 

 

 

Thanks for your Attention! 

 

 

 

0 Kudos
Message 8 of 8
(3,479 Views)