# Notch Filter on feedback

**URL:** <https://forum.deltamotion.com/t/notch-filter-on-feedback/916>\
**Category:** Programming\
**Created:** [July 16, 2021, 6:37pm UTC](https://forum.deltamotion.com/t/notch-filter-on-feedback/916 "2021-07-16T18:37:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![khonodel](https://forum.deltamotion.com/letter_avatar_proxy/v4/letter/k/90ced4/32.png) [@khonodel](https://forum.deltamotion.com/u/khonodel)\
**Post date:** [July 16, 2021, 6:37pm UTC](https://forum.deltamotion.com/t/notch-filter-on-feedback/916/1 "2021-07-16T18:37:30Z")

</div>

Hi!

I have a steady 12.5Hz oscillation in my feedback that i’d like to filter out in the controller but i dont want to introduce phase delay. I was thinking a notch filter might work, but i dont see one implemented in the controller anywhere. Has anyone used one in an RMC150 or similar before?

---

<div class="post-metadata">

**Author:** ![dmcnichol](https://forum.deltamotion.com/letter_avatar_proxy/v4/letter/d/ba9def/32.png) [@dmcnichol](https://forum.deltamotion.com/u/dmcnichol)\
**Post date:** [July 16, 2021, 9:30pm UTC](https://forum.deltamotion.com/t/notch-filter-on-feedback/916/2 "2021-07-16T21:30:31Z")

</div>

Hi,

Here’s a nice little example program with a notch filter implemented.

Here’s the basic equation:  
 ![image](https://forum.deltamotion.com/uploads/default/original/1X/9e73d15823900010ee90348155448f6f79afa1a3.png)

It’s easy to change the notch center and also the width - Q with the variables in the equation.  
Here’s the project, this one is implemented and an RMC75 but will be easy to copy over to your 150.  
[NotchFilter.rmcproj](https://forum.deltamotion.com/uploads/short-url/s4WIzw0LxiTCKA6PbA1OMV0jWQv.rmcproj) (21.1 KB)

Also, here’s a quick screen shot of the filter in action, I have this one setup with a notch center at 10Hz, you can see its working very well:

 ![image](https://forum.deltamotion.com/uploads/default/original/1X/bfe81b0fea61a664b2c729ea0138c86fa951731e.png)

One last note, the filter works just as it should, but if it’s feedback you are wanting to filter, you’ll want to setup your axis as a custom feedback axis and run the actual feedback you are receiving through this filter then back into the axis as a variable. Here’s an example where this is done: [Redundant/Custom Feedback](https://forum.deltamotion.com/t/redundant-custom-feedback/205)

Don’t hesitate to reach out if you have questions, and good luck on your project!

---

<div class="post-metadata">

**Author:** ![khonodel](https://forum.deltamotion.com/letter_avatar_proxy/v4/letter/k/90ced4/32.png) [@khonodel](https://forum.deltamotion.com/u/khonodel)\
**Post date:** [July 16, 2021, 10:36pm UTC](https://forum.deltamotion.com/t/notch-filter-on-feedback/916/3 "2021-07-16T22:36:35Z")

</div>

Thanks David!

This looks great! If i understand correctly, i need to define the NotchCenter and Q variables in the variable table?

Also what are the units for each variable? Hz?

---

<div class="post-metadata">

**Author:** ![dmcnichol](https://forum.deltamotion.com/letter_avatar_proxy/v4/letter/d/ba9def/32.png) [@dmcnichol](https://forum.deltamotion.com/u/dmcnichol)\
**Post date:** [July 16, 2021, 11:04pm UTC](https://forum.deltamotion.com/t/notch-filter-on-feedback/916/4 "2021-07-16T23:04:43Z")

</div>

No problem! Happy to help.

If you take a look at the project, you can see how I’ve got the variables set up:

 ![image](https://forum.deltamotion.com/uploads/default/original/1X/c84b21f5db4c1dc14b5774fb28a10b8c6c299039.png)

You could just copy and and paste this section into your variable table if you like, might save some time!

Also, you’ve got it, everything is in Hz.

---

<div class="post-metadata">

**Author:** ![khonodel](https://forum.deltamotion.com/letter_avatar_proxy/v4/letter/k/90ced4/32.png) [@khonodel](https://forum.deltamotion.com/u/khonodel)\
**Post date:** [July 19, 2021, 8:05pm UTC](https://forum.deltamotion.com/t/notch-filter-on-feedback/916/5 "2021-07-19T20:05:25Z")

</div>

Awesome! Thanks!

Next question: Am i reading this correctly that the feedback would go in as Xn and come out of the filter as Yn?

---

<div class="post-metadata">

**Author:** ![dmcnichol](https://forum.deltamotion.com/letter_avatar_proxy/v4/letter/d/ba9def/32.png) [@dmcnichol](https://forum.deltamotion.com/u/dmcnichol)\
**Post date:** [July 19, 2021, 9:05pm UTC](https://forum.deltamotion.com/t/notch-filter-on-feedback/916/6 "2021-07-19T21:05:45Z")

</div>

No problem!

You are correct, feedback will go in as Xn and come out as Yn, then you’ll need to use Yn with the custom feedback feature to control off the filtered signal.
