RA Flexible Software Package Documentation  Release v6.6.0

 
Motor Interface

Detailed Description

Interface for Motor Algorithm functions.

Summary

The Motor Algorithm provides Motor functionality.

Data Structures

struct  motor_algorithm_cfg_t
 
struct  motor_algorithm_api_t
 
struct  motor_algorithm_instance_t
 

Typedefs

typedef void motor_algorithm_ctrl_t
 

Enumerations

enum  motor_algorithm_event_t
 
enum  motor_algorithm_control_mode_t
 

Data Structure Documentation

◆ motor_algorithm_cfg_t

struct motor_algorithm_cfg_t

Motor algorithm configuration structure

Data Fields
motor_hal_driver_instance_t
const *
p_motor_hal_driver_instance Motor driver access module instance.
motor_sensor_instance_t const * p_motor_sensor_instance Motor angle sensor module instance (Slot 1)
motor_sensor_instance_t const * p_motor_sensor_instance2 Motor angle sensor module instance (Slot 2)
timer_instance_t const * p_timer_instance Timer instance for outer loop control.
void const * p_extend Pointer to extended configuration.

◆ motor_algorithm_api_t

struct motor_algorithm_api_t

Motor algorithm API structure

Data Fields

fsp_err_t(* open )(motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(motor_algorithm_ctrl_t *const p_ctrl)
 
fsp_err_t(* reset )(motor_algorithm_ctrl_t *const p_ctrl)
 
fsp_err_t(* run )(motor_algorithm_ctrl_t *const p_ctrl)
 
fsp_err_t(* stop )(motor_algorithm_ctrl_t *const p_ctrl)
 
fsp_err_t(* controlModeGet )(motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_control_mode_t *p_control_mode)
 
fsp_err_t(* controlModeSet )(motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_control_mode_t control_mode)
 
fsp_err_t(* statusGet )(motor_algorithm_ctrl_t *const p_ctrl, uint8_t *const p_status)
 
fsp_err_t(* parameterUpdate )(motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_cfg_t const *const p_cfg)
 
fsp_err_t(* errorGet )(motor_algorithm_ctrl_t *const p_ctrl, uint32_t *p_error_flags)
 

Field Documentation

◆ open

fsp_err_t(* motor_algorithm_api_t::open) (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_cfg_t const *const p_cfg)

Initialize the motor algorithm module.

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

◆ close

fsp_err_t(* motor_algorithm_api_t::close) (motor_algorithm_ctrl_t *const p_ctrl)

Close (Finish) the motor algorithm module.

Parameters
[in]p_ctrlPointer to control structure.

◆ reset

fsp_err_t(* motor_algorithm_api_t::reset) (motor_algorithm_ctrl_t *const p_ctrl)

Reset(Stop) the motor algorithm module.

Parameters
[in]p_ctrlPointer to control structure.

◆ run

fsp_err_t(* motor_algorithm_api_t::run) (motor_algorithm_ctrl_t *const p_ctrl)

Activate the motor algorithm.

Parameters
[in]p_ctrlPointer to control structure.

◆ stop

fsp_err_t(* motor_algorithm_api_t::stop) (motor_algorithm_ctrl_t *const p_ctrl)

Inactivate the motor algorithm.

Parameters
[in]p_ctrlPointer to instance structure.

◆ controlModeGet

fsp_err_t(* motor_algorithm_api_t::controlModeGet) (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_control_mode_t *p_control_mode)

Get control mode

Parameters
[in]p_ctrlPointer to instance structure.
[out]p_control_modePointer to control mode data across multiple modules.

◆ controlModeSet

fsp_err_t(* motor_algorithm_api_t::controlModeSet) (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_control_mode_t control_mode)

Set control mode

Parameters
[in]p_ctrlPointer to instance structure.
[in]control_modeControl mode value across multiple modules.

◆ statusGet

fsp_err_t(* motor_algorithm_api_t::statusGet) (motor_algorithm_ctrl_t *const p_ctrl, uint8_t *const p_status)

Get status

Parameters
[in]p_ctrlPointer to instance structure.

◆ parameterUpdate

fsp_err_t(* motor_algorithm_api_t::parameterUpdate) (motor_algorithm_ctrl_t *const p_ctrl, motor_algorithm_cfg_t const *const p_cfg)

Set configuration.

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

◆ errorGet

fsp_err_t(* motor_algorithm_api_t::errorGet) (motor_algorithm_ctrl_t *const p_ctrl, uint32_t *p_error_flags)

Get error info.

Parameters
[in]p_ctrlPointer to instance structure.
[out]p_error_flagsPointer to error info.

◆ motor_algorithm_instance_t

struct motor_algorithm_instance_t

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

Data Fields
motor_algorithm_ctrl_t * p_ctrl Pointer to the control structure for this instance.
motor_algorithm_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
motor_algorithm_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ motor_algorithm_ctrl_t

typedef void motor_algorithm_ctrl_t

Control block for motor algorithm

Enumeration Type Documentation

◆ motor_algorithm_event_t

Events that can trigger a callback function

Enumerator
MOTOR_ALGORITHM_EVENT_INNER 

Event forward current control.

MOTOR_ALGORITHM_EVENT_OUTER 

Event set speed control output data.

MOTOR_ALGORITHM_EVENT_TRAJECTORY 

Event set speed control trajectory data.

MOTOR_ALGORITHM_EVENT_ERROR 

Event error detected.

◆ motor_algorithm_control_mode_t

Control mode for pm foc

Enumerator
MOTOR_ALGORITHM_CONTROL_MODE_NONE 

Not configured control mode.

MOTOR_ALGORITHM_CONTROL_MODE_SPEED 

Speed control mode.