To Be or Not to Be, NOT a Question 鱼与熊掌兼得

发布时间:2022-09-05

With the fast advancement of technology, most companies if not all are pursuing two goals in product development: shorting time to market; improving product quality.  While these are the goals for company management, product teams must give up one thing for another.  To be or not to be, that is a question.

在技术高速发展的今天,企业都在追求工程开发上两方面的提高,一是要缩短开发时间,二是要提高产品质量。 产品工程狮和程序猿面临这两大问题的时候心里一定是骂娘,因为这二者本身就是鱼和熊掌。

In this article, we will use motor control development as an example to introduce Model-Based Design (MBD) and discuss how this design approach can speed up time-to-market and increase product quality at the same time.  

本文将以电机驱动的开发为例,粗略介绍基于模型的开发方法,如何赋能产品工程狮/程序猿,和谐缩短开发时间及提高产品质量两大核心需求。

An e-bike company needs a new electronic speed control system for a new model.  The requirements have been separated into components.  For motor sub-system, the electrical-mechanical system requirements are further detailed into hardware, software and mechanical parts.   In a conventional development process, the procedure is as follows:

1. Characterize motor and collect data;

2. Based on experience, choose an algorithm and build a simplified simulation bench to design;

3. Coding, compiling, building, lots of errors, fixing, compiling, building, errors, fixing, compiling, building, still errors… fixing, compiling, building, finally okay

4. Flash the code, test in lab physical system, find some bugs, go back to step 3

5. After a few iterations, lab test looks okay, deliver to product integration team.

6. Integration team executes system test, find some bugs in motor sub-system, feedback to the designer, go back to step 3

7. After a few iterations, the team passed system tests.  Product manager came to check.  He was happy to see the progress, but brought up some new features needed.

8. The team is doomed, go back to step 3

9. …..

10. Eventually, everything is settled.  Final code review。

电动车公司需要一个新的Electronic speed control (ESC),产品要求被分解到每个子系统。对于电机在传统的研发的过程可能是这个样子的: 机电系统的需求会被进一步分解成硬件,软件和机械的要求。 在一个传统的开发流程中,步骤如下

1. 拿来电机样品,各种折腾,收集了一些数据

2. 根据过往经验,选择一个认为合适的算法,搭一个简单的仿真平台开始设计

3. 码代码,编译,出错,改代码,编译,出错,再改代码,编译,出错,。。。又改代码,编译,总算过了

4. 烧写程序,在实验室连动电机测试,发现有些问题,回到第三步

5. 经过几个来回,实验室的测试感觉木有问题了,交付给产品集成

6. 整机测试,有些工况无法在实验室环境模拟,整机测试中出状况了,回到第三步

7. 来来回回几次,总算可以了,哦yeah!产品经理(老板)过来了,带来了一些新的产品需求

8. 工程狮,程序猿崩溃了,回到第三步

9. 。。。。。

10. 最终,好不容易处理完毕了,最终代码审阅。

The conventional development process is obviously slow and prone to errors.  Any changes made will take a long time to materialize.  This also make the product quality and time-to-market on the two sides of the table.  

这样传统的工程开发,显而易见是相当缓慢的,隐患也是不言而喻的。 而且任何改动都会需要很长时间来实现,也凸显了开发时间和产品质量之间的矛盾。

Then what will the experience be with Model Based Design?  The development process is as follows:

1. Plant model exists.  Designers need input physical parameters and increase the model accuracy

2. The whole electronic speed controller is built inside the simulation environment.  Multiple algorithm can be checked for comparison.  

3. Codegen is employed to generate code automatically.  Then it is flashed to the PCB.  Hardware in the loop (HIL) is executed.  

4. When designer is satisfied with data obtained from simulation, the PCB is plugged into the real physical system

5. If the product requirement is changed for any reason, step 2,3,4 will be repeated quickly, peanuts.

6. No more bugs because code is generated automatically.

那么Model Based Design会是怎样的一种体验呢?开发过程可能会变成这样:

1. Plant模型已经有了(以后简称plant model),把具体物理参数输入进行调试,提高plant model的准确性

2. Simulink搭建整个ESC,可以同时开发多个算法来进行比较,MIL(Model In The Loop) 跑一下各种不同工况。

3. 将这个ESC模型直接进行codegen, 然后程序烧写hardware(板子)上,进行HIL(Hardware In The Loop)

4. 当模拟数据满意后,将调试好的板子放到实际物理系统上进行测试

5. 如果产品经理或老板要有任何改动,就得 2,3,4再来一次,小菜一碟

6. 再也不用再人肉查代码啦

MBD enables the designers to return to the intrinsic part of a product design which is to analyze system requirements and translate those requirements into engineering specifications.  Since designers can engage high level system tests in the early stage of development, MBD enables the designers to identify ambiguous requirements (product manager cannot articulate, haha).  And engineers don’t need go through pains coding.

用基于模型的设计,设计师可以回归一个产品的最核心部分,就是对系统需求准确的分析和并制定工程规范。用基于模型的设计, 设计师可以在早期进行系统整合测试,发现需求模棱两可的地方。工程师也避免了手写代码的痛苦。

2020 官网升级中!现在您访问官网的浏览器设备分辨率宽度低于1200px
请使用高分辨率宽度访问。