akiyoshi oguro
/
Nucleo_Hall_rect_sin
CCW CW Control BLDC
Diff: cos.h
- Revision:
- 0:faa58403944a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cos.h Sun Feb 17 02:58:08 2019 +0000 @@ -0,0 +1,21 @@ + +void cosU(){ + ut1c=uTc.read_us(); + f1c=1-(cos(2*3.14159*(1/(usic*1E-6))*zint)*16384); + a1c=(2*cos(2*3.14159*(1/(usic*1E-6))*zint)*16384); + uc[0]=a1;uc[1]=0xC000;uc[2]=0; uc[3]=f1c; uc[4]=0; +} + +void cosUN(){ + ut2c=uTc.read_us(); + uTc.reset(); + } +/******************z transfer******************************/ +void ztrc(){ + + uc[2] = ((uc[1]*uc[4])>>14) + ((uc[0]*uc[3])>>14); + uc[4] = uc[3]; + uc[3] = uc[2]; + + } +/*********************************************************/ \ No newline at end of file