Logo
NGFC_Inverter_Demo

Demo program for Inverter IP Core.

The Usage() function shows how to execute the test program, options available and default values set for different configuration variables. The Variables section specifies variables used in the test program, what they specify, the values it holds and can take. The main() function specifies sequence of api calls executed and tested.

Functions

void InverterUsage ()
 
int main (int argc, char *argv[])
 

Variables

uint enable =1
 enable mode bit for the Inverter IP Core. Toggling the enable signal will cause the registers to revert to default power-on states. It takes values 0 or 1 and defaults to 1
 
uint activate =0
 output enable for the Inverter IP Core. Enable this after configuring the registers associated with api calls starting with C. It takes values 0 or 1 and defaults to 0
 
fpgawb_ipcore_inverter_analog_select_config_t analog_select_config
 fpgawb_ipcore_inverter_analog_select_config_t struct passed as argument for configure analog select api call. Check fpgawb_lib.h or api call documentation for more information
 
fpgawb_ipcore_inverter_matrix_config_t matrix_config
 fpgawb_ipcore_inverter_matrix_config_t struct passed as argument for configure ram matrix api call. Check fpgawb_lib.h or api call documentation for more information
 
double input_voltage =100
 Input voltage for the Inverter IP Core. Defaults to 100 volts.
 
uint analog0_select =11
 This selects which of the internal currents or voltages will be applied to Va output.
 
uint analog1_select =12
 This selects which of the internal currents or voltages will be applied to Vb output.
 
uint analog2_select =13
 This selects which of the internal currents or voltages will be applied to Vc output.
 
uint bit_shift0 =1
 This will multiply the Va output by 2^bit0_select. This allows the user to better utilize the 16 bit ADC outputs. Defaults to 1.
 
uint bit_shift1 =1
 This will multiply the Vb output by 2^bit1_select. This allows the user to better utilize the 16 bit ADC outputs. Defaults to 1.
 
uint bit_shift2 =1
 This will multiply the Vc output by 2^bit2_select. This allows the user to better utilize the 16 bit ADC outputs. Defaults to 1.
 
double num_states =6
 This represents the number of IGBT switches in the Inverter (currently set to 6).
 
double h =4/16.8e6
 This is proportional to 1/fs i.e 1 over the sampling frequency where fs = 7.69MHz.
 
double disc_mode =3
 This is the mode used in the Ordinary Differential Equation Solver (Use mode 3 which uses a 2nd order Gear ODE).
 
double r1 =5e-3
 This is the resistance of the wire between the battery and A IGBT switch. Defaults to 5e-3.
 
double r2 =5e-3
 This is the resistance of the wire between A IGBT switch and B IGBT switch. Defaults to 5e-3.
 
double r3 =5e-3
 This is the resistance of the wire between B IGBT switch and C IGBT switch. Defaults to 5e-3.
 
double Gout =0.033
 This represents an approximation of the admittance for the Inverter’s load. Defaults to 0.033.
 
double L1 =100e-9
 This is the inductance of the wire between the battery and A IGBT switch. Defaults to 100e-9.
 
double L2 =100e-9
 This is the inductance of the wire between A IGBT switch and B IGBT switch. Defaults to 100e-9.
 
double L3 =100e-9
 This is the inductance of the wire between B IGBT switch and C IGBT switch. Defaults to 100e-9.
 
double Lout =1e-3
 This represents an approximation of the inductance for the inverter’s load. Defaults to 1e-3.
 
double Cap =20e-9
 This represents the capacitance for the IGBT switches. Defaults to 20e-9.
 
double g_on =100
 This represents the admittance for the IGBT switch in the on state. Defaults to 100 volts.
 
double g_off =1e-4
 This represents the admittance for the IGBT switch in the off state. Defaults to 1e-4.
 
uint config_mode =0
 Configuration mode for the test program. Indicates to run the program in configure mode or dynamic mode. It takes values 0-Configuring ram matrix/1-Changing input voltage, analog select and bit shift on the fly. It defaults to 0.
 

Function Documentation

void InverterUsage ( )

