RA Flexible Software Package Documentation  Release v5.2.0

 
Motor 120-Degree Driver Interface

Detailed Description

Interface for motor driver functions.

Summary

The MOTOR_120_DRIVER interface for setting the PWM modulation duty

Data Structures

struct  motor_120_driver_callback_args_t
 
struct  motor_120_driver_current_status_t
 
struct  motor_120_driver_cfg_t
 
struct  motor_120_driver_api_t
 
struct  motor_120_driver_instance_t
 

Typedefs

typedef void motor_120_driver_ctrl_t
 

Enumerations

enum  motor_120_driver_event_t
 
enum  motor_120_driver_flag_offset_calc_t
 
enum  motor_120_driver_phase_pattern_t
 

Data Structure Documentation

◆ motor_120_driver_callback_args_t

struct motor_120_driver_callback_args_t

Callback function parameter data

Data Fields
motor_120_driver_event_t event Event trigger.
void const * p_context Placeholder for user data.

◆ motor_120_driver_current_status_t

struct motor_120_driver_current_status_t

Current data get structure

Data Fields
float iu U phase current (A)
float iv V phase current (A)
float iw W phase current (A)
float vdc Main line voltage (V)
float vu U phase voltage (V)
float vv V phase voltage (V)
float vw W phase voltage (V)

◆ motor_120_driver_cfg_t

struct motor_120_driver_cfg_t

Configuration parameters.

Data Fields

void(* p_callback )(motor_120_driver_callback_args_t *p_args)
 Callback function.
 
void const * p_context
 Placeholder for user data.
 
void const * p_extend
 Placeholder for user extension.
 

◆ motor_120_driver_api_t

struct motor_120_driver_api_t

Functions implemented at the HAL layer will follow these APIs.

Data Fields

