The blocks run smoothly on continuous. What I meant is that after testing and that it works, I would upload it directly onto the quadrotor. Thus it would better if it could run on discrete and save time later on in trying to make it discrete.
Thank you for the reminder. I want to test the dynamic model with the APM2 Simulink Blockset. That is why I have to change it into discrete state so that I can use it along with the blocks in the blockset.
After simulation and correction, I would then deploy it onto APM2.5.
I would like to upload the dynamic model equation into the APM2.5. An example coding and simulink model can be found in Peter Corke's Robotics Toolbox which can be viewed on Matlab. The dynamics is coded in an S-function and is solved using continuous state solver. However, the manual in this blockset says that all completed model has to be run on fixed-step discrete solver.
I have tried the following but to no avail
1) changing the code from continuous input states to discrete states
2) Introducing ts = [1 0] where it solves in continuous state with minor sample time
I am guessing that I have to recode the S-function into a MEX or C file before I can use the Run On Hardware option in simulink.
I am having trouble running the example Simulink models. When I run the IMU_Serial_Example.slx file, I get a very long list of warnings. One such example is as follows:
Warning: Unable to load block diagram 'RC_Library'
In general\private\openmdl at 13
In general\private\openslx at 9
In open at 159
In uiopen at 196
When I look at the simulink the blocks are not there but replaced with a red box with detached border and in it saying 'Bad Link'.
I have followed the instructions stated in the How To Guide, i.e. Replacing the core/arduino with the one in this repository and inserting #if 0 and #endif in the wrappers. The files are also placed in the Matlab directory (C:\...\Documents\Matlab).
The version I am using is R2012b with APM 2.5. Any help is gladly appreciated.