# Designing a Butterworth Filter

36 visualizzazioni (ultimi 30 giorni)
Oliver-Maximilian Klein il 18 Mar 2022
Hey there guys and gals,
i want to design a Butterworth filter for a field oriented control of a permanent magnet synchronous machine. Where a sensor in the rotor tracks the mechanical angle of the rotor. This signal is then differentiated. Because of the differentiation the high frequencies of the noise are amplified, so i need to filter it. Ive decided to model a 2nd order Filter. The motor is supposed to accelerate to n = 16000 rpm which is roughly an angular velocity omega of 1675 rad/min. So my cut off frequency is calculated based on fc = 1 / ( 2 *pi * omega (1675 / 60) ) ? And the pass frequency is everything below fc ?
If you need any clarifications, please let me know.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Scott MacKenzie il 19 Mar 2022
Modificato: Scott MacKenzie il 19 Mar 2022
Here's a solution, but it requires MATLAB's Signal Processing Toolbox.
Given, sRate, the sample rate of your data, fc, the desired cuttoff frequency, and y1, your input signal, then...
% create 2nd-order low-pass butterworth filter
[b, a] = butter(2, fc/(sRate/2), 'low');
% filter the input signal (y1)
y2 = filter(b, a, y1);
##### 3 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
Scott MacKenzie il 20 Mar 2022
Modificato: Scott MacKenzie il 20 Mar 2022
@Oliver-Maximilian Klein, you're welcome. BTW, what is the same rate of your data? And is your cutoff frequency simply the frequency of rotation of the motor, i.e., 16000/60 = 266.7 Hz?
Oliver-Maximilian Klein il 20 Mar 2022
my simulation runs in the continous time domain, so there is no rate of data. The cut off frequency should be 226.7 Hz. The angular acceleration is the torque divided by the inertia, and ive basically used that equation to compute a time constant for a first oder lag element low pass filter.

Accedi per commentare.

### Categorie

Scopri di più su Butterworth in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by