Method of controlling a mechatronic system

The method addresses the challenges of maintaining stability and adaptability in mechatronic systems by using a prediction model and cost function with barrier functions, optimized through the Nelder-Mead method, to achieve efficient and adaptive control.

FR3140181B1Active Publication Date: 2025-05-23CENT NAT DE LA RECH SCI (C N R S) +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2022009757
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2025-05-23
Estimated Expiration
2042-09-27

Smart Images

  • Figure 00000023_0000
    Figure 00000023_0000
  • Figure 00000023_0001
    Figure 00000023_0001
  • Figure 00000023_0002
    Figure 00000023_0002
Patent Text Reader

Abstract

Method for controlling a mechatronic system One aspect of the invention relates to a method 100 for controlling a mechatronic system, based on a model for predicting the behavior of the mechatronic system and a cost function ensuring that constraints are respected by the mechatronic system for tracking a trajectory setpoint during a prediction horizon, the method comprising: reformulating 10 the constraints into barrier functions and integrating the barrier functions into the cost function; andfor each sampling period of a sequence of sampling periods:obtaining 20 the trajectory setpoint and at least one measurement of the mechatronic system at a current state;determining 30 of the coefficients of an order polynomial by a Nelder-Mead method optimizing the cost function based on the prediction model, the determination taking as input the trajectory setpoint and the at least one measurement of the mechatronic system obtained 20;calculate 40 a command by evaluating the polynomial; andapply 50 the command to the mechatronic system. Figure to publish with the abbreviation: Figure 1;
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: Method for controlling a mechatronic system TECHNICAL FIELD OF THE INVENTION

[0001] The technical field of the invention is that of automation and in particular mechatronic systems.

[0002] The present invention relates to a method for controlling a mechatronic system and in particular to a method for controlling a mechatronic system based on a model for predicting the behavior of the mechatronic system. TECHNOLOGICAL BACKGROUND OF THE INVENTION

[0003] The field of mechatronics combines mechanics, electronics, automation and real-time computing. The interest of this interdisciplinary engineering field is to design automatic systems and to enable the automatic control of complex systems.

[0004] A mechatronic system comprises at least two subsystems: an operative part and a control part. For example, a mechatronic system comprises an electric motor carrying a mechanical load, which corresponds to the operative part of the system, the position and / or speed of which is measured with a position and / or speed sensor. In this example, the operative part will be the electric motor, the mechanical load as well as the sensors. In order to actuate the motor, a control voltage, expressed for example in volts, is applied to the motor. The actuation of the motor causes a change in the position of the mechanical load. The control part may for example comprise a corrector, which from a measurement, will determine the command(s) sent to the operative part. The so-called adaptive corrector will also adapt the corrector's parameters to have an operation that depends on the environmental conditions in order to follow a setpoint.In addition, this corrector will reject external disturbances determined from one or more measurements in order to allow the mechatronic system to follow an instruction by generating one or more commands sent to the operative part. For the sake of simplicity, the term "mechatronic system" may be used to designate the operative part of the mechatronic system when the command is applied to the operative part.

[0005] An example of a mechatronic system is the gyro-stabilized sight. A gyro-stabilized sight is an optronic system that allows observation at very great distances in a precise direction. The gyro-stabilized sight can, for example, be mounted on a vehicle. The purpose of the sight, in this case, is to maintain the orientation of a load. mechanical (for example, an optronic device such as a camera) carried by motors, fixed despite the movements of the vehicle. Several sight architectures are possible [Masten M., 2008, Inertially stabilized platforms for optical imaging Systems: Tracking dynamic targets with mobile sensors. Control Systems, IEEE. 28. 47 - 64. 10.1109 / MCS.2007.910201], which is incorporated by reference in the application. One of the most common sight architectures consists of using inertial sensors, such as gyrometers, carried by the mechanical load in order to control the absolute speed of the mechanical load; Thus, the load becomes inertial except for imperfections and disturbances related to environmental conditions.

[0006] Viewfinders, and in particular single-stage stabilization viewfinders, are a typical application of adaptive control, in particular because of: - the variety of the employment environment which is the seat of disturbances which can destabilize this targeted inertia, - system wear, - dispersion on assembly lines, - the cost of developing the servos for these sights, which is significant in the event of a change in mechanical definition and high-level specifications.

[0007] An active mini-stick, a flap actuation system, a horizontal plane actuation system, a spoiler rotary actuator, a reverse actuator such as the eTRAS model (for "Electrical Thrust Reverser Actuation System") manufactured by the Safran group, a camera autofocus and an inertial viewfinder are other examples of mechatronic systems.

[0008] In order to control the mechatronic system, a trajectory instruction is provided to the system. A trajectory instruction is a sequence of states that the mechatronic system must follow. A trajectory instruction can be defined for example by a target position and / or speed that the mechanical load of the mechatronic system must follow. In the case of the gyro-stabilized sight, a trajectory instruction is the precession speed profile that the sight must follow.

[0009] The tracking of this trajectory instruction by the mechatronic system requires the implementation of a control loop. The general principle of a control loop is to compare the trajectory instruction and the state of the system in order to correct it effectively. Thus, from the difference between the trajectory instruction and the current state of the system, a corrector calculates the next command to be applied to the motor so that the mechatronic system follows the trajectory instruction. For a gyro-stabilized sight, an example of a command is the voltage, in volts, applied to the terminals of the motor.

