File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -427,11 +427,11 @@ void FIQ_PWMPeriod()
427
427
(hall [i ] & 0x07 ) == 0 )
428
428
{
429
429
// Stop motor control if static hall signal error is continued for more than 3 PWM cycle interrups.
430
- if (driver_state .error .hall [i ] <= 12 )
430
+ if (driver_state .error .hall_static [i ] <= 3 )
431
431
{
432
- driver_state .error .hall [i ] += 6 ;
432
+ driver_state .error .hall_static [i ]++ ;
433
433
}
434
- if (driver_state .error .hall [i ] > 12 )
434
+ if (driver_state .error .hall_static [i ] > 3 )
435
435
{
436
436
if ((motor [i ].error_state & ERROR_HALL_SEQ ) == 0 )
437
437
{
@@ -441,6 +441,7 @@ void FIQ_PWMPeriod()
441
441
}
442
442
continue ;
443
443
}
444
+ driver_state .error .hall_static [i ] = 0 ;
444
445
445
446
u = v = w = 0 ;
446
447
halldiff = (hall [i ] ^ _hall [i ]) & 0x07 ;
Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ typedef struct _DriverState
168
168
uint8_t low_voltage ;
169
169
uint8_t hall [2 ];
170
170
uint8_t hallenc [2 ];
171
+ uint8_t hall_static [2 ];
171
172
} error ;
172
173
enum
173
174
{
You can’t perform that action at this time.
0 commit comments