Usage:
./fpgawb_ipcore_inverter [-a0 Analog0Select] [-a1 Analog1Select] [-a2 Analog2Select] [-A Activate] [-b Board] [-b0 BitShift0 ] [-b1 BitShift1 ] [-b2 BitShift2] [-Cap Capacitance] [-C Config Mode] [-d DiscMode] [-e Enable] [-Gon] [-Goff] [-Gout] [-h ] [-L1 Inductance] [-L2 Inductance] [-L3 Inductance] [-Lout Inductance] [-n NumStates] [-R1 Resistance] [-R2 Resistance] [-R3 Resistance] [-v InputVoltage]

Options Default value
-a0 Analog0 Select - This selects which of the internal currents or voltages will be applied to Va output 11
-a1 Analog1 Select - This selects which of the internal currents or voltages will be applied to Vb output 12
-a2 Analog2 Select - This selects which of the internal currents or voltages will be applied to Vc output 13
-A Activate (0/1) 0
-b Board Number 0
-b0 Bit Shift 0 - This will multiply the Va output by 2^bit0_select. This allows the user to better utilize the 16 bit ADC outputs 1
-b1 Bit Shift 1 - This will multiply the Vb output by 2^bit1_select. This allows the user to better utilize the 16 bit ADC outputs 1
-b2 Bit Shift 2 - This will multiply the Vc output by 2^bit2_select. This allows the user to better utilize the 16 bit ADC outputs 1
-Cap Capacitance for the IGBT switches 20e-9
-C Config Mode (0-Configuring ram matrix/1-Changing input voltage, analog select and bit shift on the fly) 0
-d Disc Mode - This is the mode used in the Ordinary Differential Equation Solver (Use mode 3 which uses a 2nd order Gear ODE) 3
-e Enable (0/1) 1
-Gon 100
-Goff 1e-4
-Gout 0.033
-h 4/16.8e6
-L1 Inductance 100e-9
-L2 Inductance 100e-9
-L3 Inductance 100e-9
-Lout Inductance 1e-3
-n Number Of States 6
-R1 Resistance 5e-3
-R2 Resistance 5e-3
-R3 Resistance 5e-3
-v Input Voltage in volts 100


Examples:
./fpgawb_ipcore_inverter
./fpgawb_ipcore_inverter -C 1 -v 20
./fpgawb_ipcore_inverter -C 1 -b 0 -v 50 -a0 10 -b0 1

int main ( int  argc,
char *  argv[] 
)

Step 1: OPEN DEVICE
ccrtNGFC_Open(&handle,board_no,oflags)
Before using any API calls, the user needs to open the device and get a handle. This handle is then used as the first argument in most of the following APIs.

Step 2: GET DRIVER INFO
ccrtNGFC_Get_Driver_Info(handle, &binfo)
This call returns useful driver information and saves in the ccrtngfc_driver_info_t structure for later use.

Step 3: GET LIBRARY INFO
ccrtNGFC_Get_Library_Info(handle, &linfo)
This call returns useful library information and saves in the ccrtngfc_library_info_t structure for later use.

Step 4: ACTIVATE INVERTER
fpgawb_Inverter_Activate(handle,enable,activate)
This call activates the Inverter IP Core. Note to set activate to 0 because we will be using the Config api calls which requires activate be 0. The default for activate is 0 in this test program. It is set to 1 at the end.

Step 5: CONFIGURE RAM MATRIX
C_fpgawb_Inverter_Configure_Matrix(handle,&matrix_config)
This call configures parameters to calculate and program RAM Matrix table for the Inverter IP Core.

Step 6: ACTIVATE INVERTER
fpgawb_Inverter_Activate(handle,enable,activate)
This call activates the Inverter IP Core. Note to set the activate to 1 to start running the Inverter IP Core.

Step 7: CONFIGURE ANALOG SELECT
fpgawb_Inverter_Configure_Analog_Select(handle,&analog_select_config)
This call configures analog0_Select, analog1_select, analog2_select and analog_out_shift for the Inverter IP Core.

Step 8: SET INPUT VOLTAGE
fpgawb_Inverter_Set_Input_Voltage(handle,input_voltage)
This call configures input voltage for the Inverter IP Core.

Step 9: CLOSE DEVICE
ccrtNGFC_Close(handle)
Closes the device with the handle