![]() |
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.
|
miniFOC main source file, The relevant operations and main function after unpacking of medium capacity transmission protocol are implemented in this document. More...
#include "main.h"
Go to the source code of this file.
Functions | |
void | mdtp_callback_handler (unsigned char pid, const unsigned char *data) |
user callback function for unpacking completion of medium capacity transport protocol More... | |
int | main (void) |
main function More... | |
Variables | |
static volatile unsigned char | minifoc_fsm_state = 0 |
used to indicate the current status of miniFOC More... | |
miniFOC main source file, The relevant operations and main function after unpacking of medium capacity transmission protocol are implemented in this document.
Definition in file main.c.
int main | ( | void | ) |
main function
Definition at line 139 of file main.c.
References delayms(), encoder_zeroing(), filter_config(), flash_read_parameters(), flash_write_parameters(), foc_calibrate_phase(), led_config, led_toggle, minifoc_fsm_state, pid_config(), pid_control_mode_flag, pwm_config(), report_angle_speed(), report_local_variable(), spi_config(), systick_config(), timer13_config(), timer13_disable(), timer2_config(), timer2_disable(), TORQUE_LOOP_CONTROL, and uart_config().
void mdtp_callback_handler | ( | unsigned char | pid, |
const unsigned char * | data | ||
) |
user callback function for unpacking completion of medium capacity transport protocol
[in] | pid | medium capacity transport protocol package id |
[in] | data | received data array of size 8 bytes |
Definition at line 28 of file main.c.
References ANGLE_LOOP_CONTROL, angle_pid_handler, PID_Structure_t::expect, foc_parameter_available_flag, FOC_Struct, int32_to_float(), PID_Structure_t::kd, PID_Structure_t::ki, PID_Structure_t::kp, minifoc_fsm_state, pid_config(), pid_control_mode_flag, pid_parameter_available_flag, SPEED_LOOP_CONTROL, speed_pid_handler, PID_Structure_t::sum_maximum, TORQUE_LOOP_CONTROL, and FOC_Structure_t::user_expect.
Referenced by mdtp_receive_handler().
|
static |
used to indicate the current status of miniFOC
1 | calibrate motor phase and sensor offset 2 enable the motor 3 disable the motor 4 return current parameters |
Definition at line 21 of file main.c.
Referenced by main(), and mdtp_callback_handler().