03-11-2009 02:18 AM
Hi,
can someone please explain to me "PWM Duty Cycle (ticks)"? In the third loop, this variable is a local variable. But in the 2nd loop, it is just a control. According to the screenshot attached, does it mean that value is passed from the PWM Duty Cycle (ticks) control to the local variable (meaning pass from 2nd loop to third loop)?
Theoretically, data should be passed from third to 2nd loop, is this right? Thanks in advance..
03-11-2009 03:21 AM
03-11-2009 03:22 AM
03-11-2009 03:31 AM
Hai,
There are two possibilities here to pass a value to the control.
1. When the local variable of the 'PWM duty cycle' gets a value the same value will get updated in the control.
2. The value to the control can be passed from RT to the FPGA 'PWM duty cycle' control directly.
In any of the ways the control gets updated but the control will hold the value that was updated latest!
Hope this helps.
03-11-2009 03:49 AM
Thank you both of you here, your explanations help. 😃
03-11-2009 10:30 AM
I modified my program from this example, but somehow, the host still doesn't work. I've spent time figuring out where has gone wrong but stil...Can anyone please help me take a look and spot if anything is wrong? This is on the implementation of PID velocity controller on fpga.
Here are some descriptions:
1) When run fpga vi, the position and counts read by encoder work ok. But when i run the host, the position always read zero. It seems that the data cannot be passed from the fpga to the host, thus at host, position is always zero value. The data passed from fpga is in counts, which is non-decimal number.
2) Shared variables are to pass values between loops, actually i can need not use them if i put them in the same loop in host?Are tehy in the right place in project explorer?
03-11-2009 10:37 AM
03-13-2009 12:50 AM
03-13-2009 01:09 AM
03-16-2009 05:38 AM
Hi,
Thanks...
Encoder part of FPGA VI can run by itself. meaning when i manual turn it, number jumps. When i run by host, count number didn't jump when I manually move it.
Then I remove the last loop of FPGA VI (as I cannot remove 2nd and last loop as i need the pid clock), and run the host and manually shifted the encoder, no count jumps reflect on the host.
Any oother ways to test?