Skip to main content
BTrem.1
Senior
January 8, 2022
Question

How to up sample with non-integer clocks?

  • January 8, 2022
  • 1 reply
  • 512 views

I have a motor control application where there is phase feedback at about 170Hz from a PID but this varies in application from 165Hz to 185Hz. The outer phase loop is summed with the inner speed loop (STM FOC Library) that has a crystal based 1kHz sample time. I think I need to up-sample the 170Hz outer loop because there is inadequate phase margin in the region 10-30Hz. I was thinking that up sampling would reduce phase lag.

Since the two frequencies (~170Hz and 1khz) are not integer related can I still use up sampling?

For example can I up-sample by 7x to 1155Hz then re-sample at the 1kHz crystal base frequency?

Thanks,

Brian

This topic has been closed for replies.

1 reply

MM..1
Chief III
January 9, 2022

From your description im not clean what you sample, but if you have free timer you can do interrupt sampling on any available divided freq... FYI phase isnt sample , but measured wide i mean.