Executable Usage - 2023.1 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.1 English
  • Work Directory(Step 1)

The steps for library download and environment setup can be found in l1_vitis_motorcontrol. For getting the design,

cd L1/tests/IP_FOC
  • Run and Build IP(Step 2)

Run the following make command to build your IP targeting a specific device. Please be noticed that this process will take a long time, maybe couple of minutes.

make run CSIM=1 CSYNTH=1 COSIM=1 XPART=xc7z010-clg400-1

Command will create IP*sim.project for simulation

make run VIVADO_SYN=1 VIVADO_IMPL=1 XPART=xc7z010-clg400-1

Command will create IP.project for export IP

Note: Default arguments are set in run_hls.tcl

  • Example output(Step 2)
SIM_FOC_M:********** Simulation parameters ************* Motor parameter ******************** Log files***************************************
SIM_FOC_M:  Timescale  :     10 (us)    |  motor.w     : 718.0615       (rad/s) |  Log of parameters : sim_torqueWithoutSpeed.para.foc
SIM_FOC_M:  Total step :   3000         |  motor.theta :  5.014019      (rad)   |  Log of FOC inputs : sim_torqueWithoutSpeed.in.foc
SIM_FOC_M:  Total time : 0.030000 (s)   |  motor.Id    : 0.334735       ( A )   |  Log of FOC outputs: sim_torqueWithoutSpeed.out.foc
SIM_FOC_M:  Inteval    :      3         |  motor.Iq    : 1.253668       ( A )
SIM_FOC_M:  FOC MODE   : MOD_TORQUE_WITHOUT_SPEED
SIM_FOC_M:  FOC CPR    :   1000         |  FOC PPR:      2
SIM_FOC_M:************ PID Final Status *********
SIM_FOC_M:  SPEED SP   : 10000.0        |  FLUX SP: 0.0000                      |  TORQUE SP: 4.8000            |  FW SP: --
SIM_FOC_M:  SPEED KP   : 2.7000         |  FLUX KP: 1.0000                      |  TORQUE KP: 5.0000            |  FW KP: --
SIM_FOC_M:  SPEED KI   : 0.0033         |  FLUX KI: 0.0000                      |  TORQUE KI: 0.0033            |  FW KI: --
SIM_FOC_M:  SPEED ERR  : 3144.000       |  FLUX ERR:  -0.332                    |  TORQUE ERR:  3.5469  |  FW ERR: --
SIM_FOC_M:  SPEED ACC  : 23853.000      |  FLUX ACC: -862.297                   |  TORQUE ACC: 9952.8320        |  FW ACC: --
SIM_FOC_M:************************************************************************************************************************************
...

Note: The current test is a hybrid test of the 8 modes run serially. Each mode’s simulation parameter and Motor parameter is shown up. For example:

  • title of “simulation parameters” shows the setting for simulation. The first 3000 test steps use MOD_SPEED_WITH_TORQUE, Speed setpoint is 10000, as we could check the “motor parameter” motor.w=1030.652 (rad/s) is near the setting rpm 10000. (RPM = motor.w * 60 / (2 * pi) ).
  • title of “log files” shows the log files generate for this 3000 steps. They will be used as input and golden files for the file flow test, which better simulate the actual running. Then still apply MOD_SPEED_WITH_TORQUE for the next 3000 steps, Speed setpoint is -16000. That will run to another direction.

Now we firstly run Model Based Sim to get the input and output of FOC with Motor module, and save them to files. This sim will restart the FOC ip for every input.

Then we run File Based Sim to simulate the actually status when FOC IP is running. Benchmark system is shown by Figure 1:

Figure 1 : Benchmark system of field-orientated control(FOC)

Benchmark system of FOC

Motor speed in 8 modes in simulation is shown by Figure 2:

Figure 2 : Motor speed in 8 modes in simulation

Motor speed in 8 modes in simulation

The Motor Model parameters by default simulation and Derived Motor Configuration is setting in the commen.hpp, and are shown by table 1 and table 2:

Table 1 : Motor Model parameters by default

Motor parameters

Table 2 : Derived Motor Configuration

Derived Motor Configuration
  • Important: Change the sine and cosine tables in the file foc.h accordingly when changing this CPR(COMM_MACRO_CPR) in the commen.hpp .

Static Parameter of FOC in simulation

Static Parameter of IP

AXI-lite Parameter of FOC setting in simulation