cancel
Showing results for 
Search instead for 
Did you mean: 

How to up sample with non-integer clocks?

BTrem.1
Senior II

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

1 REPLY 1
MM..1
Chief III

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.