Clear Filters
Clear Filters

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

3 views (last 30 days)
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 Comment
Quinn Riley
Quinn Riley on 12 May 2022
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.

Sign in to comment.

Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!