[0010] The way in which the mechatronic system must follow this instruction can be constraint. This constraint is for example defined by high-level requirements and / or more generally product specifications. A high-level requirement is a constraint, formulated by the user, on the behavior of the mechatronic system during the use phase. A high-level requirement can result directly from the product specifications. A high-level requirement can correspond to the required stability of the mechatronic system or to the power consumption of the mechatronic system while following the trajectory setpoint. In the case of a gyro-stabilized sight, examples of high-level requirements can consist of: - limit the standard deviation of the position error obtained by integrating the absolute speed tracking error, - limit the peak value of the position error obtained by integrating the absolute speed tracking error, - limit the standard deviation of the motor voltage, and - limit the peak value of the motor voltage.

[0011] A high-level requirement can have different objectives. For example, for the gyro-stabilized sight, the high-level requirement "bound the standard deviation of the position error obtained by integrating the velocity tracking error" ensures that the sight is sufficiently precise so that the target seen by the optical or op-tronic device is sharp, while "bound the peak value of the motor voltage" ensures the integrity of the motor.

[0012] The current state of the system may be evaluated from at least one measurement. For example, the current state of a mechatronic system may be evaluated from measurements including a measurement of its absolute position and / or speed. With respect to a gyro-stabilized sight, a measurement used may be, among other measurements such as the motor current, the absolute speed of the sight, measured by a gyrometer.

[0013] In order to evaluate the current state of a system, it is known to use an observer. The role of an observer is, for example, to allow the current state of a system to be reconstructed or estimated in real time from the available measurements. Thus, it is possible that the measurements obtained cannot be processed directly by the control part of the mechatronic system and that an observer must be added to estimate the state of the system. It should be noted that an observer also makes it possible to estimate the unmeasured states of a system, and also to replace expensive or difficult-to-maintain sensors. Using an observer, the current state of the system can be evaluated from position and / or speed measurements alone.

[0014] In order to control a mechatronic system, and in particular a gyro-stabilized sight, while respecting high-level requirements, the sampling frequency of the control loops and the bandwidth of the mechatronic system must be sufficient extremely high. For example, the minimum sampling rate required may be at least 50 hertz (Hz), 500 hertz (Hz), or any frequency between 50 and 500 hertz (Hz). The computation time of the corrector is often critical to obtain a sufficiently high sampling rate. It is also known in the field of mechatronic systems that the sampling rate of the control loops must be at least 10 times higher than the bandwidth of the mechatronic system and preferably at least 20 times higher than the bandwidth of the mechatronic system.

[0015] To achieve a sufficiently high sampling frequency, the control of a mechatronic system is usually carried out via a static digital corrector. A static digital corrector is a corrector whose parameters are defined before its use and which do not change during its use. Thus, it is common for the parameters of these correctors to be defined during the design and then no longer modified during its use phase.

[0016] Techniques have already been implemented to optimize the parameters of the correctors, based in particular on modeling of the mechatronic system. These parameterization techniques are used during the development and fine-tuning phases of the mechatronic system, but are not integrated into the control loops and used during the use phase. The correctors thus developed are defined to cover a range of ignorance of the system to be controlled and its evolution over time, and this, for requirements fixed before the use phase, or even before the development phase of the mechanical system.

[0017] In addition, a mechatronic system must guarantee sufficient stability. For a simple definition, a system is stable if in response to a bounded input, the output of the system is bounded. In order to guarantee the stability of the controlled system, the correctors are designed in such a way as to give the resulting control loop significant stability margins, thus limiting the performance of the mechatronic system.

[0018] In order to have a functional control over the entire life of the system, it is necessary to develop a robust control, with respect to its potential evolutions, assumed to be limited. This robustness is obtained at the expense of the performance of the system. The correctors commonly used are thus developed specifically for a product and are sub-optimal in order to increase the robustness of the control. In other words, by implementing sub-optimal correctors it is possible to obtain robust correctors which can be used despite the appearance of different scenarios during their use such as the dispersion of the components of the system, variations in the external environment, the aging of the system to be controlled, etc. This is the principle of increasing the robustness of the corrector by reducing the performance of the system.

[0019] To better account for environmental variations, such as temperature, pressure, vibration, etc., it is possible to use additional sensors and / or observers. These additional sensors or these observers will provide additional data in order to feed adaptive robust techniques. Thus, these methods make it possible to obtain robust controllers that adapt to environmental variations. However, with current controllers, when a controlled system is changed to the platform on which it is based or when high-level requirements are modified, the controller must be adjusted again to adapt to the new environment and / or the new high-level requirements.Thus, the transition from the use of a gyro-stabilized sight on an airplane to use on a helicopter is not immediate because the vibration spectra are different, that is to say that from the point of view of the mechatronic system comprising the sight, its disturbances, in this case the vibrations, are different and the mechatronic system requires a new initialization phase. An initialization phase is a phase during which the parameters of the corrector are initialized so that its behavior is adapted during the following phase of use.

