File syn_foc_encoder.h¶
FileList > motor > syn_foc_encoder.h
Go to the source code of this file
Sensored FOC Rotor Position & Speed Interface (Encoder / Hall / Absolute).
#include "../common/syn_defs.h"#include "../util/syn_qmath.h"#include <stdbool.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_FOCEncoder Sensored Encoder State. |
| struct | SYN_FOCEncoderConfig Sensored Encoder Configuration. |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_FOCEncoderType Sensored Feedback Type. |
Public Functions¶
| Type | Name |
|---|---|
| q16_t | syn_foc_encoder_get_elec_angle (const SYN_FOCEncoder * enc) Get current electrical angle in Q16 radians [0, 2*PI). |
| q16_t | syn_foc_encoder_get_elec_speed (const SYN_FOCEncoder * enc) Get current electrical speed in Q16 rad/s. |
| SYN_Status | syn_foc_encoder_init (SYN_FOCEncoder * enc, const SYN_FOCEncoderConfig * cfg) Initialize sensored encoder module. |
| void | syn_foc_encoder_update_absolute (SYN_FOCEncoder * enc, uint16_t raw_angle_14bit) Update position for Absolute Encoder. |
| void | syn_foc_encoder_update_hall (SYN_FOCEncoder * enc, bool hall_u, bool hall_v, bool hall_w) Update position for 3-Phase Digital Hall Sensors. |
| void | syn_foc_encoder_update_quadrature (SYN_FOCEncoder * enc, int32_t raw_count) Update position for ABZ Incremental Quadrature Encoder. |
Public Types Documentation¶
enum SYN_FOCEncoderType¶
Sensored Feedback Type.
enum SYN_FOCEncoderType {
SYN_FOC_ENCODER_QUADRATURE = 0,
SYN_FOC_ENCODER_HALL = 1,
SYN_FOC_ENCODER_ABSOLUTE = 2
};
Public Functions Documentation¶
function syn_foc_encoder_get_elec_angle¶
Get current electrical angle in Q16 radians [0, 2*PI).
Parameters:
encPointer to encoder instance.
Returns:
Current electrical angle in Q16 radians.
function syn_foc_encoder_get_elec_speed¶
Get current electrical speed in Q16 rad/s.
Parameters:
encPointer to encoder instance.
Returns:
Current electrical speed in Q16 rad/s.
function syn_foc_encoder_init¶
Initialize sensored encoder module.
Parameters:
encPointer to encoder instance.cfgPointer to encoder configuration.
Returns:
SYN_OK on success.
function syn_foc_encoder_update_absolute¶
Update position for Absolute Encoder.
Parameters:
encPointer to encoder instance.raw_angle_14bitRaw 14-bit absolute angle (0..16383).
function syn_foc_encoder_update_hall¶
Update position for 3-Phase Digital Hall Sensors.
Parameters:
encPointer to encoder instance.hall_uDigital pin U state (0 or 1).hall_vDigital pin V state (0 or 1).hall_wDigital pin W state (0 or 1).
function syn_foc_encoder_update_quadrature¶
Update position for ABZ Incremental Quadrature Encoder.
Parameters:
encPointer to encoder instance.raw_countCurrent timer counter register (QEI count).
The documentation for this class was generated from the following file src/syntropic/motor/syn_foc_encoder.h