How is a specified sample time handled in external mode

4 views (last 30 days)
Hello,
I am currently using the Arduino Engineering Kit with Simulink and I think it is a great way to develop practical skills in the field of control system engineering. So thanks for developing this product.
At the moment I try to implement some algorithms from my control system lectures on the motorcycle project. Using the PID controller block, I know that values on the discrete version have to be adjusted when sampling time changes.
Here I have two questions:
1. If I use the continous version of the PID controller and start external mode is it then converted to the discrete version using the sample time Simulink determined, or is it just compiling the continous version? (Which would then require the code to be executed so fast, that the sample time has no significant effect on controller behaviour)
2. As far as I know, in a pure simulation Simulink ensures that blocks with a specific sample time are actually executed with this exact sample time. But if I use the discrete version of a block (PID controller) with a specified sampling time, does Simulink ensure that when the code is running on external hardware, that the control algorithm is actually executed with this specific sample time? If not, how can I ensure this manually?
Thank you and a happy new Year!
Matthias

Answers (0)

Community Treasure Hunt

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

Start Hunting!