[0020] A known example of a robust adaptive technique is the linear parameter varying formalism, called in English "Linear Parameter Varying" (LPV). A first drawback concerning the LPV formalism is the difficulty in proving the stability of this technique in the presence of observers. In addition, the LPV formalism does not adapt to variations in high-level requirements: when the latter change, it is then necessary to restart a process of design and adjustment of the corrector, as well as an entire validation and qualification phase, which is very time-consuming and costly. In other words, the LPV formalism does not make it possible to obtain a corrector, called self-adaptive, having the capacity to adapt both to variations in the environment and to variations in constraints linked to high-level requirements and / or specifications during the use phase of the mechatronic system.With gyro-stabilized sights, it is not possible with current control methods to perform self-adaptive control.

[0021] In addition, manufactured and / or assembled mechatronic systems may exhibit non-conformities in terms of performance, particularly due to part tolerancing problems. This may require either costly rework or even rejects. The usual correctors do not, or only very little, allow for compensating for manufacturing defects causing non-conformities with performance requirements.

[0022] A known control method for the control of a mechatronic system is predictive control described in the document [Rawlings, JB, Mayne, DQ, and Diehl, M. (2017). Model Predictive Control: Theory, Computation, and Design. Nob Hill Publishing. Reble, M. and Allg], which is incorporated by reference into this application. A predictive control is a process that, for each sampling period, determines a sequence of future commands making it possible to obtain an optimal predicted future behavior, with respect to a specification, of the mechatronic system. Thus, a predictive control aims to solve online a constrained optimization problem, potentially non-linear, making it possible to define the best command to apply to achieve control of the system. The behavior is predicted using a prediction model of the mechatronic system. The behavior considered optimal is evaluated by minimizing a cost function by an optimization algorithm.The cost function makes it possible to determine what is considered optimal for the system's behavior: following the trajectory instruction by following a reference trajectory while best satisfying the constraints reflecting the high-level requirements. Thanks to the minimization of the cost function, the optimization algorithm used in predictive control therefore makes it possible to determine the optimal future control sequence in view of compliance with the constraints.

[0023] A prediction horizon is a duration in the future for which the trajectory instruction to be followed is known. It can for example be a multiple of the sampling period. In practice, the prediction horizon is generally at least 20 times greater than the duration of the sampling period. For a prediction horizon of n sampling periods, the sequence of commands to be determined consists of n commands, one per sampling period. [Fig. 6] is a graph showing an example of command values ​​(C) as a function of time (T). The present time is represented by the hatched line 600 and the prediction horizon is the duration between the hatched line 600 and the hatched line 690. The commands 610 have already been applied to the system. Commands 620, 630, 640, 650, 660 and 670 are the commands predicted at the present time so that the mechatronic system follows the trajectory instruction for the prediction horizon. Thus in [Fig.6], the prediction horizon consists of 6 sampling periods..

[0024] For each sampling period, the sliding horizon principle is applied: only the first command of the determined command sequence is applied to the mechatronic system. This sliding horizon principle ensures that the command is ultimately optimal at the current instant.

[0025] It should be noted that the predictive control as presented in Rawlings et al., 2017, cannot address the problem of variations in constraints related to high-level requirements and / or specifications during the use phase of the mechatronic system. Indeed, the predictive control as presented in Rawlings et al., 2017 does not take into account any type of high-level requirements and / or specifications complex and potentially non-derivable functions. Thus, in order to add new features integrating a viewfinder within a more complex and intelligent system, it is not possible to recalibrate the viewfinder during its use phase in the event of a change in specifications.

[0026] Other techniques derived from artificial intelligence, such as reinforcement learning techniques, exist to control a mechatronic system. However, taking into account high-level requirements is very complex and stability is absolutely not guaranteed by these techniques.

[0027] There is therefore a need to provide a method for controlling mechatronic systems that addresses the problems mentioned above. Summary of the invention

[0028] The invention offers a solution to the problems mentioned above, by making it possible to control, in a stable manner and at a high sampling frequency, a mechatronic system.

[0029] One aspect of the invention relates to a method for controlling a mechatronic system, based on a model for predicting the behavior of the mechatronic system and a cost function ensuring that constraints are respected by the mechatronic system for following a trajectory instruction during a prediction horizon, the method comprising: - reformulate the constraints into barrier functions and integrate the barrier functions into the cost function; and - for each sampling period of a sequence of sampling periods: • obtain the trajectory instruction and at least one measurement of the mechatronic system in a current state; • determine coefficients of a polynomial of order m by a Nelder-Mead method optimizing the cost function based on the prediction model, the determination taking as input the trajectory instruction and at least one measurement of the mechatronic system obtained; • calculate an order by evaluating the polynomial; and • apply the command to the mechatronic system.

[0030] Thanks to the invention, the calculation time of the control depends on the order m of the polynomial which can be determined by a user according to the sampling frequency necessary for the proper functioning of the servocontrol. The use of the Nelder-Mead method [Nelder and Mead, 1965: “a simplex method for function minimization”, Computer Journal, vol. 7, no. 4, p308-313] to determine the coefficients of the polynomial makes it possible to obtain a sufficiently high sampling frequency, due to the reduction in calculation time that the Nelder-Mead method allows, for the control of a mechatronic system for an order m less than or equal to 3 with an Intel® Core™ i7 processor. Thus, the implementation of this control method in an embedded system is facilitated. In addition, the use of the Nelder-Mead method makes it possible to obtain a stable control method. Finally, the cost function integrating barrier functions as described in this application allows the constraints to be respected by the mechatronic system when following a trajectory instruction.

