mirror of
https://github.com/rene-dev/stmbl.git
synced 2026-09-26 18:23:59 +08:00
less resolver ref delay
This commit is contained in:
+6
-2
@@ -31,6 +31,12 @@ INIT(
|
||||
);
|
||||
|
||||
FRT(
|
||||
//noch auf enable prüfen?
|
||||
if(ref){//eine halbwelle
|
||||
GPIO_SetBits(GPIOC,GPIO_Pin_2);//erreger
|
||||
}else{//andere halbwelle
|
||||
GPIO_ResetBits(GPIOC,GPIO_Pin_2);//erreger
|
||||
}
|
||||
float t1;
|
||||
float t2;
|
||||
t1 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1)
|
||||
@@ -51,13 +57,11 @@ FRT(
|
||||
|
||||
if(PIN(enable) > 0.0){//erreger signal aktiv
|
||||
if(ref){//eine halbwelle
|
||||
GPIO_SetBits(GPIOC,GPIO_Pin_2);//erreger
|
||||
a1 = ((t1-t1_mid)*(t1-t1_mid)+(t2-t2_mid)*(t2-t2_mid)) * 0.1 + a1 * 0.9;
|
||||
data[k][0][0] = t1 - t1_mid;
|
||||
data[k][0][1] = t2 - t2_mid;
|
||||
k++;
|
||||
}else{//andere halbwelle
|
||||
GPIO_ResetBits(GPIOC,GPIO_Pin_2);//erreger
|
||||
a2 = ((t1_mid-t1)*(t1_mid-t1)+(t2_mid-t2)*(t2_mid-t2)) * 0.1 + a2 * 0.9;
|
||||
data[l][1][0] = t1_mid - t1;
|
||||
data[l][1][1] = t2_mid - t2;
|
||||
|
||||
Reference in New Issue
Block a user