miniFOC 1.0.3
This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.
encoder.h
Go to the documentation of this file.
1/**************************************************************************/
9#ifndef MINIFOC_ALGORITHM_ENCODER_H_
10#define MINIFOC_ALGORITHM_ENCODER_H_
11
12extern volatile unsigned short machine_angle_offset;
13void encoder_zeroing(void);
14unsigned short encoder_get_mechanical_angle(void);
16void encoder_update_speed(void);
17
18#endif //MINIFOC_ALGORITHM_ENCODER_H_
unsigned short encoder_get_mechanical_angle(void)
read mechanical angle directly from encoder
Definition: encoder.c:76
volatile unsigned short machine_angle_offset
mechanical angle offset, which is used to align the mechanical angle with the zero point of the elect...
Definition: encoder.c:23
void encoder_update_speed(void)
called every 2 milliseconds to calculate the speed.
Definition: encoder.c:106
float encoder_get_electronic_angle(void)
according to the electrical angle calculated from the mechanical angle, this function will call encod...
Definition: encoder.c:93
void encoder_zeroing(void)
correct the mechanical angle zero deviation between the magnetic encoder and FOC.
Definition: encoder.c:119