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: QEI mbed-rtos mbed
Fork of BLDCmotor by
UVWpwm.h
00001 #ifndef __UVWpwm_h 00002 #define __UVWpwm_h 00003 00004 //************* User setting parameters (begin) ***************** 00005 //#define PWM_FREQ 0.5 //[Hz], pwm freq. 00006 //#define DEADTIME 0.2 // [s], deadtime to be set between plus volt. to/from minus 00007 #define U_UPPER_PORT p21 // U相上アームUu用ポート 00008 #define U_LOWER_PORT p22 // U相下アームUd用ポート 00009 #define V_UPPER_PORT p23 // V相上アームVu用ポート 00010 #define V_LOWER_PORT p24 // V相下アームVd用ポート 00011 #define W_UPPER_PORT p25 // W相上アームWu用ポート 00012 #define W_LOWER_PORT p26 // W相下アームWd用ポート 00013 #define PWM_WAVEFORM 1 // 0: saw tooth wave comparison, 1: triangler wave comparison // koko if 0, no round 00014 #define TMIN 3 // [us], processing time of pwm_out() 00015 00016 #define R_SHUNT_UP_PORT p16 // ポート:U相電流検出用抵抗の+側アナログ入力 00017 #define R_SHUNT_UM_PORT p17 // ポート:U相電流検出用抵抗の-側アナログ入力 00018 #define R_SHUNT_VP_PORT p19 // ポート:V相電流検出用抵抗の+側アナログ入力 00019 #define R_SHUNT_VM_PORT p20 // ポート:V相電流検出用抵抗の-側アナログ入力 00020 #define R_SHUNT 0.47 // [Ω], 電流検出用シャント抵抗の値 00021 //************* User setting parameters (end) ***************** 00022 00023 typedef struct struct_pwm_parameters{ // UVW相pwm用の変数宣言 00024 float duty; // 0-1, PWMデューティ 00025 unsigned char mode; // チョッピングのオンオフを決定するモード 00026 long upper_us; // [us], 上アームをオンする時間幅 00027 long lower_us; // [us], 下アームをオンする時間幅 00028 }pwm_parameters; 00029 extern pwm_parameters uvw[]; // UVW pwm の定数、変数 00030 00031 extern void start_pwm(); 00032 extern void stop_pwm(); 00033 #endif
Generated on Tue Jul 12 2022 20:05:59 by
1.7.2
