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.