[0031] In addition to the characteristics which have just been mentioned in the preceding paragraph, the control method according to one aspect of the invention may have one or more complementary characteristics among the following, considered individually or according to all technically possible combinations: - the control method further comprises a prior step of initializing the prediction model comprising a determination of the values ​​of a set of parameters of the prediction model using an identification algorithm taking as input a sequence of step commands of random amplitude and duration and a set of measurements of the mechatronic system, each measurement of the set of measurements of the mechatronic system being carried out after the application of each command of the sequence of commands to the mechatronic system, - the Nelder-Mead method optimizing the cost function is based on a polytope of m + 1 vertices, with m the order of the polynomial, whose m + 1 vertices are constrained within a predetermined range of values ​​[xmin, xmax] for any evolution of the polytope during optimization, - the order m of the polynomial is between 2 and 20, preferably 3, - obtaining the trajectory instruction and at least one measurement of the mechatronic system at a current state further comprises a real-time estimation of a current state of the mechatronic system from the at least one measurement of the mechatronic system obtained, the estimation being carried out by an observer included in the mechatronic system, - the control method further comprises, for at least one sampling period of the sequence of sampling periods different from a first sampling period of the sequence of sampling periods, the steps of: • before determining the coefficients of the polynomial, the replacement of the barrier functions by new barrier functions, the new barrier functions being a reformulation of new constraints; • after obtaining the trajectory instruction and at least one measurement of the mechatronic system and before determining the coefficients of the polynomial, a step comprising: • save at least one measurement of the mechatronic system obtained in a first variable; • determine a value of the parameters of the prediction model based on an identification algorithm taking as input: • at least a portion of the at least one measurement of the mechatronic system obtained during previous sampling periods saved in the first variable; and • at least part of the first commands applied to the mechatronic system during previous sampling periods saved in a second variable; and • replace a current value of the parameters of the prediction model with the determined value; and • after calculating the order: • save the calculated command in a second variable.

[0032] Another aspect of the invention relates to a mechatronic system comprising: - a processor implementing the control method according to the invention; and - a system adapted to obtain at least one measurement of the mechatronic system.

[0033] Another aspect of the invention relates to a gyro-stabilized sight comprising: - a processor implementing the control method according to the invention; and - a system adapted to obtain at least one measurement of the gyro-stabilized sight.

[0034] In addition to the characteristics which have just been mentioned in the last two paragraphs, the mechatronic system and / or the gyro-stabilized sight may also comprise a memory allowing the saving of data, this memory being coupled to the processor. This memory is for example adapted to store the first and the second variable of the steps of saving the at least one measurement of the mechatronic system obtained in a first variable and the calculated command in a second variable.

[0035] Another aspect of the invention relates to a computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement the method according to the invention.

[0036] Another aspect of the invention relates to a computer-readable recording medium comprising instructions which, when executed by a computer, cause the latter to implement the method according to the invention.

[0037] The invention and its various applications will be better understood upon reading the following description and examining the accompanying figures. BRIEF DESCRIPTION OF THE FIGURES

[0038] The figures are presented for information purposes only and in no way limit the invention. - [Fig.l] shows a schematic representation of the method of controlling a mechatronic system according to the invention. - Figures 2 to 5 show a schematic representation of variants of the invention. - [Fig.6] is a graph showing an example of command values ​​(C) as a function of time (T). - [Fig.7] is a graph showing an example of command values ​​(C), calculated by evaluating a polynomial, as a function of time (T). DETAILED DESCRIPTION

[0039] Unless otherwise specified, the same element appearing in different figures presents a unique reference.

[0040] [Fig.l] shows a schematic representation of the method 100 for controlling a mechatronic system according to the invention.

[0041] The control method 100 may be implemented by a computer or by a processor. By "computer implemented" is meant that the steps, or substantially all of the steps, are executed by at least one computer or processor or any other similar system. Thus, steps are performed by the computer, possibly fully automatically, or semi-automatically. In examples, the triggering of at least some of the steps of the method may be performed by user-computer interaction. The level of user-computer interaction required may depend on the intended level of automation and balanced against the need to implement the user's wishes. In examples, this level may be user-defined and / or predefined.

[0042] A typical example of a computer implementation of a method is to execute the method with a system adapted for this purpose. The system may comprise a processor coupled to a memory and a graphical user interface (GUI), the memory having recorded thereon a computer program comprising instructions for implementing the method. The memory may also store a database. The memory is any hardware adapted for such storage, possibly comprising several distinct physical parts.

[0043] The control method 100 is based on a prediction model of the behavior of the mechatronic system. The prediction model is a mathematical model of the mechatronic system to be controlled. Several prediction models exist, such as those based on neural networks or linear models. The invention can be used with these existing prediction models. The model for predicting the behavior of the mechatronic system allows the simulation of the actual behavior of the mechatronic system. Thus, the prediction model allows, from one or more input values, to obtain a prediction of an output corresponding to the state in which the mechatronic system would be if the input values ​​were actually applied to it. For example, in the case of a gyro-stabilized sight, the input and output types of the prediction model are identical to those of the sight: - the input is the voltage applied to the terminals of the motor, - the output used is the absolute speed of the sight measured by a gyrometer.

[0044] Concerning the output used for a gyro-stabilized sight, it is also possible to measure the absolute angular position of the gyro-stabilized sight

