123487
Dependencies: mbed-dev-f303 FastPWM3
Revision 59:ed4b54437e02, committed 2020-12-25
- Comitter:
- shaorui
- Date:
- Fri Dec 25 07:06:28 2020 +0000
- Parent:
- 58:bed739c83fac
- Commit message:
- l
Changed in this revision
Config/motor_config.h | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Config/motor_config.h Thu Dec 24 11:30:43 2020 +0000 +++ b/Config/motor_config.h Fri Dec 25 07:06:28 2020 +0000 @@ -1,14 +1,14 @@ #ifndef MOTOR_CONFIG_H #define MOTOR_CONFIG_H -#define R_PHASE 0.13f //Ohms -#define L_D 0.00002f //Henries -#define L_Q 0.00002f //Henries +#define R_PHASE 0.5f //Ohms +#define L_D 0.00003f //Henries +#define L_Q 0.00003f //Henries #define KT .08f //N-m per peak phase amp, = WB*NPP*3/2 #define NPP 21 //Number of pole pairs #define GR 49.0f//151.0f//6.0f //Gear ratio //hjb changed -#define KT_OUT 4.0f//0.08f//0.45f //KT*GR -#define WB 0.0025f //Flux linkage, Webers. +#define KT_OUT 4.0f//4.0f//0.08f//0.45f //KT*GR +#define WB 0.0024f //Flux linkage, Webers. #define R_TH 1.25f //Kelvin per watt #define INV_M_TH 0.03125f //Kelvin per joule
--- a/main.cpp Thu Dec 24 11:30:43 2020 +0000 +++ b/main.cpp Fri Dec 25 07:06:28 2020 +0000 @@ -493,6 +493,9 @@ //printf("adc2: %.3d\n\r",controller.adc2_raw = ADC2->DR); //printf("adc3: %.3d\n\r",controller.adc2_raw = ADC3->DR); //wait(.002); + printf("vdes:%.3f real:%.3f\n\r",60*controller.v_des*GR/(2*PI) ,controller.dtheta_mech*GR*60/(2*PI)); + printf("preal:%.3f\n\r",controller.theta_mech*350/2/PI); + wait(1); }