CN106970787A - A kind of automobile controller rapid prototyping implementation method - Google Patents

A kind of automobile controller rapid prototyping implementation method Download PDF

Info

Publication number
CN106970787A
CN106970787A CN201710124862.9A CN201710124862A CN106970787A CN 106970787 A CN106970787 A CN 106970787A CN 201710124862 A CN201710124862 A CN 201710124862A CN 106970787 A CN106970787 A CN 106970787A
Authority
CN
China
Prior art keywords
function
mask
rapid prototyping
module
driving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201710124862.9A
Other languages
Chinese (zh)
Inventor
夏洪涛
焦玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Automotive Polytron Technologies Inc
Original Assignee
Zhejiang Automotive Polytron Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Automotive Polytron Technologies Inc filed Critical Zhejiang Automotive Polytron Technologies Inc
Priority to CN201710124862.9A priority Critical patent/CN106970787A/en
Publication of CN106970787A publication Critical patent/CN106970787A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/311Functional or applicative languages; Rewrite languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention is a kind of automobile controller rapid prototyping implementation method, it is characterized in that including:During rapid prototyping (RCP), bottom layer driving is packaged, the form that bottom layer driving is packaged into module is added to simulink storehouses and can just directly invoked in a model, model is directly generated into source code using MATLAB RTW instruments, corresponding MCU driving module can also generate source code, so as to avoid hand-written driving code, and model is directly used, exploitation is more convenient, multiplexing can also be realized in disparity items, so as to save more resources, mainly include:Bottom layer driving is packaged using S function and Mask in MATLAB;Write Block TLC files.The present invention can avoid hand-written driving code, and platform is had more preferable durability, make controller rapid prototyping (RCP) more convenient, so as to save project cost and construction cycle.

Description