[0045] The control method 100 is also based on a cost function ensuring that constraints are respected by the mechatronic system for tracking a trajectory instruction during a prediction horizon. The cost function used in the present invention makes it possible to ensure that constraints are respected by the mechatronic system for tracking a trajectory instruction because it integrates barrier functions such as those described in [Wills, AG and Heath, WP (2004). Barrier function based model predictive control. Automatica, 40(8), 1415-1422], which is incorporated by reference into the application.

[0046] The term “constraints” here translates the high-level requirements which arise from the system specifications and / or directly from the system specifications.

[0047] The tracking of the trajectory instruction here corresponds to a reduction of the difference between the n predicted states of the mechatronic system and the sequence of the next n trajectory instructions. The difference between these two elements is then minimized over the entire prediction horizon.

[0048] The cost function translates the constraints that the mechatronic system must respect. The cost function also translates an optimization of the tracking. Thus, the cost function makes it possible to determine what is considered to be optimal for the behavior of the system: follow the trajectory instruction by approaching a reference trajectory as closely as possible while ensuring compliance with the constraints.

[0049] The method 100 comprises reformulating 10 the constraints into barrier functions and integrating the barrier functions into the cost function. Thus, the constraints, provided by the user, are reformulated into barrier functions in order to be taken into account in the cost function. In one example, each constraint is reformulated into a barrier function. Wills and Heath, 2004 presents a control method including weighted barrier functions in the cost function. The barrier functions, as presented in Wills and Heath, 2004, ensure that the constraints are strictly satisfied. The reformulation method presented in Wills and Heath, 2004 is compatible with the invention.

[0050] Steps 20, 30, 40 and 50 of the method 100 are performed for each sampling period of a sequence of sampling periods. The sequence of sampling periods corresponds to the phase of use of the mechatronic system or at least to a part of this phase of use. Each sampling period must therefore be reduced, for example less than 0.01 second or 0.001 second or even 0.0002 second.

[0051] The method 100 comprises obtaining 20 the trajectory setpoint and at least one measurement of the mechatronic system for the current sampling period. The trajectory setpoint can be provided by the user or determined semi-automatically or even automatically. It can be constant or different for several consecutive sampling periods or even for the entire sequence of sampling periods. In the case of a gyro-stabilized sight, the trajectory setpoint is the precession speed imposed on the sight, i.e. the speed profile that the sight must follow.

[0052] The at least one measurement of the mechatronic system can be obtained using one or more sensors. For example, the measurement used for a gyro-stabilized sight is the absolute speed of the sight measured by a gyrometer. The at least one measurement of the mechatronic system used by the corrector can also be calculated, i.e. reconstructed or estimated, using an observer.

[0053] The method 100 comprises the determination 30 of the coefficients of a polynomial of order m by a Nelder-Mead method optimizing the cost function based on the prediction model, the determination taking as input the trajectory instruction and the at least one measurement of the mechatronic system for the current sampling period.

[0054] During this step 30, the m coefficients of the polynomial are determined. The determination is carried out by optimizing the cost function described previously. The optimization is carried out by the Nelder-Mead method, described in the document Nelder and Mead (1965)], which is incorporated by reference in the application. The Nelder-Mead method makes it possible to optimize complex cost functions. The principle of the Nelder-Mead method is as follows: in order to minimize a function f(x), with x constrained in the interval X^,^,: a simplex is a polytope of s + 1 vertices in a 4-dimensional space. 4 is therefore the dimension of the optimization problem, i.e. the size of the vector x. Initially starting from such a simplex, it undergoes simple transformations during the iterations depending on what it discovers about the function f(x).The simplex deforms, for example by undergoing expansions and / or contractions and / or reflections, it moves and shrinks. progressively until its vertices approach a point where the function f(x) is locally minimal.

[0055] In other words, at each iteration, the optimization algorithm determines the parameters of the polynomial that make it possible to obtain the predicted behavior of the system as close as possible to the reference trajectory. Thus, the optimization algorithm contains three steps. The first step consists of determining the coefficients of the polynomial; these coefficients are the search parameters of the optimization algorithm and evolve at each iteration. The second step consists of evaluating the commands from the polynomial. The number of commands can correspond to the number of sampling periods included in the prediction horizon. The third step of the optimization algorithm consists of applying these commands to the prediction model. The fourth step consists of evaluating the cost function, i.e., comparing the predicted trajectory with the reference trajectory and taking into account the constraints in the form of barrier functions.

[0056] The determination 30 of the m coefficients of the polynomial takes as input the trajectory setpoint, the prediction model and the at least one measurement of the mechatronic system for the current sampling period. It is thus possible to evaluate the difference between the prediction of the state of the system and the trajectory setpoint.

[0057] Determining 30 the m coefficients of the polynomial makes it possible to obtain a polynomial whose evaluation ensures obtaining the sequence of n commands to be applied to the mechatronic system so that the system reaches the trajectory setpoint for the prediction horizon. The sequence of commands is made up of as many commands as the prediction horizon includes sampling periods. For example, if the prediction horizon is made up of n sampling periods, then the sequence of commands is made up of n commands. The evaluation of the polynomial can therefore make it possible to obtain the value of the 11 commands for the n sampling periods.

[0058] The method 100 comprises calculating 40 a sequence of commands by evaluating the polynomial. Thus, by evaluating the polynomial for the prediction horizon, the value of the command to be applied at the present time is determined.

