Skip to content
Chapter 3 · Resolver Simulation

Real Time System

The software for the real time system controls the device according to the values it gets from network interface (Shared Network Variables).

Note: It is also possible to control the FPGA without using the real time system. The user may design his own application.

3.1Network interface (Shared Network Variables)

To control the simulation the real time system is communicating with the host application by using a technique called “Shared Network Variables”. These are containers of variables which can be accessed by a special network address. The containers are located in the RT folders (“RT_ResSi” or “RT_RVDT”):

  • ResSi_Variables.lvlib / RVDT_Variables.lvlib: Contains non channel related variables like FPGA version
  • ResSi_Variables_x.lvlib / RVDT_Variables_x.lvlib: Contains channel related variables where x represents the channel number (each channel will have its own file).

3.1.1Access a variable from host computer

To access a variable from a remote system, the developer can use the VI “RT_PC_ResSi_NetVarPathGen.vi” (“RT_PC_RVDT_NetVarPathGen.vi” respectively) located in “RT_ResSi/Share” (“RT_RVDT/Share” respectively) together with a “Read Variable” or “Write Variable” control.

PC example for reading the actual angle and for writing a new angle in RVDT simulator mode:

LabVIEW example reading the network variable Angle_Actual
Figure 19: Example for reading a network variable (PC)
LabVIEW example writing the network variable Angle
Figure 20: Example for writing a network variable (PC)
  • TargetIP: RIO ip address or hostname
  • Angle_Actual / Angle: Name of the desired variable in “RVDT_Variables_x.lvlib”
  • ChannelNb: Channel number -> x (if x = 255, access goes to “RVDT_Variables.lvlib”)

3.1.2Adding a new channel

Example for RVDT channel 1:

  1. If not done, add the new channel to the FPGA code (see FPGA – Adding a new channel)
  2. Create copy of “ResSi_Variables_0.lvlib” and rename to “ResSi_Variables_1.lvlib” (this step cannot be done in project explorer, instead use windows explorer)
  3. Update FPGA reference
    • Open “RT_RVDT/RT_RVDT_Thread.vi”
    • Right click on “RefnumIn” and select “Open Type Def.”
    • Right click on “Reference” and choose “Configure FPGA VI Reference…”
    • Click on “Import from bitfile…”, browse to the required bit file located in “FPGA Bitfiles” and open it
    • Save everything
  4. Update build specification and rebuild
    • Right click on “RIO-System/Build_Specification/RT_RVDT” -> Properties
    • Select “Source Files” on right side
    • Browse to “RT_RVDT/RVDT_Variables_1.lvlib” and add it to section “Always Included”
    • Rebuild and flash (“Run as startup”)

3.2Resolver simulation (RT_ResSi)

Not described in manual V3.0. See Resolver Mode Software (from manual V2.2).

3.3RVDT simulation (RT_RVDT)

This section describes the real time system for RVDT simulation mode.

3.3.1Control interface (RVDT_Variables)

Like told in section Network interface the RVDT simulation will be controlled by network shared variables. The following table describes them:

VariableTypeAccessDescriptionUnit
FPGA_Version (common)UInt32rHEX coded FPGA compilation date: Format: 0xYYYYMMDD
AngleDoubler/wSimulation angle in degree°
Angle_ActualDoublerCurrent simulation angle in degree°
Angle_DegreePerSecDoubler/wMoving speed to new angle position°/sec
Angle_MaxDoubler/wMaximum angle swing (absolute value): Angle where the difference output signal is at his maximum amplitude set up by “LUT_Amplitude” and PGA.°
LUT_AmplitudeDoubler/wMaximum amplitude of the differential output signal relative to the excitation signal amplitude multiplied with PGA (see “LUT_Write”).%
LUT_CalibrationCTL[1]r/wCalibration settings (see “LUT_Write”)
LUT_WriteBooleanr/wSet to update the lookup tables with new data calculated with the values in “LUT_Amplitude” and “LUT_Calibration”. True: Start update process (set by user). False: Update process finished (set by RT)
PGAUInt8r/wPGA setting (Range: 0…7): Û_OUT = 0.078125 * 2^PGA * Û_LUT
SaveConfigBooleanr/wSet to permanently save current configuration and angle setup in real time system flash memory (it will be loaded on every start up). True: Start saving process (set by user). False: Saving process finished (set by RT)

CTL[1] -> RT_PC_RVDT_LUT_Calibration.ctl

VariableTypeDescriptionUnit
SineAmplitude_%, CosineAmplitude_%DoubleAmplitude correction factors for lookup table (see “LUT_Amplitude”): Amplitude_LUT = "LUT_Amplitude" * x%
SineDCOffset_%, CosineDCOffset_%DoubleLUT DC offset correction amplitude relative to the excitation signal amplitude multiplied with PGA: Amplitude_LUT = "LUT_Amplitude" + x%

3.3.2RT_RVDT_Top.vi

Top vi of the real time system in RVDT simulation mode.

Flow chart of RT_RVDT_Top.vi: open FPGA, one RT_RVDT_Thread.vi per channel, status LED and firmware version
Figure 21: RT_RVDT_Top.vi - Flow Chart

3.3.3RT_RVDT_Thread.vi

This vi is responsible for controlling the FPGA. It is called cyclic (100ms) from top vi for each available channel on FPGA (parallel as multi thread).

Connector pane of RT_RVDT_Thread.vi

  • LUT_Size-1: Last index of the lookup tables (get it from FPGA)
  • ChannelNb: Channel number
  • ResSi_Values: Connect to FPGA “ResSi_Values” array element at index defined by “ChannelNb”
  • ResSi_Settings: Connect to FPGA “ResSi_Settings” array element at index defined by “ChannelNb”

3.3.4RT_RVDT_SaveCfg.vi & RT_RVDT_LoadCfg.vi

These are used for saving the current configuration to flash memory and for loading it again.

3.3.5RT_PC_RVDT_LUT_ValueWrite.vi

With this vi the update data for the lookup tables will be created. It takes the amplitude (LUT_Amplitude) and the calibration settings (LUT_Calibration) as input parameters and generates the lookup table data for both tables. The following diagram shows example data (LUT-Size = 1024; Max. Angle = +-30°; LUT_Amplitude = 100%):

Sine and cosine LUT example data over position 0 to 1023 and angle -30 to +30 degrees
Figure 22: RVDT LUT Example Data Diagram