From: Thomas Hunting on
Hello.
 
I am trying to implement a PID controller in LV7.1, using a PWM instead of an anlaogue output.
I want to vary the duty cycle, on the +5V pulses.
I looked at the example shipped with LV7.1(PWM Counter Output), but I am stuggling to integrate it with my main vi.
 
Does anyone have a basic example of generating a PWM with a variable duty cycle?
 
Many Thanks.
 
Regards Tom
 
From: Kurt NI AE on
Hi,
The example that I have posted shows how to do Pulse Width Modulation using an analog output rather than using a counter. It uses one of the analog output channels and continually changes the duty cycle of the generated square wave.
I hope this helps!
Kurt


PWM_Analog_Output.llb:
http://forums.ni.com/attachments/ni/170/169799/1/PWM_Analog_Output.llb
From: Thomas Hunting on
Hi Kurt.
 
Thanks for the reply.
Unfortunately both of the analog output channels I have are tied up, so I have to use the counter.
 
Regards
Tom
From: Thomas Hunting on
Hello.
In the attached example, NI talk about snychronising tasks, and using "hardware timed single point" as the sample mode.
I want to continuously graph the same data that I am using as the controller reference, but the example will not work unless the sample mpde is HW timed single point. Anyone any ideas on how to overcome this dependency.
Thanks.
Regards
Tom


NI PWM Example.vi:
http://forums.ni.com/attachments/ni/170/170097/1/NI PWM Example.vi
From: Thomas Hunting on
Hello again.
I have been working on a way to overcome this problem. When both the PWM generation and the inputs are continuos, the physical control response from the card is extremely sluggish and unsatisfactory. Although when using HW timed single point the perforamnce is fine.
Can anyone help me on this?
Thanking you.
 
Regards
Tom