Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: config_inverter.h
- Revision:
- 15:b583cd30b063
- Child:
- 19:a6cf15f89f3d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config_inverter.h Sun Oct 30 22:16:30 2016 +0000 @@ -0,0 +1,29 @@ +#ifndef __CONFIG_INVERTER_H +#define __CONFIG_INVERTER_H + +#define PWMA PA_9 +#define PWMB PA_8 +#define PWMC PA_10 +#define EN PB_15 + +#define IA PA_4 +#define IB PB_0 + +#define TH_PIN PB_8 + +#define CURRENT_U ib +#define CURRENT_V ia + +#define I_SCALE_RAW 25.0f //mv/A +#define R_UP 12000.0f //ohms +#define R_DOWN 3600.0f //ohms +#define R_BIAS 3600.0f //ohms +#define AVDD 3300.0f //mV + +#define I_OFFSET (AVDD * R_DOWN * R_UP / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP))) +#define I_SCALE (R_BIAS * R_DOWN * I_SCALE_RAW / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP))) + +#define BUS_VOLTAGE 20.0f +#define set_dtc(phase, value) *phase = (value) + +#endif \ No newline at end of file