[0059] [Fig.7] is a graph showing an example of command values ​​C as a function of time T. The present time is represented by the hatched line 600. The prediction horizon is the time between the hatched line 600 and the hatched line 690. The commands 610 have already been applied to the system. The evaluation of the polynomial 680 makes it possible to determine the commands 620, 630, 640, 650, 660 and 670 predicted at the present time so that the mechatronic system follows the trajectory instruction over the entire prediction horizon.

[0060] The method 100 comprises applying 50 the command to the mechanical system- electronics. The applied command 50 is the command to be applied at the present time. In other words, the applied command is the first command in the sequence of commands to be applied so that the mechatronic system follows the trajectory setpoint for the prediction horizon 690. In addition, the command is optimized to minimize the energy required when following the trajectory setpoint. With reference to [Fig.7], the command applied at step 50 is command 620.

[0061] In the context of a gyro-stabilized sight, the method 100 for controlling a gyro-stabilized sight is based on a model for predicting the behavior of the gyro-stabilized sight and a cost function ensuring that constraints are respected by the gyro-stabilized sight for tracking a trajectory instruction for a prediction horizon. The method comprises: - reformulate 10 the constraints into barrier functions and integrate the barrier functions into the cost function; - for each sampling period of a sequence of sampling periods: • obtain 20 the trajectory instruction and at least one measurement of the gyrostabilized sight in a current state; • determine 30 of the coefficients of a polynomial of order m by a Nelder-Mead method optimizing the cost function based on the prediction model, the determination taking as input the trajectory instruction and at least one measurement of the gyro-stabilized sight obtained 20; • calculate 40 an order by evaluating the polynomial; and • apply 50 command to the gyro-stabilized viewfinder.

[0062] The invention therefore aims to determine the coefficients of a polynomial whose evaluation makes it possible to obtain the control sequence to be applied so that the mechatronic system follows the trajectory setpoint during the prediction horizon. This thus makes it possible to obtain a mechatronic system control method whose calculation time depends on the number of polynomial coefficients to be determined, which influences the calculation time required for the method. The user can therefore, depending on the calculation time that he wishes to allocate to the control method, determine the order m of the appropriate polynomial. This determination of the order m of the polynomial could also be carried out semi-automatically or even automatically. In addition, the invention makes it possible to obtain a sequence of commands to be applied which minimizes the energy required when following the trajectory setpoint.

[0063] [Fig. 2] shows a schematic representation of a first variant. In this variant, the control method 100 further comprises a prior step 60 of initializing the prediction model. The initialization 60 comprises a determination mination of the values ​​of a set of parameters of the prediction model using an identification or learning algorithm taking as input a sequence of step commands of random amplitude and duration and a set of measurements of the mechatronic system. Each measurement of the set of measurements of the mechatronic system is carried out after the application of each command of the sequence of commands to the mechatronic system. The correspondence between each measurement carried out and each applied command is known. Thus, for each command there is a corresponding measurement, which can for example be grouped in pairs. These “command - measurement” pairs can be provided to the identification or learning algorithm for the determination of the values.In this application, the terms "learning" and "identification" are considered to designate any method aimed at obtaining a prediction model which "behaves like" the mechatronic system.

[0064] The initialization 60 can be carried out in different steps. [Fig. 3] shows a schematic representation of the different steps of the initialization 60. The initialization 60 of the prediction model is carried out at least in part during an initialization phase of the mechatronic system, different from the use phase of the mechatronic system. The first two steps 61 and 62 can be carried out before the start of the mechatronic system, i.e. before the initialization phase. The following three steps 63, 64 and 65 are carried out during the initialization phase, which requires the start of the mechatronic system.

[0065] Step 61 comprises a definition by the user of the high-level requirements from the product specification and the order m of the polynomial. The definition of the high-level requirements and / or the order m of the polynomial could also be carried out semi-automatically or even automatically.

[0066] Step 62 comprises for example the definition of the type of prediction model to be used. Different types of prediction models can be used such as neural networks or linear models. For example, if the chosen model is a neural network, the type of neural network used and the number of neurons are determined in this step 62. If a linear model is chosen, the order of the linear model is determined in this step 62. The choice of the type of prediction model to be used can be determined algorithmically or be defined by the user.

[0067] Step 63 includes defining a sequence of commands in steps of random amplitude and duration. It should be noted that the maximum amplitude and the maximum duration of each command in the sequence of commands must be consistent with the maximum amplitude admissible by the system and its response time. In other words, the maximum amplitude of each command in the sequence of commands must be less than a ratio of the maximum amplitude admissible by the system, the ratio being [between 1]. The maximum duration of each command in the command sequence must be greater than or equal to 5 times the system time constant. If a linear model was chosen in step 62, the sequence of stepped commands of random amplitude and duration may consist of a pseudo-random binary signal. A pseudo-random binary signal can be defined as a signal consisting of a sequence of elements, each of the elements having a binary value exhibiting a pseudo-random character: the binary value of each of its elements is independent of the others, but it is a periodic sequence, which makes it deterministic.

[0068] In step 64, the command sequence determined in step 63 is applied to the mechatronic system and at least one measurement of the state of the system is performed after the application of each command of this command sequence. In one example, the at least one measurement of the state of the system corresponds to the same at least one measurement that will be performed during step 20. For example, if the at least one measurement during step 20 consists of measuring the absolute speed of the sight measured by a gyrometer, a measurement of the absolute speed of the sight measured by a gyrometer will be performed after the application of each command of this command sequence during this step 64.