fsp_err_t(* open )(motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(motor_120_driver_ctrl_t *const p_ctrl)
 
fsp_err_t(* run )(motor_120_driver_ctrl_t *const p_ctrl)
 
fsp_err_t(* stop )(motor_120_driver_ctrl_t *const p_ctrl)
 
fsp_err_t(* reset )(motor_120_driver_ctrl_t *const p_ctrl)
 
fsp_err_t(* phaseVoltageSet )(motor_120_driver_ctrl_t *const p_ctrl, float const u_voltage, float const v_voltage, float const w_voltage)
 
fsp_err_t(* phasePatternSet )(motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_phase_pattern_t const pattern)
 
fsp_err_t(* currentGet )(motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_current_status_t *const p_current_status)
 
fsp_err_t(* currentOffsetCalc )(motor_120_driver_ctrl_t *const p_ctrl)
 
fsp_err_t(* flagCurrentOffsetGet )(motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_flag_offset_calc_t *const p_flag_offset)
 
fsp_err_t(* parameterUpdate )(motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_cfg_t const *const p_cfg)
 

Field Documentation

◆ open

fsp_err_t(* motor_120_driver_api_t::open) (motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_cfg_t const *const p_cfg)

Initialize the motor 120 driver module.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to configuration structure.

◆ close

fsp_err_t(* motor_120_driver_api_t::close) (motor_120_driver_ctrl_t *const p_ctrl)

Close the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.

◆ run

fsp_err_t(* motor_120_driver_api_t::run) (motor_120_driver_ctrl_t *const p_ctrl)

Run the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.

◆ stop

fsp_err_t(* motor_120_driver_api_t::stop) (motor_120_driver_ctrl_t *const p_ctrl)

Stop the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.

◆ reset

fsp_err_t(* motor_120_driver_api_t::reset) (motor_120_driver_ctrl_t *const p_ctrl)

Reset variables of the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.

◆ phaseVoltageSet

fsp_err_t(* motor_120_driver_api_t::phaseVoltageSet) (motor_120_driver_ctrl_t *const p_ctrl, float const u_voltage, float const v_voltage, float const w_voltage)

Set (Input) phase voltage data into the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.
[in]u_voltageU phase voltage [V]
[in]v_voltageV phase voltage [V]
[in]w_voltageW phase voltage [V]

◆ phasePatternSet

fsp_err_t(* motor_120_driver_api_t::phasePatternSet) (motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_phase_pattern_t const pattern)

Set phase voltage pattern the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.
[in]patternVoltage pattern

◆ currentGet

fsp_err_t(* motor_120_driver_api_t::currentGet) (motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_current_status_t *const p_current_status)

Get phase current, Vdc and Va_max data from the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.
[out]p_current_statusPointer to get data structure.

◆ currentOffsetCalc

fsp_err_t(* motor_120_driver_api_t::currentOffsetCalc) (motor_120_driver_ctrl_t *const p_ctrl)

current offset detection from the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.

◆ flagCurrentOffsetGet

fsp_err_t(* motor_120_driver_api_t::flagCurrentOffsetGet) (motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_flag_offset_calc_t *const p_flag_offset)

Get the flag of finish current offset detection from the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.
[out]p_flag_offsetFlag of finish current offset detection

◆ parameterUpdate

fsp_err_t(* motor_120_driver_api_t::parameterUpdate) (motor_120_driver_ctrl_t *const p_ctrl, motor_120_driver_cfg_t const *const p_cfg)

Update configuration parameters for the calculation in the motor 120 driver module

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to configuration structure include update parameters.

◆ motor_120_driver_instance_t

struct motor_120_driver_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
motor_120_driver_ctrl_t * p_ctrl Pointer to the control structure for this instance.
motor_120_driver_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
motor_120_driver_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ motor_120_driver_ctrl_t

Control block. Allocate an instance specific control block to pass into the API calls.

Enumeration Type Documentation

◆ motor_120_driver_event_t

Events that can trigger a callback function

Enumerator
MOTOR_120_DRIVER_EVENT_FORWARD 

Event before motor 120 driver process (before current control timing)

MOTOR_120_DRIVER_EVENT_120_CONTROL 

Event 120 detection.

MOTOR_120_DRIVER_EVENT_BACKWARD 

Event after motor 120 driver process (after PWM duty setting)

◆ motor_120_driver_flag_offset_calc_t

The flag represents that the offset measurement is finished

Enumerator
MOTOR_120_DRIVER_FLAG_OFFSET_CALC_CLEAR 

Offset calculation not finished.

MOTOR_120_DRIVER_FLAG_OFFSET_CALC_OFF_FINISH 

Off voltage offset calculation finished.

MOTOR_120_DRIVER_FLAG_OFFSET_CALC_ALL_FINISH 

All offset calculation finished.

◆ motor_120_driver_phase_pattern_t

Phase voltage pattern

Enumerator
MOTOR_120_DRIVER_PHASE_PATTERN_ERROR 

Phase voltage pattern error.

MOTOR_120_DRIVER_PHASE_PATTERN_UP_PWM_VN_ON 

Up(PWM) to Vn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_UP_PWM_WN_ON 

Up(PWM) to Wn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_VP_PWM_UN_ON 

Vp(PWM) to Un(on)

MOTOR_120_DRIVER_PHASE_PATTERN_VP_PWM_WN_ON 

Vp(PWM) to Wn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_WP_PWM_UN_ON 

Wp(PWM) to Un(on)

MOTOR_120_DRIVER_PHASE_PATTERN_WP_PWM_VN_ON 

Wp(PWM) to Vn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_UP_ON_VN_PWM 

Up(on) to Vn(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_UP_ON_WN_PWM 

Up(on) to Wn(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_VP_ON_UN_PWM 

Vp(on) to Un(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_VP_ON_WN_PWM 

Vp(on) to Wn(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_WP_ON_UN_PWM 

Wp(on) to Un(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_WP_ON_VN_PWM 

Wp(on) to Vn(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_U_PWM_VN_ON 

U(PWM) to Vn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_U_PWM_WN_ON 

U(PWM) to Wn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_V_PWM_UN_ON 

V(PWM) to Un(on)

MOTOR_120_DRIVER_PHASE_PATTERN_V_PWM_WN_ON 

V(PWM) to Wn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_W_PWM_UN_ON 

W(PWM) to Un(on)

MOTOR_120_DRIVER_PHASE_PATTERN_W_PWM_VN_ON 

W(PWM) to Vn(on)

MOTOR_120_DRIVER_PHASE_PATTERN_UP_ON_V_PWM 

Up(on) to V(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_UP_ON_W_PWM 

Up(on) to W(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_VP_ON_U_PWM 

Vp(on) to U(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_VP_ON_W_PWM 

Vp(on) to W(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_WP_ON_U_PWM 

Wp(on) to U(PWM)

MOTOR_120_DRIVER_PHASE_PATTERN_WP_ON_V_PWM 

Wp(on) to V(PWM)