Model functioning in external mode, but not when built and deployed

3 次查看(过去 30 天)
I am currently working on a project involving a motorized platform controlled by an arduino due. The inputs are two signals on two digital pins and the outputs are analog through the DAC0 and DAC1 pins.
When run in the monitor and tune external mode the model works correctly. However when I build and deploy the model the motors being controlled behave erroneously. While I am running the model in monitor and tune I can even hit the disconnect button in simulink and completely disconnect my computer and the device will function as desired, but if I hit the reset button on the arduino it behave erroneously once again.
I have tried changing the solver settings to fixed step, and a discreet solver as mentioned in this forum post-
This did not change any results.
Do you guys have any ideas why simulink does this? isn't the idea that I can tune my model in the monitor and tune app and then upload that code with the build function and it should do the same thing?
Model attached
  1 个评论
Quinn Riley
Quinn Riley 2022-5-12
I measured the voltage output by the DAC pins, in monitor and tune the voltage ranges from .7 volts to 2.6 volts which is the range needed to control the motor controllers. When the same model is built and deployed it is ranging from 2.1 to 2.55 volts, which is a small part of the range needed.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by