[0069] During step 65, the sequence of commands determined in step 63 and the sequence of the at least one corresponding measurement are used as input data to determine the parameters of the prediction model.

[0070] In one example, the initialization of the model is carried out on the basis of a recurrent neural network which makes it possible to represent dynamic systems. It is trained using an optimization algorithm based on a Levenberg-Marquardt type gradient. It is also possible to use a recurrent neural network with a linear activation function and in this case, the initialization of the model consists of an identification of a linear model by a recursive least squares algorithm.

[0071] In a second variant, compatible with the previous variant, the m + 1 vertices of the polytope on which the Nelder-Mead method is based are constrained in a predetermined interval of values ​​[xmin, xmax] for any evolution of the polytope during the optimization with for example xmin — - 106 and xmax = 106- The Nelder-Mead method as described in Nelder and Mead (1965) is unconstrained. In this second variant, the decision variables are constrained to remain in a well-defined search space in order to promote convergence. The Nelder-Mead method is then said to be constrained. Thus, for any evolution of the polytope described in Nelder and Mead (1965), the vertices of the latter are constrained to remain in the interval [xmin, xmax\. In other words, if XJ is one of the vertices then: Xj- mitimax^Xj, xmin), xma^, for / = 1, S + 1 for any evolution of the polytope.

[0072] With this second variant, the convergence time of the constrained Nelder-Mead method is reduced. Thus the calculation time of the control method using the constrained Nelder-Mead method can be further reduced.

[0073] In another implementation variant, compatible with the previous variants, the order m of the polynomial is between 2 and 5 and preferably equal to 3. The order m of the polynomial influences the calculation time required by the control method for each sampling period. Thus, the greater the order m of the polynomial, the greater the calculation time.

[0074] The prediction horizon for a mechatronic system is for example at least equal to 20 sampling periods. Thus, for a conventional control method in which the command sequence to be determined comprises 20 commands, the optimization algorithm searches for the set of future commands to be applied to the system, i.e. 20 parameters. In the present invention, for a prediction horizon of the same duration, with a polynomial of order 3, only 3 parameters are searched for by the Nelder-Mead method or the constrained Nelder-Mead method. Thus the calculation time for determining the parameters is reduced compared to the conventional control method.

[0075] An implementation on an Intel® Core™ i7 processor of the control method for a gyro-stabilized camera using the constrained Nelder-Mead method with a polynomial order m equal to 3 is compatible with a sampling frequency of at least 400 Hertz.

[0076] In a variant, compatible with the preceding variants, obtaining 20 of the control method 100 further comprises a real-time estimation of a current state of the mechatronic system from the at least one measurement of the mechatronic system for the current sampling period carried out by an observer included in the mechatronic system. For example, the observer will make it possible to interpret the at least one measurement of the mechatronic system which is not necessarily directly interpretable by the corrector. Thus, the observer will make it possible to determine the state initiating the prediction of the system in the optimization process.

[0077] An implementation variant of the method 100, compatible with the preceding variants, comprises several additional steps, for at least one sampling period of the sequence of sampling periods different from the first period of the sequence. In a first implementation example, all the sampling periods, except the first sampling period, of the sequence of sampling periods contain the steps 20, 30, 40, 50, 70, 80 and 90 or contain at least the steps 20, 30, 40 and 50, 81 and 90. In a second example, an alternation between one or more sampling periods containing steps 20, 30, 40 and 50 and one or more sampling periods containing steps 20, 30, 40, 50, 70, 80 and 90 may be predetermined automatically. The alternation may also be triggered automatically or by user-computer interaction. Another example implementation could be alternating between one or more sampling periods containing steps 20, 30, 40 and 50, 81 and 90 and one or more sampling periods containing steps 20, 30, 40, 50, 70, 80 and 90. [Fig.4] shows a schematic representation of this implementation variant.

[0078] In this variant, a first replacement step 70 is added before the determination 30 of the coefficients of the polynomial. This replacement step 70 consists of replacing the barrier functions of step 10 with new barrier functions, the new barrier functions being a reformulation of new constraints. These new constraints replace the constraints initially provided. In other words, in this implementation variant, constraints different from those initially defined are integrated into the cost function during the use phase of the mechatronic system. The integration into the cost function in step 70 can be carried out in the same way as during reformulation 10.

[0079] In this variant, a second step 80 is added after obtaining 20 the trajectory instruction and the at least one measurement of the mechatronic system and before determining 30 the coefficients of the polynomial. Step 80 can comprise 3 steps 81, 82 and 83. This step 80 can be carried out before or after step 70. [Fig.5] shows a schematic representation of the different steps of step 80.

[0080] Step 81 consists of saving the at least one measurement of the mechatronic system for the current sampling period in a first variable.

