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 中查找有关 Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!