RA Flexible Software Package Documentation
Release v5.5.0
|
|
Interface for motor 120 control functions.
The motor 120 control interface for speed calculation and setting, fixed cycle processing
Data Structures | |
struct | motor_120_control_callback_args_t |
struct | motor_120_control_motor_parameter_t |
struct | motor_120_control_cfg_t |
struct | motor_120_control_api_t |
struct | motor_120_control_instance_t |
Typedefs | |
typedef void | motor_120_control_ctrl_t |
struct motor_120_control_callback_args_t |
Callback function parameter data
Data Fields | ||
---|---|---|
motor_120_control_event_t | event | Event trigger. |
void const * | p_context | Placeholder for user data. |
struct motor_120_control_motor_parameter_t |
struct motor_120_control_cfg_t |
Configuration parameters.
Data Fields | |
motor_120_conduction_type_t | conduction_type |
0:First 60 degree PWM, 1:Complementary first 60 degree PWM | |
uint32_t | u4_timeout_cnt |
Undetected time. | |
float | f4_max_drive_v |
Max output voltage (V) | |
float | f4_min_drive_v |
Min output voltage (V) | |
uint32_t | u4_speed_pi_decimation |
Speed PI control decimation counter. | |
uint32_t | u4_free_run_timer_freq |
Speed calc free run timer frequency (MHz) | |
float | f4_speed_lpf_k |
Speed LPF parameter. | |
float | f4_limit_speed_change |
Speed ref change limit. | |
float | f4_pi_ctrl_kp |
PI control error. | |
float | f4_pi_ctrl_ki |
PI control buffer of integral term. | |
float | f4_pi_ctrl_ilimit |
PI control limit of integral term. | |
motor_120_control_motor_parameter_t | motor_param |
Motor parameter. | |
void(* | p_callback )(motor_120_control_callback_args_t *p_args) |
Callback function. | |
void const * | p_context |
Placeholder for user data. | |
void const * | p_extend |
Extended configurations. | |
struct motor_120_control_api_t |
Functions implemented at the HAL layer will follow these APIs.
fsp_err_t(* motor_120_control_api_t::open) (motor_120_control_ctrl_t *const p_ctrl, motor_120_control_cfg_t const *const p_cfg) |
Initialize the motor 120 control module.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to configuration structure. |
fsp_err_t(* motor_120_control_api_t::close) (motor_120_control_ctrl_t *const p_ctrl) |
Close the motor 120 control module
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* motor_120_control_api_t::run) (motor_120_control_ctrl_t *const p_ctrl) |
Run the motor 120 control module
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* motor_120_control_api_t::stop) (motor_120_control_ctrl_t *const p_ctrl) |
Stop the motor 120 control module
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* motor_120_control_api_t::reset) (motor_120_control_ctrl_t *const p_ctrl) |
Reset variables of the motor 120 control module
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* motor_120_control_api_t::speedSet) (motor_120_control_ctrl_t *const p_ctrl, float const speed_rpm) |
Set speed[rpm]
[in] | p_ctrl | Pointer to control structure. |
[out] | speed_rpm | Pointer to get speed data[rpm] |
fsp_err_t(* motor_120_control_api_t::speedGet) (motor_120_control_ctrl_t *const p_ctrl, float *const p_speed_rpm) |
Get speed.
[in] | p_ctrl | Pointer to control structure. |
[out] | p_speed_rpm | Pointer to get speed data[rpm] |
fsp_err_t(* motor_120_control_api_t::currentGet) (motor_120_control_ctrl_t *const p_ctrl, motor_120_driver_current_status_t *const p_current_status) |
Get phase current, Vdc and Va_max data.
[in] | p_ctrl | Pointer to control structure. |
[out] | p_current_status | Pointer to get data structure. |
fsp_err_t(* motor_120_control_api_t::waitStopFlagGet) (motor_120_control_ctrl_t *const p_ctrl, motor_120_control_wait_stop_flag_t *const p_flag) |
Get wait stop flag.
[in] | p_ctrl | Pointer to control structure. |
[out] | p_flag | Pointer to wait stop flag |
fsp_err_t(* motor_120_control_api_t::timeoutErrorFlagGet) (motor_120_control_ctrl_t *const p_ctrl, motor_120_control_timeout_error_flag_t *const p_timeout_error_flag) |
Get timerout error flag.
[in] | p_ctrl | Pointer to control structure. |
[out] | p_timeout_error_flag | Pointer to timeout error flag |
fsp_err_t(* motor_120_control_api_t::patternErrorFlagGet) (motor_120_control_ctrl_t *const p_ctrl, motor_120_control_pattern_error_flag_t *const p_pattern_error_flag) |
Get pattern error flag.
[in] | p_ctrl | Pointer to control structure. |
[out] | p_pattern_error_flag | Pointer to pattern error flag |
fsp_err_t(* motor_120_control_api_t::voltageRefGet) (motor_120_control_ctrl_t *const p_ctrl, motor_120_control_voltage_ref_t *const p_voltage_ref) |
Get voltage ref.
[in] | p_ctrl | Pointer to control structure. |
[out] | p_voltage_ref | Pointer to flag voltage ref |
fsp_err_t(* motor_120_control_api_t::parameterUpdate) (motor_120_control_ctrl_t *const p_ctrl, motor_120_control_cfg_t const *const p_cfg) |
Update configuration parameters for the calculation in the motor 120 control module
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to configuration structure include update parameters. |
struct motor_120_control_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
motor_120_control_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
motor_120_control_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
motor_120_control_api_t const * | p_api | Pointer to the API structure for this instance. |
typedef void motor_120_control_ctrl_t |
Control block. Allocate an instance specific control block to pass into the API calls.
Events that can trigger a callback function
Speed reference status
Voltage reference status