Integrated modelling and simulation method of a cargo door actuator

: An integrated Matlab model comprising of an electro-mechanical actuator (EMA) model, load model and state model has been constructed to investigate the cargo door actuator motion control, operation and working states, of which, a Simulink® servomotor system model is adopted to mimic the EMA actuator, a SimMechanics® model is used to compute the actuator's load, a Stateflow® state transition model is employed to simulate the working process. The results indicated that the motion is well controlled, generated load force is valid, working states and their transition logics are reasonable. The simulation verified the effectiveness and easiness of the integrated modelling method.


Introduction
The cargo door of C919 aircraft is designed to be externally upturned [1], and the load is mostly generated by gravitational potential energy. A linear electro-mechanical actuator (EMA) scheme has been adopted for driving the cargo door, whose control law falls in the closed-loop classification responding to a load matched position-velocity curve [2][3][4]. While working, the actuator receives the door-state signals (close/latch/lock), residual pressure signal, weight-on-wheels (WOW) signal to process when the condition is satisfied, and the ground crew can operate the door-switching button on the control panel to open/close/calibrate the cargo door; meanwhile, working state and failure information can be displayed on the control panel [4,5].
For the above application scenarios, it is necessary to carry out a research on motion control, load calculation and operation and working states simulation for the cargo door actuator.
There are many researches on motion control field of EMAs, among which literature [6] has carried out the motion control and load matching design for an aircraft used cargo door actuator, and optimised the corresponding velocity curve. Literature [7] developed a micro-EMA which adopted an ideal servomotor model for motion control simulation. In the above research, the load characteristics are calculated by geometrical analysis, which are suitable for the uncomplicated occasions.
It is difficult to establish an analytical load model for non-linear and complicated cases; furthermore, building dynamics equation needs professional knowledge. In order to study the relationship between control and load (force/inertia), many scholars adopted united simulation using different software. In literature [8][9][10], Matlab for controller modelling and Admas/AMESim for mechatronic/hydraulic/load modelling have been investigated. However, it is necessary to import the 3D model into the thirdparty software, then setting up the interface with Matlab, which is relatively complex to realise.
In addition, the EMAs are mainly studied on motion control and lack of state and strategy simulation. This can be solved by referring to the application case of finite state machine simulation in the vehicle industry [11][12][13][14].
To solve the above problems, an integrated Matlab modelling scheme comprising of control, load and state models has been adopted in this paper, which has the advantages of data sharing, easy implementation, and can take advantage of incremental modelling for the gradual refinement and verification. In addition, the advantage of an integrated Matlab model is that it can utilise optimisation toolbox for system-level multi-disciplinary parameter optimisation.

Requirements and scheme
The test system of the actuator (here and after, 'actuator' indicates the 'cargo door actuator') is shown in Fig. 1, which is composed of a load bench, an actuator and an operation panel. Among them, the load bench is composed of two assemblies: a fixed frame and a load mechanism to simulate the cargo door (later called load). The load is connected to the frame with the revolute joint 1. The actuator is located between the load and the frame, connected by revolute joints 2 and 3 separately; actuator is simplified as a prismatic joint 4 with driving ability. The control panel can provide operation inputs and state indications.
In order to carry out actuator motion control and operation state simulation, the following modelling factors need to be considered:  To sum up, the adopted Matlab modelling solution can be shown as follows: • A general linear EMA model is selected. From the perspective of incremental modelling, the model is divided into a control model and an actuating mechanism model (inertia equivalent to the motor axis). They are built in Simulink® and their parameters are calibrated according to the design values. • The load model is processed and constructed using SimMechanics®; a model based on position-force dynamics can be formed. What is more, it has the ability of 3D visualisation. • The state model based on the state machine theory can be built in Stateflow®. The input and output interface for control panel is constructed with Simulink Dashboard components and a realtime configuration should be setup. Thus, the working state simulation and virtual operation can be realised.

Actuator model
In the actuating mechanism, an ideal model is adopted for the motor, the mechanism's total inertia is equivalent to the inertia on motor axis and the load force is converted into the equivalent torque on motor axis according to the transmission ratio. As a result, the model of the actuating mechanism is shown in the following formula: Of which, the mechanical system model parameters are defined as follows: The electromechanical coupling parameters are defined as: k e : anti-speed constant, V/rad/s; k t : torque constant, Nm A.
Using the Laplace transform for the differential equation formula (1), the transfer function of the motor servo system can be obtained, which can be directly converted into the Simulink® model. In order to simplify the processing, friction is converted into motor efficiency in this paper, meanwhile a conversion module from actuator linear force to motor torque and an instruction PWM are added. Above actions generate a model shown in Fig. 2. The model takes the duty cycle instruction of voltage as input, the motor speed as output and the physics between load and servo system runs based on (1). The controller model adopts a position-velocity curve plan [6] and PID closed-loop control law, as shown in Fig. 3. The difference between planned and actual velocity can be used as the input of velocity PID control, which is normalised to facilitate the adjustment and optimisation of PID parameters (k p , k i , k d ).
Considering the combination with operational variables, steering control variable and enabling variable are introduced.
After the construction and encapsulation of the above actuation mechanism and controller model, an actuator model capable of driving the load model according to instructions can be formed which can realise the simulation of actuating function.

