MATLAB: Possibility of implementing transfer function in arduino.

arduinolow-pass filtertransfer function

Using the Matlab, I obtained the transfer function
1.741e08
---------------------------
s^2 + 1.866e04 s + 1.741e08
I need help to implement the transfer function in Arduino.
Thanks for any help anyone can offer to steer me in the right direction

Best Answer

you first have to convert to Z-domain either hand calculation or easily can be done in matlab by using c2d function. once you have your tf in z-domain, simply by substituting H(z) = Y(Z)/U(Z) = "your z-domain tf". make Y(Z) as your subject, which would be a function of Y(Z) itself and Y(Z-1), U(Z), U(Z-1).....so on, which are delayed version of Y(Z) and U(Z). Make sure to update this values after each loop iteration.
Related Question