A kind of automobile controller rapid prototyping implementation method
Technical field
The present invention relates to vehicle electric field, more particularly, to using S-function in automobile controller development process The method for realizing the controller rapid prototyping (RCP) on particular platform.
Background technology
In automobile controller development process, under MATLAB environment to algorithm floating-point mould fixed point after the completion of, utilize Automatic Code Generation (Real Time Workshop, RTW) in MATLAB softwares is to model real time workshop, then The code automatically generated is downloaded on target platform after carrying out integrated compiling with system software, reaches Product rapid realization checking The purpose of purpose, i.e. rapid prototyping (RCP).
Because during actual development, different projects may use identical target platform, and this requires one kind The method of rapid multiplexing bottom code, to shorten the project cycle and development cost.The traditional method for realizing rapid prototyping and Deficiency mainly has:
1. the target platform storehouse carried using MATLAB.Due to the finiteness of object library, it can undoubtedly make the choosing of target platform Select and be restricted, and object library is also required to charge purchase in itself, so also brings along the increase of cost;
2. hand-written bottom code.So it is accomplished by putting into manpower, also brings along the increase of the project cycle and cost.And by In the difference of project in itself, though bottom code is multiplexed, but the configuration of bottom may be not consistent, is so accomplished by reconfiguring And debugging, so also bring along the increase of the project cycle.
The content of the invention
Present invention aim to address in automobile controller development process, traditional controller rapid prototyping is to target Therefrom is more, the problem of automation and reusing degree are relatively low.
In order to achieve the above object, a kind of automobile controller rapid prototyping implementation method of the invention, it is characterized in that including: During rapid prototyping (RCP), bottom layer driving is packaged, the form that bottom layer driving is packaged into module is added to Simulink storehouses can just be directly invoked in a model, model be directly generated into source code using MATLAB RTW instruments, accordingly MCU driving module can also generate source code, so as to avoid hand-written driving code, and directly use model, make exploitation more square Just, multiplexing can also be realized in disparity items, so as to save more resources, is mainly included:
(1) bottom layer driving is packaged using S-function in MATLAB and Mask;
(2) Block TLC files are write.
Above-mentioned specific method is:
(1) Mask encapsulation is carried out to bottom layer driving:
1. the S-function modules in Simulink storehouses are used, double-clicks and S-function names is write after opening, such as Msp430f2132_di, this document is s-function C files, can define the input/output port including module, port The parameter of type, S-function parameters are RTDParameters;
2. the encapsulation of gui interface, i.e. Mask, S- are carried out according to S-function parameters number Function Mask needs click right to select Mask S-Function to enter edlin, in this module, has four Output port, type is checkbox, and when some checkbox is in selected state, output end eloquence is effective;
3. User Interface envelope turns initializtion script in Initialization, uses m language,
(2) write mutual between corresponding S-function files, Simulink and C MEX S-Function Effect is by calling the call back function in S-Function to realize;Each function completes a pre-defined task, Necessary to these tasks are the simulation block functions that S-Function is defined;
(3) Block TLC file edits:
After the s-function and mask of drive module, write the TLC files of module to carry out code building;
So far, the writing of drive module, mask encapsulation, TLC file edits are just completed, and can just be downloaded the code of generation Rapid prototyping is carried out on to hardware platform to test.
After the present invention, the bottom layer driving to platform under MATLAB environment is packaged, and writes corresponding Block TLC files, thus can be with so that the module of encapsulation is directly used in modeling developing, it is possible to automatically generate bottom layer driving code Hand-written driving code is avoided, and platform is had more preferable durability, makes controller rapid prototyping (RCP) more convenient, So as to save project cost and construction cycle.
Brief description of the drawings
Fig. 1 is the path block diagram of automobile controller rapid prototyping implementation method.
Embodiment
Below in conjunction with the accompanying drawings and the invention will be further described by embodiment.
Fig. 1 is the path block diagram of automobile controller rapid prototyping implementation method.
During rapid prototyping (RCP), bottom layer driving is packaged, such as the input and output of single-chip microcomputer, AD, serial ports Deng driving the form for being packaged into module to be added to simulink storehouses and can just directly invoke in a model such, utilize Model is directly generated source code by MATLAB RTW instruments, and corresponding MCU driving module can also generate source code, thus Hand-written driving code can be avoided, and directly uses model, exploitation is more convenient, multiplexing can also be realized in disparity items, So as to save more resources, mainly include:
1. bottom layer driving is packaged using S-function in MATLAB and Mask;
2. write Block TLC files.
Here is to utilize above-mentioned automobile controller rapid prototyping implementation method, to the writing of drive module, mask encapsulation, It is illustrated exemplified by TLC file edits, it is successively:
1. pair bottom layer driving carries out the encapsulation of Mask encapsulation, such as single-chip microcomputer MSP430F2132DI modules:
1. the S-function modules in Simulink storehouses are used, double-clicks and S-function names is write after opening, such as Msp430f2132_di, this document is s-function C files, is capable of input/output port, the port type of definition module Etc. parameter, S-function parameters are RTDParameters;
2. the encapsulation of gui interface, i.e. Mask are carried out according to S-function parameters number.S- Function Mask needs click right to select Mask S-Function to enter edlin, in this module, has four Output port, type is checkbox, and when some checkbox is in selected state, output end eloquence is effective;
3. User Interface envelope turns initializtion script in Initialization, uses m language
(2) write mutual between corresponding S-function files, Simulink and C MEX S-Function Effect is by calling the call back function in S-Function to realize;Each function completes a pre-defined task, Necessary to these tasks are the simulation block functions that S-Function is defined;One C MEX S-function general format is such as Under:
#define S_FUNCTION_NAME your_sfunction_name_here
#define S_FUNCTION_LEVEL 2
#include"simstruc.h"
static void mdlInitializeSizes(SimStruct*S)
{
}
<Additional S-function programs/code>
static void mdlTerminate(SimStruct*S)
{
}
#ifdef MATLAB_MEX_FILE/*This is file being compiled as a MEX-file*/
#include"simulink.c"/*MEX-file interface mechanism*/
#else
#include"cg_sfun.h"/*Code generation registration function*/
#endif
When Simulink and S-function interacts, the first program that Simulink is called is
MdlInitializeSizes, what is then called is that (all function names are with mdl for other S-function functions Beginning);
At the end of emulation, Simulink calls mdlTerminate functions;
3.Block TLC file edits:
After the s-function and mask of drive module, it is possible to write the tlc files of module to carry out code building , it is as follows:
So far, the writing of drive module, mask encapsulation, TLC file edits are just completed, and can just be downloaded the code of generation Rapid prototyping is carried out on to hardware platform to test.

Claims (2)

1. a kind of automobile controller rapid prototyping implementation method, it is characterized in that including:During rapid prototyping (RCP), the bottom of to Layer driving is packaged, and the form that bottom layer driving is packaged into module is added to simulink storehouses just can directly adjust in a model With, model is directly generated into source code using MATLAB RTW instruments, corresponding MCU driving module can also generate source code, So as to avoid hand-written driving code, and model is directly used, is more convenient exploitation, multiplexing can also be realized in disparity items, So as to save more resources, mainly include:
(1) bottom layer driving is packaged using S-function in MATLAB and Mask;
(2) Block TLC files are write.
2. a kind of automobile controller rapid prototyping implementation method according to claim 1, it is characterized in that described utilization S-function and Mask are packaged to bottom layer driving in MATLAB and Block TLC files are write, its specific method according to It is secondary to be:
(1) Mask encapsulation is carried out to bottom layer driving:
1. the S-function modules in Simulink storehouses are used, double-clicks and S-function names is write after opening, this document is S-function C files, can define the parameter of the input/output port including module, port type, S-function Parameters is RTDParameters;
2. the encapsulation of gui interface, i.e. Mask are carried out according to S-function parameters number, S-function's Mask needs click right to select Mask S-Function to enter edlin, in this module, has four output ports, Type is checkbox, and when some checkbox is in selected state, output end eloquence is effective;
3. User Interface envelope turns initializtion script in Initialization, uses m language;
(2) interaction between corresponding S-function files, Simulink and C MEX S-Function is write It is by calling the call back function in S-Function to realize;Each function completes a pre-defined task, these Necessary to task is the simulation block function that S-Function is defined;
(3) Block TLC file edits:
After the s-function and mask of drive module, write the TLC files of module to carry out code building;
So far, the writing of drive module, mask encapsulation, TLC file edits are just completed, and can just be downloaded to the code of generation firmly Rapid prototyping is carried out on part platform to test.
CN201710124862.9A 2017-03-03 2017-03-03 A kind of automobile controller rapid prototyping implementation method Withdrawn CN106970787A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710124862.9A CN106970787A (en) 2017-03-03 2017-03-03 A kind of automobile controller rapid prototyping implementation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710124862.9A CN106970787A (en) 2017-03-03 2017-03-03 A kind of automobile controller rapid prototyping implementation method