Load model
The load force can be taken as the input variable in upper section, and the resultant force formed by the load gravity and inertia needs to be calculated in real time. When the analytical mode is adopted, kinematics and dynamics of load motion need to be established, which is difficult and prone to emerge human factor errors; this method is suitable for linear scenarios with easy calculation equation. In order to avoid the above problems, specialised dynamics software can be usually used to automatically calculate the load generated by the position and velocity.
SimMechanics (SM) toolkit of Simulink is used to build and calculate load dynamics to realise an integrated modelling. The implementation method is shown as follows: export model files representing the physical and assembly properties that meet the SM requirements from Creo® (or other 3D software); then using the 'SM import' command to generate the SM model and modify some physical properties according to the simplified or actual conditions, setting simulation parameters, establishing input and output interface; finally packaging them into sub-modules to interact with the actuator model. The constructed load model and its corresponding relationship are shown in Fig. 4. The upper part is the imported 3D visual model and the lower part is the SM model. The listed SM number corresponds to the numbered joints in the 3D model and the joints are connected to the corresponding solid model (*_RIGID). The left side of the SM model from top to bottom defines the world coordinate system, gravity direction and configuration of SM solver, respectively. The straight joint 4 is set as the forward dynamics joint, that is the input is the position curve and the output is the load force. The other three joints are passive joints.
Through the construction of the load model, a 3D visualised dynamics model can be realised, which can automatically calculate the linear load force applied to the actuator.

State model
The state simulation of cargo door actuator rarely appears in various researches. However, due to the complex scheduling logics, it is difficult to find and modify design errors at an early stage, so the test troubleshooting is usually carried out in development stage, which is not economical. Using Stateflow can quickly carry out task scheduling design and modification, monitoring design, fault management simulation and so on, meanwhile integrate with the above models coordinately. The working state of the cargo door actuator is mainly divided according to the system input and output, failure mode and actuation strategy: the actuator input signals including cargo door close/latch/lock, residual pressure, WOW, power and operation switch, among which, operation switch is on/off/stop mode; outputs are various indicator lights, actuators actuation states (stop/ expand/contract); fault level and corresponding processing mode for built in test; two modes of actuation: normal open/close door actuation and return to zero actuation (calibration).
After comprehensive consideration of the above contents and the simulation elements, five states (power off, initialisation, stop, normal drive and calibration drive) are designed. Considering the completeness of the state transition, the transition conditions between states are formed and the state machine chart is shown in Fig. 5.
Through the construction of the state model, a state machine that can carry out state and transition simulation is implemented, thus schedule logics analysis can be carried out in an early stage, which could modify the unstable running state and operation as soon as possible.

Model integration
The above three models are encapsulated into sub-models, including actuator model (controller and actuation mechanism), load model and state model. Adding control panel (switch and indicator light, dashboard components), input and output variable, initial displacement setting module and so on, then setting simulation mode as a real-time mode, and finally we can obtain an integrated simulation model, as shown in Fig. 6 The integrated model covers the actuator mechatronic model, control law, load dynamics, state machine. The simulation can explore multiple fields, including but not limited to control parameters regulation, virtual operation and fault management and so on.

Load model verification
The physical properties and force calculation of the load bench are consistent with [6] for comparison. In the load model, the load block is set as 135.9 kg, and the frame defined as ground is set to 1000 kg. To avoid solver errors, the actuator and load block connecting rod are set to 0.01 kg.
Simulated load force can be automatically calculated with Matlab built-in inverse dynamics solver, employing a slope function to drive the load. The load model simulation and comparison results are shown in Fig. 7; the 'SimLoadForce' is consistent with the 'CalcLoadForce' value, which verifies the effectiveness of the load dynamics model and proves that can replace the complex construction process of geometry analytical model, thus solved the problem of automatic load calculation imposed on the actuator.

Actuator model verification
Trapezoid planned speed curve that drives the actuator and load is used to verify actuator model. The simulation result is shown in Fig. 8. A speed error appeared at the beginning due to the sudden load force, then the actuator can quickly adjust speed to keep tracking planned curve, which verified the effectiveness of the actuator model.

State model verification
A comprehensive real-time simulation and virtual operation are implemented, and the sequence is as follows: The simulation result is shown in Fig. 9.
(i) When t = 0 s, the load (cargo door) is initialised to a non-close start position, press the 'power' button, the actuator enters to the stop state after initialisation, LT turns on and FD flickers in a fixed frequency cause it reminds operator to calibrate the door.   The results show that the working state transition of the actuator is reasonable, the operating response is correct and the actuating process is effective. The problem of missing operation and fault simulation is solved. The validity of the integrated model is verified. Simulation video is available from the first author.

Conclusion
An integrated modelling and simulation of the mechatronic model, load model and state model of cargo door actuator based on Matlab® has been carried out in this paper. This research can solve the problem of automatic load dynamics calculation, which can replace manual calculation; it can also realise the function of working state and fault management simulation, which provides a strong support for the analysis of high level working state, and even for the implementation of low level code. The integrated model in this paper is simple and effective, which provides a useful reference for the modelling and simulation of relevant actuators.