Skip to content

Commit

Permalink
Debounce Motor Hall Signal
Browse files Browse the repository at this point in the history
  • Loading branch information
stancecoke committed Jun 28, 2024
1 parent 76fe292 commit 98d11ba
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,16 @@ int main(void)
#if (DISPLAY_TYPE == DISPLAY_TYPE_DEBUG && !defined(FAST_LOOP_LOG))
//print values for debugging

sprintf_(buffer, "%d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", adcData[1],ui16_throttle_offset, uint32_SPEEDx100_cumulated>>SPEEDFILTER, uint32_PAS, MS.Battery_Current, int32_temp_current_target , MS.i_q, MS.u_abs, SystemState);
sprintf_(buffer, "%d, %d, %d, %d, %d, %d, %d, %d, %d\r\n",
adcData[1],
ui16_throttle_offset,
ui16_timertics,
uint32_PAS,
MS.Battery_Current,
int32_temp_current_target ,
MS.i_q,
MS.u_abs,
SystemState);
// sprintf_(buffer, "%d, %d, %d, %d, %d, %d, %d\r\n",(uint16_t)adcData[0],(uint16_t)adcData[1],(uint16_t)adcData[2],(uint16_t)adcData[3],(uint16_t)(adcData[4]),(uint16_t)(adcData[5]),(uint16_t)(adcData[6])) ;
// sprintf_(buffer, "%d, %d, %d, %d, %d, %d\r\n",tic_array[0],tic_array[1],tic_array[2],tic_array[3],tic_array[4],tic_array[5]) ;
i=0;
Expand Down Expand Up @@ -1832,7 +1841,7 @@ void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef* htim)

temp5=TIM3->CNT;

ui16_timertics = TIM2->CCR1;
if(TIM2->CCR1>20)ui16_timertics = TIM2->CCR1; //debounce hall signals


//Hall sensor event processing
Expand Down

0 comments on commit 98d11ba

Please sign in to comment.