Hi Jeremy
 
Thanks for your comments. Has the MATLAB script you refer to been used within an S-function in Simulink. I believe (though I'm not certain) that S-functions written in M-Script are autocodable if 'inlined'. I accept that hand-written code may be more efficient (though from what I've seen, the auto-generated code looks good), but I intend to autocode from Simulink because of the improved visibility and manageability as the code complexity increases.  In an ideal world I will be able to test my entire control system in simulation (probably written in Simulink, but subsequently compiled). All this is a long way in the future, but when I am up and running I would very much like to see your code. I'm sure (given your department) you've solved most of the problems I will encounter. Perhaps it will be possible (though you might think I'm crazy) to re-code your M-script in Simulink. 
 
I've just checked, and in fact MATLAB does indeed run under Linux, so it seems that with Real-Time Workshop/Embedded Coder I may be able to streamline part of the code generation process. Has anyone had any success with this?


Mike -
 
>
> On 1/5/07, *Mike Whincup* <mwhincup@hotmail.com
> <mailto:mwhincup@hotmail.com>> wrote:
>
>         * OpenSUSE Linux 10.2 with KDevelop (/A development and
>           Cross-compilation environment/. - Are there any reasons to
>           use something else? I will try to develop most of my code by
>           autocoding from MATLAB/Simulink. I believe the latest
>           versions are not available for LINUX so maybe I'll have to
>           develop in Windows, then swap to LINUX. If you are using
>           MATLAB/Simulink in this way can you tell me your setup please? )
>

    I am not sure if this will help but, as an alternative to autocoding
with MATLAB/Simulink, you could program your controller by hand in C (or
the like) without too much wasted effort. You would just have to program
a runge kutta integrator (or find one online); I have example matlab
code, but none in C, if you're interested. After that, you just program
a state function including any integrations/derivatives needed as
outputs, and put it through the integrator. It is likely that this code
would be easier to work with, smaller, and more efficient than the
autocoding. If you'd like, I can send you an example of something
similar I did when controlling a satellite (it's in MATLAB again
though). Good Luck.


    Jeremy Marschke
    Aerospace Research, University at Buffalo



Be one of the first to try Windows Live Mail.