![]() |
RA Flexible Software Package Documentation
Release v6.4.0
|
|
Functions | |
| fsp_err_t | RM_MOTOR_PM_FOC_Open (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_cfg_t const *const p_cfg) |
| Opens and configures the Vector control module. Implements motor_driver_api_t::open. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_Close (motor_algorithm_ctrl_t *const p_ctrl) |
| Disables specified Motor Current Module. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_Reset (motor_algorithm_ctrl_t *const p_ctrl) |
| Disables specified Motor Current Module. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_Run (motor_algorithm_ctrl_t *const p_ctrl) |
| Active run motor. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_Stop (motor_algorithm_ctrl_t *const p_ctrl) |
| Motor Stop. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_ControlModeGet (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_control_mode_t *p_control_mode) |
| ControlModeGet. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_ControlModeSet (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_control_mode_t control_mode) |
| ControlModeSet. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_StatusGet (motor_algorithm_ctrl_t *const p_ctrl, uint8_t *const p_status) |
| StatusGet. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_ParameterUpdate (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_cfg_t const *const p_cfg) |
| Updates the parameters of the motor control module. More... | |
| fsp_err_t | RM_MOTOR_PM_FOC_ErrorGet (motor_algorithm_ctrl_t *const p_ctrl, uint32_t *p_error_flags) |
| ErrorGet. More... | |
| void | algorithm_disabled (void *p_ctrl, void *p_cfg) |
| Dummy function for disabled algorithms. More... | |
| void | motor_outer_fnctbl_spdobsrv_ctrl (void *p_ctrl, void *p_cfg) |
| Speed observer control function. More... | |
| void | motor_outer_fnctbl_spddirct_ctrl (void *p_ctrl, void *p_cfg) |
| Direct speed assignment control function. More... | |
| void | motor_outer_fnctbl_spdlpf_ctrl (void *p_ctrl, void *p_cfg) |
| Low-pass filter processing for speed. More... | |
| void | motor_outer_fnctbl_extobsrv_ctrl (void *p_ctrl, void *p_cfg) |
| Extended observer for disturbance torque and speed estimation. More... | |
| void | motor_outer_fnctbl_mtpa_ctrl (void *p_ctrl, void *p_cfg) |
| MTPA (Maximum Torque Per Ampere) control function. More... | |
| void | motor_outer_fnctbl_fw_ctrl (void *p_ctrl, void *p_cfg) |
| Flux weakening control function. More... | |
| void | motor_outer_speed_control (void *p_ctrl, void *p_cfg) |
| Calculates the d/q-axis current reference for speed control. More... | |
| void | motor_outer_position_control (void *p_ctrl, void *p_cfg) |
| Calculates the d/q-axis current reference for position control. More... | |
Motor PM FOC on RA MCUs. This module implements the Motor Interface.
The Motor PM FOC module provides Field Oriented Control (FOC) for Permanent Magnet (PM) motors. It implements inner loop (current control) and outer loop (speed control) algorithms for precise motor control.
FOC is a control technique that transforms the stator current into two orthogonal components: the direct (d-axis) and quadrature (q-axis) currents. This allows independent control of torque and flux, resulting in efficient and responsive motor control.
The Motor PM FOC module has the following key features:
| Configuration | Options | Default | Description |
|---|---|---|---|
| Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
| Configuration | Options | Default | Description |
|---|---|---|---|
| Inverter Parameters | |||
| PWM Carrier Period (Microseconds) | Must be a valid non-negative value | 50 | Inverter carrier period |
| Dead Time (Microseconds) | Must be a valid value | 2.0 | PWM dead time |
| Design Parameter | |||
| Current PI Loop Natural Frequency (Hz) | Must be a valid non-negative value | 300.0F | Current PI loop natural frequency |
| Current PI Loop Damping Ratio | Must be a valid non-negative value | 1.0F | Current PI loop dampin ratio |
| Speed PI Loop Natural Frequency (Hz) | Must be a valid non-negative value | 12.0F | Speed PI loop natural frequency |
| Speed PI Loop Damping Ratio | Must be a valid non-negative value | 1.0F | Speed PI loop damping ratio |
| Speed Observer Natural Frequency (Hz) | Must be a valid non-negative value | 200.0F | Speed observer loop natural frequency |
| Speed Observer Damping Ratio | Must be a valid non-negative value | 1.0F | Speed observer loop damping ratio |
| Speed LPF Natural Frequency (Hz) | Must be a valid non-negative value | 10.0F | Design natural frequency for speed Low Pass Filter. |
| Disturbance Speed Observer Natural Frequency (Hz) | Must be a valid non-negative value. | 100.0F | Natural frequency for disturbance speed observer. |
| Motor Sensor | |||
| Selected Slot For Control |
| MOTOR_INNER_SLOT_1_ENABLE | Select the sensor slot used for control. |
| General | |||
| Speed Control Period (sec) | Must be a valid non-negative value | 0.0005F | Period of speed control function. |
| Acceleration To Target Speed (rpm/sec) | Must be a valid non-negative value | 1000.0F | The rate of acceleration to reach the target motor speed. |
| Current PI Output Limit (V) | Must be a valid non-negative value | 24.0F | Current PI output limit |
| Limit Of Q-axis Current (A) | Must be a valid non-negative value | 0.42F | Limit of q-axis current. |
| Protection | |||
| Maximum Speed (rpm) | Must be a valid non-negative value. | 2650.0F | Controllable maximum speed |
| Limit Of Over Current (A) | Must be a valid value | 3.54F | Limit of over current.(Detection threshold, instantaneous value) |
| Limit Of Over Voltage (V) | Must be a valid value | 28.0F | Limit of over voltage for DC Bus.(Detection threshold) |
| Limit Of Over Speed (rpm) | Must be a valid value | 3000.0F | Limit of over speed.(Detection threshold) |
| Limit Of Low Voltage (V) | Must be a valid value | 14.0F | Limit of low voltage for DC Bus.(Detection threshold) |
| Sample Delay Compensation | |||
| Status |
| Enable | Select enable/disable sample delay compensation. |
| Period Magnification Value | Must be a valid value | 1.5 | Period magnification value for sampling delay compensation. |
| Voltage Error Compensation | |||
| Status |
| Enable | Select enable/disable voltage error compensation. |
| Reference Voltage (V) | Must be a valid value | 24.0F | Reference voltage for compensation table. |
| Table Of Voltage 1 (V) | Must be a valid value | 0.672F | Voltage error compensation table of voltage. |
| Table Of Voltage 2 (V) | Must be a valid value | 0.945F | Voltage error compensation table of voltage. |
| Table Of Voltage 3 (V) | Must be a valid value | 1.054F | Voltage error compensation table of voltage. |
| Table Of Voltage 4 (V) | Must be a valid value | 1.109F | Voltage error compensation table of voltage. |
| Table Of Voltage 5 (V) | Must be a valid value | 1.192F | Voltage error compensation table of voltage. |
| Table Of Current 1 (A) | Must be a valid value | 0.013F | Voltage error compensation table of current. |
| Table Of Current 2 (A) | Must be a valid value | 0.049F | Voltage error compensation table of current. |
| Table Of Current 3 (A) | Must be a valid value | 0.080F | Voltage error compensation table of current. |
| Table Of Current 4 (A) | Must be a valid value | 0.184F | Voltage error compensation table of current. |
| Table Of Current 5 (A) | Must be a valid value | 0.751F | Voltage error compensation table of current. |
| Motor Parameter | |||
| Pole Pairs | Must be a valid non-negative value. | 4 | Pole pairs |
| Resistance (ohm) | Must be a valid value | 1.3F | Resistance |
| Inductance Of D-axis (H) | Must be a valid value | 0.0013F | Inductance of d-axis |
| Inductance Of Q-axis (H) | Must be a valid value | 0.0013F | Inductance of q-axis |
| Permanent Magnetic Flux (Wb) | Must be a valid value | 0.01119F | Permanent magnetic flux |
| Motor Parameter > Rotor Inertia (kgm^2) | Must be a valid value | 0.000003666F | Rotor inertia |
| Rated Current (A) | Must be a valid value | 1.67F | Rated current |
| Extended Function | |||
| MTPA |
| module.middleware.motor_algorithm.-.mtpa.disabled | Select MTPA function. |
| Flux-Weakening |
| Enabled | Select Flux weakening function. |
| Speed Feedback Process |
| Direct | Select speed feedback process. |
| Interrupts | |||
| Callback | Name must be a valid C symbol | rm_motor_control_callback | A user callback function. If this callback function is provided, it is called from multiple internal events. |
| Name | Name must be a valid C symbol | g_motor0_pm_foc | Module name. |
The Motor PM FOC module uses timer peripherals for inner loop and outer loop control timing. Configure the timer instances according to your control period requirements:
This module does not use I/O pins directly. Pin configuration is handled by the motor driver module (motor_hal_driver_instance) and sensor module (motor_sensor_instance).
The Motor PM FOC module supports multiple control modes that can be set using RM_MOTOR_PM_FOC_ControlModeSet and retrieved using RM_MOTOR_PM_FOC_ControlModeGet. The control mode determines how the motor is driven:
The motor status can be retrieved using RM_MOTOR_PM_FOC_StatusGet. This provides information about the current operating state of the motor control system.
The Motor PM FOC module monitors for various error conditions:
When an error is detected, it can be retrieved using RM_MOTOR_PM_FOC_ErrorGet. After handling the error condition, use RM_MOTOR_PM_FOC_Reset to clear the error state and RM_MOTOR_PM_FOC_Run to restart motor operation.
Flux weakening allows the motor to operate above its base speed by reducing the magnetic flux. This is achieved by injecting negative d-axis current. The flux weakening feature can be enabled through the extended configuration.
Voltage error compensation improves control accuracy by compensating for non-linearities in the inverter, such as dead-time effects and device voltage drops. The compensation table can be configured in the extended configuration.
Developers should be aware of the following limitations when using the Motor PM FOC:
This is a basic example of minimal use of the Motor PM FOC in an application.
This example demonstrates status monitoring, control mode management, and error handling.
Data Structures | |
| struct | motor_pm_foc_inner_cfg_t |
| struct | motor_pm_foc_outer_cfg_t |
| struct | motor_inner_get_voltage_t |
| struct | motor_mode_inner_to_outer_t |
| struct | motor_pm_foc_outer_loop_func_table_t |
| struct | motor_outer_design_params_t |
| struct | motor_pm_foc_outer_instance_signals_ctrl_t |
| struct | motor_pm_foc_inner_instance_signals_ctrl_t |
| struct | motor_pm_foc_extended_data_cfg_t |
| struct | motor_pm_foc_instance_ctrl_t |
Macros | |
| #define | MOTOR_PM_FOC_SHARED_BUFFER_COUNT |
| Number of double-buffered shared data structures. | |
Typedefs | |
| typedef void() | OuterLoopFunction(void *p_ctrl, void *p_cfg) |
Enumerations | |
| enum | motor_error_pm_foc_t |
| enum | motor_inner_sample_delay_compensation_t |
| enum | motor_inner_sensor_selected_slot_t |
| enum | motor_outer_ctrl_status_t |
| struct motor_pm_foc_inner_cfg_t |
| struct motor_pm_foc_outer_cfg_t |
| struct motor_inner_get_voltage_t |
| struct motor_mode_inner_to_outer_t |
| struct motor_pm_foc_outer_loop_func_table_t |
Outerloop Function Pointer Table
| Data Fields | ||
|---|---|---|
| OuterLoopFunction * | control_mode_ctrl | Position/Speed control function pointer. |
| OuterLoopFunction * | mtpa_ctrl | MTPA (Maximum Torque Per Ampere) control function pointer. |
| OuterLoopFunction * | fw_ctrl | Fluxweak Control function pointer. |
| OuterLoopFunction * | spdobsv_ctrl | Speed Observer function pointer. |
| struct motor_outer_design_params_t |
Design parameter structure for outer control
| struct motor_pm_foc_outer_instance_signals_ctrl_t |
Motor outer control instance control block
| Data Fields | ||
|---|---|---|
| uint32_t | error_info | Error flags detected during outer loop execution. |
| uint8_t | active | Flag to set active/inactive the speed control. |
| float | i_q_ref_disturbance | Anti disturbance Q-axis current reference [A]. |
| float | speed_mech_que_ref | Command speed value for speed PI control[rad/s]. |
| float | speed_mech_ref | Speed reference value [rad/s]. |
| float | speed_mech_lpf | Low-pass filtered speed [rad/s]. |
| float | speed_mech | Mechanical Speed used by outer control loop [rad/s]. |
| float | angle_mech | Mechanical Angle Position used by outer control loop [rad]. |
| motor_flux_weakening_t | flux_weakening_ctrl | Flux-weakening control data. |
| motor_mode_inner_to_outer_t | inner_mode_data | control mode data from inner loop (request to overwrite references) |
| pi_ctrl_t | speed_pi_ctrl | Speed PI controller data. |
| motor_common_lpf_t | speed_lpf_ctrl | Speed low-pass filter data. |
| motor_spdobserver_t | speed_observer_ctrl | Speed observer data. |
| motor_extobserver_t | extobserver_ctrl | Disturbance torque/speed observer data. |
| struct motor_pm_foc_inner_instance_signals_ctrl_t |
Motor inner control instance control block
| Data Fields | ||
|---|---|---|
| uint32_t | error_info | Error flags detected during inner loop execution. |
| uint8_t | active | Flag to set active/inactive the current control. |
| motor_algorithm_control_mode_t | control_mode | Current control mode. |
| motor_shared_inner_to_position_speed_t | to_pos_speed | Data structure for sensor module (it includes iu, iv, iw) |
| float | v_dc | DC bus voltage [V]. |
| float | angle_el | Electrical rotor angle [radian]. |
| float | speed_el | Electrical rotor speed [radian/s]. |
| float | v_u_ref | U phase voltage reference [V]. |
| float | v_v_ref | V phase voltage reference [V]. |
| float | v_w_ref | W phase voltage reference [V]. |
| pi_ctrl_t | id_pi_ctrl | D-axis current PI controller. |
| pi_ctrl_t | iq_pi_ctrl | Q-axis current PI controller. |
| motor_volt_error_comp_t | vcomp_ctrl | Voltage error compensation data. |
| struct motor_pm_foc_extended_data_cfg_t |
Extended configurations for motor PM FOC control
| Data Fields | ||
|---|---|---|
| float | comp_v[MOTOR_VOLT_ERR_COMP_TABLE_ARRAY_SIZE] | Voltage error compensation table: voltage axis. |
| float | comp_i[MOTOR_VOLT_ERR_COMP_TABLE_ARRAY_SIZE] | Voltage error compensation table: current axis. |
| float | comp_vdc_ref | Voltage error compensation: DC bus reference voltage for table. |
| float | comp_limit_factor | Voltage error compensation: limit factor. |
| motor_volt_error_comp_select_t | vcomp_enable | Enable/disable voltage error compensation. |
| motor_inner_sample_delay_compensation_t | sample_delay_comp_enable | Enable/disable sample delay compensation. |
| motor_inner_sensor_selected_slot_t | sensor_slot | Selected sensor slot. |
| float | period_magnitude_value | Period magnification value for sampling delay compensation. |
| float | inner_control_period | Current control period [usec]. |
| float | current_limit | Current limit [A]. |
| float | outer_control_period | Speed control period [sec]. |
| float | speed_mech_change_limit | Maximum speed reference change rate [rad/s^2]. |
| float | speed_mech_cmd_limit | Maximum speed command value [rad/s]. |
| float | speed_lpf_omega_t | Speed LPF design value. |
| float | iq_limit | Limit of q-axis current [A]. |
| float | overcurrent_limit | Over-current detection limit [A]. |
| float | overvoltage_limit | Over-voltage detection limit [V]. |
| float | lowvoltage_limit | Low-voltage detection limit [V]. |
| float | overspeed_limit | Over-speed detection limit [rpm]. |
| struct motor_pm_foc_instance_ctrl_t |
PM FOC control instance control block
| Data Fields | ||
|---|---|---|
| uint32_t | open | Vector control open flag. |
| uint8_t | sensor_control_mode | Sensor control mode. |
| uint8_t | motor_status | Motor Status. |
| motor_pm_foc_inner_instance_ctrl_t * | p_inner_instance_ctrl | Pointer to inner control instance. |
| motor_pm_foc_outer_instance_ctrl_t * | p_outer_instance_ctrl | Pointer to outer control instance. |
| motor_algorithm_cfg_t const * | p_cfg | |
| typedef void() OuterLoopFunction(void *p_ctrl, void *p_cfg) |
Outer loop function pointer type definition
| enum motor_error_pm_foc_t |
Error information
| fsp_err_t RM_MOTOR_PM_FOC_Open | ( | motor_algorithm_ctrl_t *const | p_ctrl, |
| motor_algorithm_cfg_t const *const | p_cfg | ||
| ) |
Opens and configures the Vector control module. Implements motor_driver_api_t::open.
| FSP_SUCCESS | Motor Driver successfully configured. |
| FSP_ERR_ASSERTION | Null pointer, or one or more configuration options is invalid. |
| FSP_ERR_ALREADY_OPEN | Module is already open. This module can only be opened once. |
| fsp_err_t RM_MOTOR_PM_FOC_Close | ( | motor_algorithm_ctrl_t *const | p_ctrl | ) |
Disables specified Motor Current Module.
| FSP_SUCCESS | Successfully closed. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_Reset | ( | motor_algorithm_ctrl_t *const | p_ctrl | ) |
Disables specified Motor Current Module.
| FSP_SUCCESS | Successfully. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_Run | ( | motor_algorithm_ctrl_t *const | p_ctrl | ) |
Active run motor.
| FSP_SUCCESS | Successfully. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_Stop | ( | motor_algorithm_ctrl_t *const | p_ctrl | ) |
Motor Stop.
| FSP_SUCCESS | Successfully. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_ControlModeGet | ( | motor_algorithm_ctrl_t *const | p_ctrl, |
| motor_algorithm_control_mode_t * | p_control_mode | ||
| ) |
ControlModeGet.
| FSP_SUCCESS | Successfully. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_ControlModeSet | ( | motor_algorithm_ctrl_t *const | p_ctrl, |
| motor_algorithm_control_mode_t | control_mode | ||
| ) |
ControlModeSet.
| FSP_SUCCESS | Successfully. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_StatusGet | ( | motor_algorithm_ctrl_t *const | p_ctrl, |
| uint8_t *const | p_status | ||
| ) |
StatusGet.
| FSP_SUCCESS | Successfully. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_ParameterUpdate | ( | motor_algorithm_ctrl_t *const | p_ctrl, |
| motor_algorithm_cfg_t const *const | p_cfg | ||
| ) |
Updates the parameters of the motor control module.
This function overwrites the configuration pointer of the motor control instance and updates managed variables such as current limits in the inner instance. It does not modify any gain parameters directly, but ensures that the new configuration is applied to the instance.
| [in] | p_ctrl | Pointer to the motor algorithm control structure. |
| [in] | p_cfg | Pointer to the new motor algorithm configuration structure. |
| FSP_SUCCESS | Successfully updated parameters. |
| FSP_ERR_ASSERTION | Null pointer detected. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| fsp_err_t RM_MOTOR_PM_FOC_ErrorGet | ( | motor_algorithm_ctrl_t *const | p_ctrl, |
| uint32_t * | p_error_flags | ||
| ) |
ErrorGet.
| FSP_SUCCESS | Successfully. |
| FSP_ERR_ASSERTION | Null pointer. |
| FSP_ERR_NOT_OPEN | Module is not open. |
| void algorithm_disabled | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Dummy function for disabled algorithms.
This function is used as a placeholder in the function pointer table when a specific algorithm (e.g., MTPA, flux weakening, speed observer) is disabled in the configuration.
| [in] | p_ctrl | Pointer to control structure (unused) |
| [in] | p_cfg | Pointer to configuration structure (unused) |
| None | Dammy configured function |
| void motor_outer_fnctbl_spdobsrv_ctrl | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Speed observer control function.
This function applies the speed observer algorithm to estimate the mechanical speed based on q-axis current reference and measured speed. The estimated speed is stored in the low-pass filtered speed variable.
| [in,out] | p_ctrl | Pointer to motor outer control instance |
| [in] | p_cfg | Pointer to extended configuration |
| None | Speed Observer related for function pointer table |
| void motor_outer_fnctbl_spddirct_ctrl | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Direct speed assignment control function.
This function directly assigns the measured mechanical speed to the low-pass filtered speed variable without applying any filtering or observer algorithm.
| [in,out] | p_ctrl | Pointer to motor outer control instance |
| [in] | p_cfg | Pointer to extended configuration (unused) |
| None |
| void motor_outer_fnctbl_spdlpf_ctrl | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Low-pass filter processing for speed.
This function applies a first-order low-pass filter to the measured mechanical speed and updates the filtered speed value in the control instance.
| [in,out] | p_ctrl | Pointer to motor outer control instance |
| [in] | p_cfg | Pointer to extended configuration (unused) |
| None |
| void motor_outer_fnctbl_extobsrv_ctrl | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Extended observer for disturbance torque and speed estimation.
This function applies an extended observer to estimate mechanical speed excluding disturbance torque effects. It also generates a disturbance compensation current reference for torque ripple suppression.
| [in,out] | p_ctrl | Pointer to motor outer control instance |
| [in] | p_cfg | Pointer to extended configuration |
| None |
| void motor_outer_fnctbl_mtpa_ctrl | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
MTPA (Maximum Torque Per Ampere) control function.
This function applies the MTPA algorithm to optimize d- and q-axis current references for maximum torque efficiency. If flux weakening is active, it integrates flux weakening control with MTPA to select appropriate current commands. The function ensures that d-axis current reference remains non-positive for non-salient PMSM.
| [in,out] | p_ctrl | Pointer to motor outer control instance |
| [in] | p_cfg | Pointer to extended configuration |
| None | MTPA for function pointer table |
| void motor_outer_fnctbl_fw_ctrl | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Flux weakening control function.
This function applies flux weakening control to adjust d- and q-axis current references for high-speed motor operation, ensuring the voltage limit is not exceeded. The function overwrites the dq-axis current commands when flux weakening is enabled.
| [in,out] | p_ctrl | Pointer to motor outer control instance |
| [in] | p_cfg | Pointer to extended configuration |
| None | Fluxweak control for function pointer table |
| void motor_outer_speed_control | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Calculates the d/q-axis current reference for speed control.
Control mode function for function pointer table
This function performs the main process of outer control, including speed filtering, trajectory control, speed reference setting, and current reference calculation. It also applies MTPA and flux weakening control via function pointers.
| [in,out] | p_ctrl | Pointer to control structure |
| [in] | p_cfg | Pointer to configuration structure |
| None |
| void motor_outer_position_control | ( | void * | p_ctrl, |
| void * | p_cfg | ||
| ) |
Calculates the d/q-axis current reference for position control.
This function is reserved for future implementation of position control.
| [in,out] | p_ctrl | Pointer to control structure |
| [in] | p_cfg | Pointer to configuration structure |
| None |