LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup Table 1D in LabVIEW FPGA

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

0 Kudos
Message 1 of 10
(5,392 Views)

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

Message 2 of 10
(5,374 Views)

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

Download All
0 Kudos
Message 3 of 10
(5,320 Views)

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

0 Kudos
Message 4 of 10
(5,296 Views)

Hello Michel,

Here is my program.

0 Kudos
Message 5 of 10
(5,245 Views)

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

 

0 Kudos
Message 6 of 10
(5,220 Views)

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

0 Kudos
Message 7 of 10
(5,171 Views)

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

0 Kudos
Message 8 of 10
(5,146 Views)

Hi,

 
 I think the link you sent is wrong because it is targeting for this forum here.
 
I'll try to fix the problem in the at the entrance of PID, thank you.
 
I tried to manipulate in various ways as my entry for the "ln" function has to be this high value, but have not found a logic that would work. Any suggestions I can try?

 

Thank you,

Silvane

0 Kudos
Message 9 of 10
(5,087 Views)

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

0 Kudos
Message 10 of 10
(5,067 Views)