[0081] Step 82 consists of determining a value of the parameters of the prediction model. In other words, in step 82, each parameter of the prediction model is defined by assigning it a value. This determination requires as input at least a portion of the at least one measurement of the mechatronic system obtained during previous sampling periods saved in the first variable and at least a portion of the first commands applied to the mechatronic system during previous sampling periods saved in a second variable. The at least one measurement of the mechatronic system obtained during previous sampling periods is saved in step 90. In order to use this data as input, the correspondence between each measurement of the mechatronic system and an applied command must be known.In other words, a "command - measurement" pair with the measurement that corresponds to the at least one measurement of the mechatronic system made after the command of the pair has been applied to the mechatronic system can for example be constructed and used by the identification algorithm. The determination . 82 can be performed in a similar manner as initialization 60, in particular the same identification algorithm can be used.

[0082] In a first example implementation of step 82, all measurements saved in step 81 and all commands saved in step 90 are used as input data. In a second example implementation of step 82, only measurements saved in step 81 for the last sampling periods and commands saved in step 90 for the last sampling periods are used as input data. For example, only measurements saved in step 81 and commands saved in step 90 of the last 10,000 sampling periods are used for determination 82.

[0083] Step 83 consists of replacing a current value of the parameters of the prediction model with the determined value of the parameters of the prediction model in step 82. In other words, a new value, which was determined in step 82, for each parameter of the prediction model is assigned to the different parameters of the prediction model. Thus the current values ​​of the different parameters of the prediction model are replaced.

[0084] A third step 90 is added after the calculation 40 of the command sequence. Step 90 consists of saving the first command of the command sequence calculated for the current sampling period in a second variable.

[0085] This implementation variant comprising steps 70, 80 and 90 makes it possible to obtain a self-adaptive control method. Thus, this implementation variant has the capacity to adapt both to variations in the environment and to variations in constraints linked to variations in high-level requirements and / or specifications during the use phase of the mechatronic system. Indeed, the calculation time remains sufficiently low even when a sampling period comprises steps 20, 30, 40, 50, 70, 80 and 90. An implementation of this variant on an Intel® Core™ i7 processor of the control method for a gyro-stabilized sight using a constrained Nelder-Mead method with an order m of polynomial equal to 3 has a sampling frequency at least equal to 400 Hertz.

Claims

Claims

1. Method (100) for controlling a mechatronic system, based on a model for predicting the behavior of the mechatronic system and a cost function ensuring that constraints are respected by the mechatronic system, for the mechatronic system to follow a trajectory instruction during a prediction horizon, the method comprising the steps of: reformulate (10) the constraints into barrier functions and integrate the barrier functions into the cost function; and for each sampling period of a sequence of sampling periods: • obtain (20) the trajectory instruction and at least one measurement of the mechatronic system in a current state; • determine (30) coefficients of a polynomial of order m by a Nelder-Mead method optimizing the cost function based on the prediction model, the determination taking as input the trajectory instruction and at least one measurement of the mechatronic system obtained (20); • calculate (40) a sequence of commands by evaluating the polynomial; and • apply (50) the first command of the command sequence to the mechatronic system. wherein at least one sampling period of the sequence of sampling periods different from a first sampling period of the sequence of sampling periods further comprises the steps of: - before the determination (30) of the coefficients of the polynomial, the replacement (70) of the barrier functions by new barrier functions, the new barrier functions being a reformulation of new constraints; - after obtaining (20) the trajectory instruction and at least one measurement of the mechatronic system and before determining (30) the coefficients of the polynomial, a step (80) comprising: • save (81) the at least one measurement of the mechatronic system obtained (20) in a first variable; • determine (82) a value of the parameters of the prediction model based on an identification algorithm taking as input: • at least a portion of the at least one measurement of the mechatronic system obtained (20) during previous sampling periods saved (81) in the first variable; and • at least part of the first commands of the calculated command sequences (40) to the mechatronic system during previous sampling periods saved (90) in a second variable; • replace (83) a current value of the parameters of the prediction model by the determined value; and after the calculation (40) of the command: • save (90) the first command of the calculated command sequence in a second variable.

2. Control method (100) according to claim 1 further comprising a prior step of initializing (60) the prediction model comprising a determination of the values of a set of parameters of the prediction model using the identification algorithm taking as input a sequence of step commands of random amplitude and duration and a set of measurements of the mechatronic system, each measurement of the set of measurements of the mechatronic system being carried out after the application of each command of the sequence of commands to the mechatronic system.

3. A control method (100) according to any preceding claim wherein the Nelder-Mead method optimizing the cost function is based on a polytope of m + 1 vertices, with m the order of the polynomial, the 1 vertices of which are constrained in an in- predetermined range of values [xmin, xmax] for any evolution of the polytope during optimization.

4. Control method (100) according to any one of the preceding claims in which the order m of the polynomial is between 2 and 20, preferably 3.

5. Control method (100) according to any one of the preceding claims in which obtaining (20) the trajectory setpoint and at least one measurement of the mechatronic system in a current state further comprises a real-time estimation of a current state of the mechatronic system from the at least one measurement of the mechatronic system obtained (20), the estimation being carried out by an observer included in the mechatronic system.

6. Mechatronic system comprising: - a processor implementing the control method according to claims 1 to 5; and - a system adapted to obtain at least one measurement of the mechatronic system.

7. Gyro-stabilized sight comprising: - a processor implementing the control method according to claims 1 to 5; and - a system adapted to obtain at least one measurement of the gyro-stabilized sight.

8. A computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement the method according to any one of claims 1 to 5.

9. A computer-readable recording medium comprising instructions which, when executed by a computer, cause the computer to carry out the method of any one of claims 1 to 5.