0
$\begingroup$

I am trying to implement PID control on a sensor signal that has many discontinuities in it. Due to these discontinuities, the differentiated signal does not provide a meaningful or useful signal I can use in my control, rather it is a series of jumps and zero values. Below is a figure showing my sensor data, and a smoothed version below which I've used MATLAB for: enter image description here

The smoothed function gives a much more meaningful derivative signal. I did the smoothing with MATLABs smoothing spline cure fitting. However, I realise that this operation will be computationally intensive to do on a microcontroller.

I wanted to ask: how do I go about smoothing my sensor signal on my microcontroller without introducing significant phase delays? The objective is to get a meaningful derivative signal that I can use in my control.

$\endgroup$
3
  • $\begingroup$ Are the jumps in the data real or are these artifacts or noise ? $\endgroup$ Commented Apr 2, 2024 at 11:32
  • $\begingroup$ Hi there the jumps come from my sensor's data processing mechanism, I think it holds on to the same value for a few sensor clock cycles until the new value comes in - it's something that's inherent to the sensor though and there's not much I can do about it hardware wise $\endgroup$ Commented Apr 2, 2024 at 11:55
  • $\begingroup$ Mr.PLL, do you mean to say that yours is a suitable scenario to use a digital implementation of a PID controller in a microcontroller (en.wikipedia.org/wiki/…)? With a circuit added for sensor clock recovery from your sensor signal, if explicit clocks aren't available? $\endgroup$ Commented Apr 2, 2024 at 14:37

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.