필터 지우기
필터 지우기

MBD: Blocks or C-code ?

조회 수: 2 (최근 30일)
Erik Voigt
Erik Voigt 2012년 10월 9일
Hi We are in the process of introducing model based design (mbd) here, with all the diciplines/aspects sketched by Mathworks. We have a history of writing our control-algorithms (electrical motor control) in C-code and wrap them in S-functions. So the big question now is: Should we shift to blocks, so we can use all tools from Mathworks to do mbd - or should we stick to C-code, where we also need tools from the SW-community to do all the mbd-deciplines ?
My/our analysis tells me so far, that the advantages with blocks are not so obvious, and we can get to mbd also with C-code. Please note that our models are complex and contains many nonlinearities (if..else...statemachines).
If there are any comments and even maybe experience on this I would be happy to hear about it.
Kind Regards Erik

답변 (1개)

Ryan G
Ryan G 2012년 10월 9일
편집: Ryan G 2012년 10월 16일
It would be tough to say exactly what is best given the unknowns in this case. However, in general, using blocks should be the way forward for control design in Simulink using a Model Based Design approach. This will allow you to:
  • set oprating points
  • linearize a model for control design
  • find and tune gains for controllers
  • use stateflow machines to visually model state machines
  • use fuzzy logic toolbox for control methods (if needed)
When you use the Simulink blocks you will find it easier to work between these tools compared to using s-functions, which I would consider a big advantage. S-functions can often be used as well, but there will typically be a bit more work to make sure everything is set to work properly. You will also find more examples/demos that you can utilize for your design process with blocks versus s-functions.

카테고리

Help CenterFile Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by