01-21-2016 06:56 AM
Hi, I'm not so good in Engllish, but i'll try to explain my problem.
I'm trying to apply a PID control in a motor through the measured temperature in a thermistor (I am using the Steinhart-hart equation). But, I have problems to use de LUT, because the value of its output is always the same, ie equal to the input 1.
I'm send a print of my block diagram.
Thank you,
Silvane
01-21-2016 07:39 AM - edited 01-21-2016 07:42 AM
Hello Silvane,
The first thing you can do is to validate that the "Lookup Table" returns the desired value. You can do this with a simple FPGA VI that you execute in simulation mode. Put a control and a indicator and change the input and see if you get different output.
Also, one problem in your code is that any value that less then zero prior the "U16" will produce a "0" for the input of the "Lookup table".
Michel
01-22-2016 05:29 AM
Hello Michel, thank you for the tips.
I did what you said, I tested one VI with just "Lookup Table" containing the "ln" function and it worked as desired.
Also removed the data type U16, but my program still does not work.
Could you take a look?
I can send my program by email if easier.
Silvane
01-22-2016 07:14 AM
Hello,
You can zip your program and put it on the forum.
Another thing you can try is to remove the input and replace them by control or constant and validate that the output is valid.
Michel
01-25-2016 04:23 AM
Hello Michel,
Here is my program.
01-25-2016 01:04 PM
Hello,
1. Did you validated that you are getting proper values from the "ConnectorB/AI1" and "ConnectorB/AI0"?
2. Also, I see that you are trying to use a PID, but the output is not sent anywhere? Is there other code that is outputing this values to a physical output?
3. Your comment "Also removed the data type U16, but my program still does not work." You need to provide more information on what is not working, please elaborate.
Michel
01-28-2016 07:09 PM
Hi,
1. Yes, I validate this and I'm receiving the values correctly.
2. Yes, there is. In another VI (pwm rt), I'm sending the signal of "output" to a PWM port in the LabVIEW Real Time, because I didn't know how to apply a PWM signal in the LabVIEW FPGA. This PWM signal is sending to external circuit.
3. I say that because even removing the U16 element of input LUT, its output still comes out with a different amount than expected. The value is always zero.
Silvane
01-29-2016 07:43 AM
Hi,
The lookup table is alway returning 0 because the value you are feeding it is out of bound ( greater than 4096), look closely at the computation you are performing prior the lookup table. Remember that "ConnectorB/AI1" and "ConnectorB/AI0" are returning values between 0 and 65535. This for now is your major issue.
Another point to note is the fixed point data type that you feed into the PID VI, the types are different, one is <±32,16> and the setpoint is <±16,16>, I think this can be an issue. You should look into this.
As for PWM you can refer to the following FPGA VI, https://decibel.ni.com/content/docs/DOC-13855
Michel
02-02-2016 04:51 AM
Hi,
Thank you,
Silvane
02-02-2016 07:06 AM
Hello,
The link for the PWM on FPGA is the following, maybe you can adapt the code https://decibel.ni.com/content/docs/DOC-39250
What exactly are you reading on the two inputs?
Where did you get the values in the look-up table?
Please explain in details what you are trying to do.
You need to validate the data you are feeding you natural logarithm function, if it's something outside the 0-4096 range the look-up table will return 0.
Michel