![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
asdgas
Dependencies: mbed Eigen FastPWM
Diff: main.cpp
- Revision:
- 25:3e6b574cab5c
- Parent:
- 24:ef6e1092e9e6
- Child:
- 26:8317d883d4f2
--- a/main.cpp Thu Sep 26 06:08:32 2019 +0000 +++ b/main.cpp Fri Sep 27 04:48:14 2019 +0000 @@ -407,12 +407,12 @@ //Current //ADC3->CR2 |= 0x40000000; // adc _ 12bit // a1=ADC2->DR; - int raw_cur = ADC3->DR; + //int raw_cur = ADC3->DR; //while((ADC3->SR & 0b10)); double alpha_update_cur = 1.0/(1.0+(FREQ_TMR4/2.0)/(2.0*3.14*1000.0)); // f_cutoff : 500Hz double cur_new = ((double)ADC3->DR-2048.0)*20.0/4096.0; // unit : mA cur.sen=cur.sen*(1.0-alpha_update_cur)+cur_new*(alpha_update_cur); - cur.sen = raw_cur; + //cur.sen = raw_cur; /******************************************************* *** Timer Counting & etc.