Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Current Loop FPGA Current to Integer Conversion

I am trying to design a PID controller for a DC motor using FPGA and Ni 9505.  Referring to the example "\LabVIEW 8.2\examples\CompactRIO\Module Specific\NI 9505\Current Loop\Current Loop - NI 9505 (RT).vi",   the current
 data in amps are divided by a factor 0.0062 in order to convert amps values to integers.   Can someone please tell me why this conversion is necessary?  Suppose that I need to send other parameters such as voltage and RPM to FPGA, do I need to do a similar conversion?  If so, where can I find the corresponding scaling factors?  Thanks
0 Kudos
Message 1 of 4
(5,696 Views)
Hello,

That is a good question and I will try to give you an explanation.
In the FPGA, constants of +/- 2000 are used to set the output limit of the PI loop.
The output is used as the duty cycle for the PWM generator. Since the PWM rate is 20kHz,
which corresponds to 2000 FPGA tick count at 40MHz. The PI loop should not output anything greater than 2000.

The Operating Instruction of the NI-9595 say that the output limitation is 12 A.
By consequence, the factor 0.0062 is the ration between 2000 and 12
(in fact 12.4 for a duty cycle range of 4% to 96%)

I hope this will help you.

Best regards
Nick_CH

Message 2 of 4
(5,652 Views)
Thanks.   Should I need to change this scaling factor if I use a power supply whose maximum current output is 6A ?
0 Kudos
Message 3 of 4
(5,632 Views)

Edwin:

This document explains where the conversion factor on the NI 9505 is derived from. Please let me know if you have further questions.

Thanks,

Rudi N.

0 Kudos
Message 4 of 4
(5,239 Views)