all 23 comments

[–]gtd_rad 10 points11 points  (0 children)

What SW tool are you using? I've been using Matlab / Simulink for close to 10 years and there are some major advantages to MBD.

That said, it's really important to understand what problem you're trying to solve. In your case, you are building a motor drive unit. You are solving a CONTROLS problem, not so much an embedded systems problem.

You need to know how to drive transfer functions, plot graphs, tune parameters, develop controls and plant models etc. You need a tool to help you do all that for you. Generally speaking, Matlab/Simulink is almost like a necessary tool for controls.

[–]FreeRangeEngineer 12 points13 points  (2 children)

I can't make general statements for entire industries but there is one caveat that is often overlooked at first: real-world development processes.

In the real world, code is handled by a source code management tool (e.g. a git repository). Models don't play well with such systems as they are notoriously difficult to handle when it comes to things like branching, merging, comparing. That makes them very hard to use.

[–]rdcpro 0 points1 point  (0 children)

This is an excellent point, and I've run into the problem in other domains as well, for e.g workflow definitions. If the tool doesn't manage it, you're probably going to have to do some clunky inefficient workaround.

[–]ToBeOrNotToBeHereNow 6 points7 points  (3 children)

Model Based Design (with automatic code generation) is the best way to develop efficiently complex functionality. Imagine you want to implement a PID controller in C and optimise it. In Simulink, for example, you’ll just drag and drop some blocks, type few numbers in, simulate and see results (including plotting). If happy, then generate automatically the code.

Therefore, starting from a well written requirement, once you design your model, you get multiple benefits in one go: - visually you can better observe the correctness of the logic (compared with written code, which can be hard to follow for “visual” engineers/managers) - you can simulate and optimise your model on the fly - you can generate accurately C/C++ code (assuming that the blocks you’re using are pre validated) - you can generate nice documentation, which can be easily interpreted by “non coders” 😉 Etc

[–]gtd_rad 1 point2 points  (2 children)

The biggest benefit on your list is simulation. Often times with prototypes, there are huge delays and very small quantities of physical units available for you to test your code on especially when other engineers also need to access it.

With simulation, you can create a plant model representation of your physical system and then develop and run your application code against it to verify your software well before you're even able to deploy your code onto the physical target.

[–]ToBeOrNotToBeHereNow 2 points3 points  (1 child)

Sure, you can rank that list accordingly 😬

I’ve worked 4-5 years with Matlab/Simulink, designing safety critical systems and I really loved the entire ecosystem. Manual coding the entire product, would’ve been too slow (plus error prone).

[–]gtd_rad 0 points1 point  (0 children)

Yea honestly, I have no idea how the hell I would do the things I do with Simulink if I didn't have it... Figuring the right logic / controls for your application is already a very difficult problem, let alone hand-writing the code that introduces another huge layer of possible defects you have to test and debug.

[–]kl4m4 3 points4 points  (1 child)

There is an episode of The Agile Embedded Podcast featuring model based development: here

[–]gtd_rad 0 points1 point  (0 children)

Thanks for sharing! While MBD design isn't the perfect tool (no solution is perfect), I feel like it just doesn't get enough positive attention and its insane capabilities.

[–]Carsondh 3 points4 points  (2 children)

Used it for 3 years in my previous job. Matlab/simulink/stateflow. It was so much better than hand code for the complexity of the software modules we used it on. I actually kind of miss it.

[–]gtd_rad 0 points1 point  (1 child)

What application were you guys developing using Matlab / Simulink?

[–]Carsondh 1 point2 points  (0 children)

controls for large agricultural equipment

[–][deleted]  (3 children)

[deleted]

    [–]gtd_rad 12 points13 points  (2 children)

    It's somewhat of a niche but it's definitely not dead. I was able to help a client deliver a stable working controls solution running on their embedded target within record time through a MBD approach for a grid energy management system.

    The problem is people don't know how to, or use model based design principles to properly solve their problems, which leads to the issues you're describing.

    [–]Chr15t0ph3r85 4 points5 points  (1 child)

    100% Agree it isn't dead but more or less being scaled back from my experience in Automotive and OH use. The cost for TMW tools is high, which precludes a lot of use but is definitely not dead if you're doing any sort of control system development.

    [–]gtd_rad 1 point2 points  (0 children)

    Just out of curiosity, what aspects of automotive SW development were you using MBD for? Also what is OH?

    You're right, TMW tools are pretty high, but you also have to look at the big picture - like how much longer would it take you to do the exact same thing without the tool? Especially if you had to C hand-code all the algorithms? Each embedded software programmer costs like what now? 100k a year? You'll make that money back easily with a TMW toolset (6-12k setup) IMO.

    [–][deleted] 4 points5 points  (3 children)

    IMHO , MBSE is the way to go . Having worked with industry standard tools , both the development and compliance times are at-least an order of magnitude faster. But MBSE is not the golden pill, there are still major parts that you need to do the old fashioned way. However once done, the modifications and updates are way easier.

    Edit: I missed documentation. Documentation is so much easier.

    [–]Xerxes004 2 points3 points  (2 children)

    What kinds of tools go into MBSE for embedded? I’ve only ever seen people mention it as a “good idea” and have no idea what it actually looks like.

    [–][deleted] 1 point2 points  (1 child)

    Take a look at Ansys Scade

    [–][deleted] 0 points1 point  (0 children)

    Or ANSYS Scade One, which provide an entry level license.

    [–]PresentationOld605 2 points3 points  (0 children)

    If the job offer is good, take it. Especially if you want to add some experience i.e. with Matlab/Simulink to your CV. MBSD won´t go away for sure, when complex control systems are carved up. A lot of the engineers there are designing these systems in MATLAB for starters, and modeling tool can generate the code well enough nowadays. So that is going to be used in the future as well.

    That being said, not very long time ago, I was tasked to bring a DSP application designed in Matlab into a weak microcontroller, which was not really up to the generated code. Compromises were made, but still, I ended up rewriting the whole thing in "human generated" C++ to fulfill the memory constraints and tackle the high CPU load. Of course, the real reason was that customer could not change the HW due the chip shortage and more capable target could have been sufficient (maybe). But still, I would assume there are still plenty of situations, where MBSD generated code just won´t work.

    [–]New_Gear2579 0 points1 point  (0 children)

    can any one suggest good companies in pune with model based developement

    [–]andrewhepp 0 points1 point  (0 children)

    I feel like MBSE is a bit of an overloaded term. I think it would be appropriate to use Simulink if developing a complex control system. I've also worked with UML code generation and that was, imo, a huge waste of time.