Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5665

PID control of power supply

$
0
0

Note: I realize this post may be considered off-topic, but I think my problem lies with how I'm trying to control my instrument (not the PID controller); hence, I posted my question here. Please correct me if I'm wrong.

 

Given: I have a dual channel programmable power supply, a rotary encoder, and a PID controller.

Find: With feedback from the encoder, I would like to use the PID controller to control my power supply's voltage outputs.

 

My solution
Using the VI below, I can read the encoder and adjust the power supply voltage without a PID controller. The left loop reads the encoder's data, and the right loop lets me "manually" set the voltages to channel 1 and channel 2. More specifically, an event structure inside the right loop sends the latest "desired" channel voltages (that I have entered into the respective controls) to the power supply.

noPID.png

 

My problem
However, the right while loop doesn't "react" when I replace this "manual" voltage control with a PID controller. The power supply simply doesn't do anything even though the PID is telling the power supply to do something.

 

withPID.png

 

Attempted fix
In "highlight execution" mode, I saw that my left loop would run numerous complete iterations, but the data in the right loop would only execute once--and even then the data stopped when it reached the event structure.

 

Questions

  1. Is my PID-controlled loop not working because the PID loop (on the left) is executing too quickly relative to my power supply loop?
  2. What would you recommend? Notifiers?
  3. (Slightly unrelated) How should I get the latest voltages from my power supply?
    The two "read output" blocks in the power-loop should enable me to display the actual voltage of a channel. However, This data is always one "step" behind the actual reading.
    For example, I will set V1 = 12V. The power supply reacts and displays 11.998V on its LCD screen. However, my LV code displays 0V (or whatever value V1 previously held). If I change V1 again, say V1 = 7.9V, then the power supply will display 7.989V but the LV code will display 11.998V. What am I doing wrong? 
    Notet that if I set V1, and then set V2, my LV code will display the correct V1 value but not the latest V2 value.

 

 


Viewing all articles
Browse latest Browse all 5665

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>