Can I use well-trained ANN model and "place" function for Hardware in the loop (HIL) testing?
2 次查看(过去 30 天)
显示 更早的评论
I have a trained ANN in MATLAB that estimates the plant’s parameters. These estimates go to an adaptive-control block that recomputes the controller gain K with the place function.
The snag: place is not supported for code generation.
Can I keep the ANN and adaptive-control logic (including the place call) running in MATLAB/Python on a host PC, while
- the plant runs in real-time on a simulator such as Typhoon HIL or OPAL-RT, and
- the main controller code executes on a TI C2000 DSP?
Hope someone can help me for this question!
0 个评论
回答(1 个)
Manish
2025-5-16
Hi,
I understand that you want to generate code for the 'place' function.
This can be achieved with the help of 'coder.extrinsic'
Here is a sample code snippet:
function K = computeK(A, B, p)
coder.extrinsic('place');
K = zeros(size(B, 2), size(A, 1));
K(:,:) = place(A, B, p);
end
Refer to the documentation link below for a better understanding:
Hope it helps!
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!