![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
derp
Diff: config.h
- Revision:
- 5:efd3838b79a6
- Parent:
- 2:eabe8feaaabb
- Child:
- 6:561d8ab80424
--- a/config.h Fri Mar 18 12:07:14 2016 +0000 +++ b/config.h Sun Mar 27 03:40:52 2016 +0000 @@ -3,18 +3,21 @@ #define set_dtc(phase, value) *phase = 1.0f - (value) -#define PWMA PA_8 -#define PWMB PA_9 -#define PWMC PA_10 +#define PWMA PA_10//PA_8 +#define PWMB PA_9//PA_9 +#define PWMC PA_8//PA_10 #define EN PB_15 +#define POLE_PAIRS 10.0f +#define RESOLVER_LOBES 1.0f + #define IA PA_4 #define IB PB_0 #define TEST_DAC PA_5 #define PI 3.141593f #define CPR 4096 -#define POS_OFFSET 5.3f +#define POS_OFFSET 1.57f//1.82f #define I_SCALE_RAW 25.0f //mv/A #define R_UP 12000.0f //ohms @@ -25,8 +28,8 @@ #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 K_LOOP 1.0f -#define KI_BASE 0.01f +#define K_LOOP 0.02f//1.0f +#define KI_BASE .008f//0.01f #define BUS_VOLTAGE 20.0f #define KP (K_LOOP / BUS_VOLTAGE)