Publications (1)

Publication Number Publication Date
CN106970787A true CN106970787A (en) 2017-07-21

Family

ID=59330138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710124862.9A Withdrawn CN106970787A (en) 2017-03-03 2017-03-03 A kind of automobile controller rapid prototyping implementation method

Country Status (1)

Country Link
CN (1) CN106970787A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634584A (en) * 2018-11-22 2019-04-16 南京航空航天大学 A kind of driving encapsulation and communication mechanism based on code building
CN109683865A (en) * 2018-12-26 2019-04-26 中车青岛四方车辆研究所有限公司 EMU vehicle-mounted control software generation system and method
CN112748904A (en) * 2019-10-29 2021-05-04 卓品智能科技无锡有限公司 Controller rapid prototyping development method based on MATLAB platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102087610A (en) * 2009-12-08 2011-06-08 联创汽车电子有限公司 Method for performing model simulation and code generation on custom hardware by using Simulink
CN102537316A (en) * 2012-01-11 2012-07-04 北京经纬恒润科技有限公司 Prototype controller used for automatic speed-change control and complete power distribution
CN102622470A (en) * 2012-02-21 2012-08-01 重庆邮电大学 General car code conversion method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102087610A (en) * 2009-12-08 2011-06-08 联创汽车电子有限公司 Method for performing model simulation and code generation on custom hardware by using Simulink
CN102537316A (en) * 2012-01-11 2012-07-04 北京经纬恒润科技有限公司 Prototype controller used for automatic speed-change control and complete power distribution
CN102622470A (en) * 2012-02-21 2012-08-01 重庆邮电大学 General car code conversion method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634584A (en) * 2018-11-22 2019-04-16 南京航空航天大学 A kind of driving encapsulation and communication mechanism based on code building
CN109683865A (en) * 2018-12-26 2019-04-26 中车青岛四方车辆研究所有限公司 EMU vehicle-mounted control software generation system and method
CN112748904A (en) * 2019-10-29 2021-05-04 卓品智能科技无锡有限公司 Controller rapid prototyping development method based on MATLAB platform

Similar Documents

Publication Publication Date Title
CN106371813B (en) A kind of electric vehicle motor controller method for producing software based on Simulink
CN105843630B (en) A method of it is developed based on robot graphic programming
US7487080B1 (en) Partitioning a model in modeling environments
Singh et al. Kiwi: Synthesis of FPGA circuits from parallel programs
CN105528290B (en) Construction method of script-based embedded software simulation and test integrated platform
CN104965750B (en) Rapidio switch logical simulation verification platforms and method based on Python
CN102662648B (en) A kind of embedded software developing emulation platform of communicating terminal and application thereof
CN107346249A (en) A kind of computer software development approach based on model
CN104915297B (en) A kind of automated testing method of the APP power consumption of android equipment
CN107122219A (en) The acquisition methods and device of installation file
CN106970787A (en) A kind of automobile controller rapid prototyping implementation method
CN105591779A (en) Method and device for inspecting network element
CN103678075A (en) Complex microprocessor test method based on automatic vector generation technology
KR20240047468A (en) ECU upgrade method and device, and readable storage medium
CN106293687A (en) The control method of a kind of flow process of packing, and device
CN103294482B (en) Web service method for packing and system for PWscf concurrent computational system
CN102033751B (en) Software adaptation method and system for OSD, and multimedia terminal
CN104657136B (en) The integrated system of Simulink components
CN114327405A (en) Data processing method, device, equipment and storage medium
CN116090376B (en) Chip integrated verification component development method and device and computer equipment
CN103440133A (en) Development method and system of chip testing software
CN105183485A (en) Visual software and hardware collaborative development method
CN102043628A (en) Method and system for developing on screen display (OSD) application software and multimedia terminal
Lee et al. A New Integrated Software Development Environment Based on SDL, MSC, and CHILL for Large‐scale Switching Systems
Posadas et al. System synthesis from UML/MARTE models: The PHARAON approach

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20170721