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.
structs.h
- Committer:
- benkatz
- Date:
- 2017-11-08
- Revision:
- 34:51647c6c500d
- Parent:
- 28:8c7e29f719c5
- Child:
- 37:c0f352d6e8e3
File content as of revision 34:51647c6c500d:
#ifndef STRUCTS_H
#define STRUCTS_H
//#include "CANnucleo.h"
#include "mbed.h"
#include "FastPWM.h"
typedef struct{
DigitalOut *enable;
FastPWM *pwm_u, *pwm_v, *pwm_w;
} GPIOStruct;
typedef struct{
}COMStruct;
typedef struct{
int adc1_raw, adc2_raw;
float i_a, i_b, i_c;
float v_bus;
float theta_mech, theta_elec;
float dtheta_mech, dtheta_elec, dtheta_elec_filt;
float i_d, i_q, i_q_filt;
float v_d, v_q;
float dtc_u, dtc_v, dtc_w;
float v_u, v_v, v_w;
float d_int, q_int;
int adc1_offset, adc2_offset;
float i_d_ref, i_q_ref;
int loop_count;
int timeout;
int mode;
float p_des, v_des, kp, kd, t_ff;
float cogging[128];
} ControllerStruct;
typedef struct{
float vel_1;
float vel_1_old;
float vel_1_est;
float vel_2;
float vel_2_old;
float vel_2_est;
float ts;
float est;
} VelocityEstimatorStruct;
#endif