miniFOC 1.0.3
This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.
Data Structures | Functions | Variables
filter.h File Reference

this is the header file of filter.c, which defines the structure of filter algorithm. More...

Go to the source code of this file.

Data Structures

struct  Filter_Structure_t
 structure of low-pass filter algorithm More...
 

Functions

float filter_update_value (Filter_Structure_t *param, short value)
 update the output value of the first-order low-pass filter More...
 
void filter_config (void)
 configure low-pass filter parameters More...
 

Variables

volatile Filter_Structure_t velocity_filter
 motor rotation speed low pass filter handle More...
 

Detailed Description

this is the header file of filter.c, which defines the structure of filter algorithm.

Author
Lao·Zhu
Version
V1.0.1
Date
9. October 2021

Definition in file filter.h.

Function Documentation

◆ filter_config()

void filter_config ( void  )

configure low-pass filter parameters

Definition at line 45 of file filter.c.

References filter_coefficient_config(), SPEED_COEFFICIENT, SPEED_UP_FREQ, TIM13_FREQUENCY, and velocity_filter.

Referenced by main().

◆ filter_update_value()

float filter_update_value ( Filter_Structure_t param,
short  value 
)

update the output value of the first-order low-pass filter

Parameters
[in]paramfirst order low pass filter parameter handler
[in]valuethe sampled value to be filtered at this moment
Return values
currentcalculation results of low-pass filter

Definition at line 56 of file filter.c.

References Filter_Structure_t::coefficient1, Filter_Structure_t::coefficient2, Filter_Structure_t::current_result, and Filter_Structure_t::last_result.

Referenced by encoder_update_speed().

Variable Documentation

◆ velocity_filter

volatile Filter_Structure_t velocity_filter
extern

motor rotation speed low pass filter handle

Definition at line 19 of file filter.c.

Referenced by encoder_update_speed(), and filter_config().