Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-dev-f303 FastPWM3
structs.h
00001 #ifndef STRUCTS_H 00002 #define STRUCTS_H 00003 00004 //#include "CANnucleo.h" 00005 #include "mbed.h" 00006 #include "FastPWM.h" 00007 00008 00009 typedef struct{ 00010 DigitalOut *enable; 00011 DigitalOut *led; 00012 FastPWM *pwm_u, *pwm_v, *pwm_w; 00013 } GPIOStruct; 00014 00015 typedef struct{ 00016 00017 }COMStruct; 00018 00019 typedef struct{ 00020 int adc1_raw, adc2_raw, adc3_raw; 00021 float i_a, i_b, i_c; 00022 float v_bus; 00023 float theta_mech, theta_elec; 00024 float dtheta_mech, dtheta_elec, dtheta_elec_filt; 00025 float i_d, i_q, i_q_filt; 00026 float v_d, v_q; 00027 float dtc_u, dtc_v, dtc_w; 00028 float v_u, v_v, v_w; 00029 float d_int, q_int; 00030 int adc1_offset, adc2_offset; 00031 volatile float i_d_ref, i_q_ref; 00032 int loop_count; 00033 int timeout; 00034 int mode; 00035 int ovp_flag; 00036 float p_des, v_des, kp, kd, t_ff; 00037 float cogging[128]; 00038 } ControllerStruct; 00039 00040 typedef struct{ 00041 float theta_m, theta_est; 00042 float thetadot_m, thetadot_est; 00043 float i_d_m, i_d_est; 00044 float i_q_m, i_q_est; 00045 float i_d_dot, i_q_dot; 00046 float e_d, e_q; 00047 float e_d_int, e_q_int; 00048 } ObserverStruct; 00049 00050 typedef union{ 00051 struct{ 00052 int init_flag1; 00053 int init_flag2; 00054 float I_a; 00055 float I_b; 00056 float I_c; 00057 float I_q; 00058 float I_d; 00059 float Angle_mech; 00060 float Angle_elec; 00061 float Control_tff; 00062 float Control_kp; 00063 float Control_p; 00064 float Control_kd; 00065 float Control_v; 00066 float check_num; 00067 } info; 00068 char decode[60]; 00069 } DataPackage; 00070 00071 #endif
Generated on Wed Jul 13 2022 15:44:18 by
1.7.2