pid object in Matlab, embedded coder.

How to use pid object in code generation.
function [pid_out] = my_PID(pid_err)
persistent pid_h;
if isempty(pid_h)
P = 17.8604744115963;
I = 467.971297395799;
D = -0.0945976372995747;
N = 79.5908782021236;
Ts = 0.001;
pid_h = pid(P,I,D,1/N,Ts);
end
%This is a problem
%pid_out = ??????(pid,pid_err) <--- how to call single step (1 discreat step)
end
I am not sure how to make my_PID.m that integrates pid object, after embedded code generation I want to call that function from my arm based MCU.
I am aware of PID block in SImulink and I know how to make C code from subsystem, so my question is how to make the same thing but in Matlab.
Thanks in advance

답변 (0개)

카테고리

도움말 센터File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

질문:

2020년 4월 6일

편집:

2020년 4월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by