LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview PID

Connect the grounds together?
0 Kudos
Message 21 of 39
(1,972 Views)

Interesting:  there is also a glitch crossing +/- 6.4V (or so).

 

That hints that either the Analog to Digitical Converter (ADC) or the Digital to Analog Converter (DAC) in the 7833R has issues.  A graph sure would help figure out which it is.  The issue could be an anomoly in how it converts, in transferring MSB and LSB out of sync, or several possibilities.  Some configuration options might help, but it could take a lot of trial & error to find which.  Slowing the loop down may help, too, but less likely.

 

You could also generate a triangle wave in LV, and ignore the input.  That may help prove its the input or the output.

 

Or you could filter the input.  A simple shift register, expanded to 4-10 values, then averaging them all would do well.  That would round off the corners of the triangle wave, but wouldn't change the sine much (a little delayed).

___________________
CLD, CPI; User since rev 8.6.
0 Kudos
Message 22 of 39
(1,967 Views)

Hi Nathad,

Thank you for your response. I have done so but the glitches still persists. The grounds are connected together now but it did not solve the problem. Any further clues?

 

Kind Regards,

Opuk

0 Kudos
Message 23 of 39
(1,956 Views)

As ZX81 has mentioned several times, add a chart to your LabVIEW code, showing the analog input reading. That would help determine if the problem is on the input side (and the output is duplicating it faithfully), or if the problem is on the analog output.

0 Kudos
Message 24 of 39
(1,941 Views)

Hi ZX81,

Thanks for your response. The problem could be a 7833R issue. Since I am wiring the Analog input direclty in to the output  how then can I include a chart to monitor the input (am sorry am still not good in labview)? And you have also mentioned alot other things I can attempt. Let me try them out and will get back. Thank you.

 

Kind Regards,

Opuk 

0 Kudos
Message 25 of 39
(1,933 Views)

Hi Nathand,

Let me work on ZX81 suggestions and will give updates. Thank you so much.

 

Kind Regards,

Opuk

0 Kudos
Message 26 of 39
(1,948 Views)

@Opuk wrote:

...Since I am wiring the Analog input direclty in to the output  how then can I include a chart to monitor the input (am sorry am still not good in labview)?...


In that case, it doesn't apply.  With the PID, it would apply.

 

That graph looks surprisingly bad.  But it depends a lot on scale.  It only shows 100 samples, which may be a tiny fraction of the triangle wave.  If you right-click the X scale, and turn on auto-scaling, how does it look?  You can also right-click the chart, and change the 'Chart Length...' to include more or less of the triangle wave.  One full triangle (or so) would be great.

 

I can't tell from the .vi how quickly the while loops.  It can also be hard to tell from documentation, too.  It looks like the [AI0] node freezes until it has a new sample, so it may be tied to the configured sample rate or the fixed sample rate.  If you know the frequency from the function generator, and see an entire cycle, that could tell us the while loop-rate.  Or you could add an indicator to show the change in the millisecond timer or clock.  A millisecond delay could be used to force the loop-rate.

 

The loop-rate isn't all that important, but I'm curious.

 

The noise looks a little consistent, but that's also a common illusion.  It does look like averaging 4-10 consecutive inputs would clean it up a LOT.

 

 

___________________
CLD, CPI; User since rev 8.6.
0 Kudos
Message 27 of 39
(1,935 Views)

Hi ZX81,

Thanks for the response.

The frequency drom the function generator is 1 Khz with an amplitude of 2Vpp.

I also incorprated a microsecond delay  and attached is the signal generated, but I only see a straight line on oscilloscope.

In one of your suggestions yesterday you advised I should filter the input using a shift register, I have tried to implement an averaging 7 values but the glitches still persists (See the attachment).

Thank you.

 

Best Regards,

Opuk

 

0 Kudos
Message 28 of 39
(1,911 Views)

With the 1ms (or uSec; I can't tell) delay, the input looks beautiful.  Without (0 uSec delay), it looks like trash (with or without averaging).  That tells me the delay is very important.  I'm not sure why; the built in read function shouldn't do that...  By the way, the averaging implementation you did looks exactly like what I imagined.

 

Did you get a look at the output with the delay?  What you shared hints most of the noise should be gone, but the big glitch may still be there.

___________________
CLD, CPI; User since rev 8.6.
0 Kudos
Message 29 of 39
(1,884 Views)

Hi ZX81,

Thanks for the response. Actually the averaging did not solve the problem at all. The uSec delay makes the input beautful but the output on the oscilloscope is pathetic, its not even close to what I expected. Thank you.

 

Kind Regards,

Opuk

0 Kudos
Message 30 of 39
(1,861 Views)