LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Constant current


@gok010 wrote:

I am using NI PXIe 6345 IO card in NI PXIe 1088 chasis. the current should be in the range of 0 to 300mA in for both AC and DC. I have to generate the input signal using the DAQ device no other devices are available except a power amplifer


This is something you must have provided in the first post. You missed to provide details about the power amplifier.

 

Up to what frequency in AC?

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 11 of 21
(652 Views)

Hi,

 

I have some doubts about the dt(s) in the PID VI is it ok to set it as the reciprocal of the sampling rate? Do we need a DAQ Mx start Start task VI, if we enable the auto start in the DAQ mx write VI.PID_program_2.PNG

0 Kudos
Message 12 of 21
(644 Views)

Hi gok,

 


@gok010 wrote:

I have some doubts about the dt(s) in the PID VI is it ok to set it as the reciprocal of the sampling rate?


Did you read the (detailed) help for that function? It explains how to use that PID input…

(Usually you don't need to wire anything here.)

 


@gok010 wrote:

Do we need a DAQ Mx start Start task VI, if we enable the auto start in the DAQ mx write VI.


No.

 

On your image:

  • There are terminals with missing labels. You may hide labels on the frontpanel but you should never hide them in the block diagram…
  • You don't follow the StyleGuide: try to implement code the usual "left to right DATAFLOW" suggestion…
  • You don't need those "status" UnbundleByName functions. Boolean functions can handle error wires nowadays!
  • Why do you convert the PID output to an array (in a very Rube-Goldberg way)? Why don't you write the scalar value to DAQmxWrite, set to "1 chan 1 sample" mode?
  • Why do you divide the AI waveform by 30 before wiring to the PID function? Adjusting the PID gains will give the same result!
  • Why do you wire a waveform to the PID? Did you notice the coercion dot and do you know what it means?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 21
(628 Views)

    Hi GredW,        

 

  • I want to acquire and generate the signal for both AC and DC continuously that's why I connected PID output to an array and the to 1 channel N sample.
  • Since I am reading a current output across a resistor of 30 ohms, I divided the value with 30, so that it gives the value of current.
  • Does the AI/AO read/write continuously if set to 1 channel 1 sample mode in a while loop?  Won`t it be affected by delay in the loop?PID_program_3.PNG
0 Kudos
Message 14 of 21
(614 Views)

Hi gok,

 


@gok010 wrote:
  • Since I am reading a current output across a resistor of 30 ohms, I divided the value with 30, so that it gives the value of current.
  • Does the AI/AO read/write continuously if set to 1 channel 1 sample mode in a while loop?  Won`t it be affected by delay in the loop?

  • You can apply a scale to your DAQmx channel so you already get scaled values from DAQmxRead.
  • There should be NO additional wait inside the loop when you set a sample clock for your AI task! And the sample rate should be in a sensful range when you (need to) use the "1 sample" mode for DAQmxRead. The AO task doesn't need a sample clock setting, you could use it in "on demand" mode…
  • The current setpoint control should be placed inside the loop when you want to change it while the loop iterates…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 21
(605 Views)

Hello GerdW,

I would like to generate both AC current and DC current, I think this this program can only be used for controlling DC current as the setpoint is a DBL value. For generating an AC signal, is it possible to give a sine wave (from signal processing pallet) with a customizable inputs as the setpoint to the PID controller?

0 Kudos
Message 16 of 21
(574 Views)

Software implemented PID controllers are not be fast enough to generate a clean AC current waveform.

You just have a lot of latency causing inefficient PID loop to settle fast enough within the period of the waveform.

 

You're at a the stage to find the right instrument for the job instead of spending so many engineering hours and at the end find out it is not possible.

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 17 of 21
(561 Views)

PID.png

0 Kudos
Message 18 of 21
(554 Views)

Hi gok,

 

did you read the LabVIEW help for your PID function?

Do you (REALLY) know what happens when you wire an array of setpoints to this function?

 

RTFM!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 21
(537 Views)

Have you identified the power amplifier?

 

You can move the feedback control loop to the analog circuit and keep LabVIEW code simple to just source the voltage equivalent of the current if you adopt circuits as listed below,

https://www.ti.com/lit/an/sboa325/sboa325.pdf

https://www.ti.com/lit/an/sboa327a/sboa327a.pdf

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 20 of 21
(513 Views)