A control method and system of a model airplane steering engine based on PWM communication
By installing a potentiometer on the model aircraft servo and adopting a pure digital integral control algorithm, closed-loop control of the model aircraft servo was realized, solving the problem of large servo angle error under open-loop control and improving flight accuracy and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2026-03-17
AI Technical Summary
The existing control method for model aircraft servos is open-loop control, which results in the servos failing to accurately reach the expected angle under different operating conditions, with large errors affecting flight accuracy. Furthermore, it is difficult for users to determine the internal control relationships of the servos.
A closed-loop control method based on PWM communication is adopted. By installing a potentiometer on the servo to collect voltage and calculate the current angle value, and using a pure digital integral control algorithm to calculate the PWM signal based on the angle deviation, the smooth rotation of the servo is achieved.
It achieves smooth changes in servo angle, avoids the error accumulation problem in traditional open-loop control, adapts to more operating conditions, and improves the accuracy and stability of model aircraft flight.
Smart Images

Figure CN116700100B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of servo motors, and more particularly to a control method and system for a model aircraft servo motor based on PWM communication. Background Technology
[0002] A servo motor is an actuator that controls the rotation of control surfaces. It is a type of angle (position) servo drive, suitable for control systems that require continuous angle changes and the ability to maintain those angles. Model aircraft servos mainly consist of a housing, circuit board, motor, reducer, and position monitoring components. They are commonly used in model airplanes, model submarines, and remote-controlled robots. Essentially, a model aircraft servo motor is a type of servo motor.
[0003] In practical applications, the control of common model aircraft servos typically requires a pulse width modulation (PWM) signal with a period of 20ms. The width of the high-level portion of this signal (0.5~2.5ms) controls the output angle of the servo. Theoretically, the duration of the high-level PWM corresponds to and maintains the output angle of the servo (for example, a PWM pulse width of 1.5ms represents 0°, 0.5ms represents -90°, and 2.5ms represents 90°). Therefore, when the corresponding pulse width is provided to the servo, the servo output shaft can be controlled to maintain a corresponding angle, which is an open-loop control for the user.
[0004] Currently available commercially available model aircraft servos are essentially black-box systems for users. Due to varying operating conditions, servos sometimes fail to meet performance requirements. This is related to various factors such as the servo's internal control circuitry, control algorithm, motor performance, reducer, and potentiometer installation. Under certain conditions, these factors can introduce significant errors, severely impacting the accuracy of model aircraft flight. For example, theoretically, controlling a model aircraft servo to deflect at 45° corresponds to a PWM pulse width of 2ms. However, when a high-level PWM signal with a period of 20ms is sent to the servo, it can only deflect to 40°, failing to meet the requirement. Furthermore, this open-loop control requires accurate knowledge of the pulse width-angle correspondence. For some model aircraft servos, this correspondence is not accurately known (e.g., their effective pulse width for received signals is 0.8ms–2.2ms or 0.2ms–2.8ms, etc.), making it difficult to use the servo properly. Summary of the Invention
[0005] The purpose of this invention is to overcome the problems existing in the existing servo control and to provide a control method and system for model aircraft servos based on PWM communication.
[0006] The objective of this invention is achieved through the following technical solution:
[0007] Firstly, a control method for a model aircraft servo motor based on PWM communication is provided, the method comprising the following steps:
[0008] S1. Collect the real-time voltage of the model aircraft servo and calculate the current angle value of the model aircraft servo based on the real-time voltage;
[0009] S2. Calculate the PWM signal to be output based on the deviation between the commanded angle value and the current angle value. The algorithm part adopts pure digital integral control. The deviation is only used to determine the integral threshold and the direction of increase or decrease, and does not participate in the calculation.
[0010] As a preferred embodiment, a control method for a model aircraft servo based on PWM communication, wherein the acquisition of the real-time voltage of the model aircraft servo includes:
[0011] A potentiometer is installed on the output shaft of the model aircraft servo motor to collect voltage.
[0012] As a preferred option, a control method for a model aircraft servo based on PWM communication further includes:
[0013] The design specifies the communication protocol between the host computer and the controller. Before the controller receives the first valid instruction from the host computer, it does not output a PWM signal. After the controller receives the valid instruction from the host computer, it starts to continuously output a PWM signal corresponding to the angle.
[0014] As a preferred embodiment, a control method for a model aircraft servo based on PWM communication, wherein calculating the current angle value of the model aircraft servo according to the real-time voltage includes:
[0015] The deflection angle value of the electric servo motor is collected multiple times within a unit of time.
[0016] As a preferred embodiment, a control method for a model aircraft servo based on PWM communication, wherein calculating the current angle value of the model aircraft servo according to the real-time voltage further includes:
[0017] The deflection angle value is obtained by mean filtering and first-order hysteresis filtering.
[0018] As a preferred embodiment, a control method for a model aircraft servo based on PWM communication, wherein calculating the PWM signal to be output based on the deviation between the commanded angle value and the current angle value includes:
[0019] The control operation is performed once every fixed time interval. First, it is determined whether the absolute value of the deviation is lower than the threshold Ve. If it is lower than the threshold, no action is taken and the previous PWM output is maintained. If it is higher than the threshold Ve, the deviation is integrated according to its sign until the output PWM duty cycle reaches the upper limit of the model aircraft servo.
[0020] As a preferred option, a control method for a model aircraft servo based on PWM communication, wherein the integration based on the sign of the deviation includes:
[0021] When the deviation is positive, the integral Ie increments by 1 digital value; when the deviation is negative, the integral Ie decrements by 1 digital value. The integral Ie is then limited, multiplied by the integral coefficient, and the result is given to the PWM signal controller.
[0022] As a preferred option, a control method for a model aircraft servo based on PWM communication is provided. When the servo angle exceeds the commanded angle, the integral decreases, causing the PWM duty cycle to decrease. After adjustment, the PWM signal output by the PWM signal controller is adjusted so that it controls the model aircraft servo to rotate to the specified angle. After the model aircraft servo rotates to the specified angle, the PWM signal output by the PWM signal controller remains unchanged.
[0023] Secondly, a control system for a model aircraft servo motor based on PWM communication is provided, the system comprising:
[0024] An angle acquisition module is configured to acquire the real-time voltage of the model aircraft servo and calculate the current angle value of the model aircraft servo based on the real-time voltage.
[0025] The PWM signal output module is configured to calculate the PWM signal to be output based on the deviation between the commanded angle value and the current angle value. The algorithm part adopts pure digital integral control, and the deviation is only used to determine the integral threshold and the direction of increase or decrease, and does not participate in the calculation.
[0026] As a preferred embodiment, a control system for a model aircraft servo based on PWM communication is provided, wherein the angle acquisition module includes a PWM signal controller, and the PWM signal controller includes a potentiometer, an ADC, a communication chip, and a main control chip connected in sequence.
[0027] It should be further noted that the technical features corresponding to the above options can be combined or substituted to form new technical solutions if there is no conflict.
[0028] Compared with the prior art, the beneficial effects of the present invention are:
[0029] (1) The present invention adopts a pure integral control algorithm, which transforms the traditional method of using PWM signal open-loop control of the deflection angle of the model aircraft servo into closed-loop control. For model aircraft servos with unclear internal control logic, it can be used without the need for a correspondence table of its internal PWM signal range and angle.
[0030] (2) In the method of this invention, the deviation does not participate in the calculation, and the traditional "error accumulation" is abandoned in favor of "digital accumulation". This method can avoid the overshoot and jitter of the servo motor that may be caused by too fast integration accumulation when the error is large, and can also avoid the slow integration accumulation that may be caused by too slow rotation of the servo motor when the error is too small. Pure digital integration can make the integration process very smooth, so the change process of the servo motor angle of the model aircraft is also very smooth, and theoretically it rotates at a constant speed to the command angle.
[0031] (3) This invention differs from traditional PID control, employing only pure integral control. In traditional control, proportional control plays a dominant role. However, for model aircraft servos, as the servo angle rotates, its deviation continuously decreases, leading to a decrease in proportional output and consequently, a decrease in PWM output. However, the PWM output should continue to increase until the servo reaches the designated position, and once the servo angle reaches the commanded position, the PWM duty cycle should remain constant rather than decrease. Using integral control as the primary method achieves the aforementioned closed-loop control requirements for model aircraft servos, while the influence of derivatives is negligible when digital integral control is selected.
[0032] (4) The present invention can adjust the speed of the servo motor rotation by changing the step size of the digital integral, so that the speed of the servo surface deflection of the model aircraft servo motor, which originally has a fixed rotation speed, becomes a configurable item during use, and can adapt to more working conditions. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating a control method for a model aircraft servo based on PWM communication, as shown in an embodiment of the present invention.
[0034] Figure 2 This is a schematic diagram of the circuit structure of the angle acquisition module shown in an embodiment of the present invention. Detailed Implementation
[0035] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] In the description of this invention, it should be noted that the directions or positional relationships indicated by "center", "up", "down", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0037] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0038] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0039] Reference Figure 1 In one exemplary embodiment, a control method for a model aircraft servo based on PWM communication is provided, the method comprising the following steps:
[0040] S1. Collect the real-time voltage of the model aircraft servo and calculate the current angle value of the model aircraft servo based on the real-time voltage;
[0041] S2. Calculate the PWM signal to be output based on the deviation between the commanded angle value and the current angle value. The algorithm part adopts pure digital integral control. The deviation is only used to determine the integral threshold and the direction of increase or decrease, and does not participate in the calculation.
[0042] Specifically, a potentiometer is installed on the output shaft of the model aircraft servo. The voltage is collected by the potentiometer, and the deflection angle value of the electric servo is collected multiple times within a unit time. The current servo deflection angle value is obtained by mean filtering and first-order hysteresis filtering.
[0043] Furthermore, the communication specifications between the host computer and the controller are designed so that the controller does not output PWM signals before receiving the first valid instruction from the host computer. After receiving the valid instruction from the host computer, the controller starts to continuously output PWM signals corresponding to the angle.
[0044] The step of calculating the PWM signal to be output based on the deviation between the commanded angle value and the current angle value includes:
[0045] Every 0.2ms (selected according to actual needs), a control operation is performed. First, it checks if the absolute value of the deviation is below the threshold Ve (the threshold is selected based on control precision). If it is below the threshold, no action is taken, and the previous PWM output is maintained. If it is above the threshold Ve, the deviation is integrated based on its sign. For positive deviations, the integral Ie increments by 1 digital value; for negative deviations, it decrements by 1 digital value. The integral Ie is then limited, multiplied by the integration coefficient, and the result is sent to the PWM module. The PWM module outputs a PWM signal with the corresponding duty cycle to the servo motor based on the integration result. As the servo motor does not reach the specified angle, the integral value continues to accumulate until the output PWM duty cycle reaches the servo motor's receiving limit, at which point the servo motor reaches its extreme position in that direction. When the servo motor angle exceeds the target angle (command angle), the integral value decreases, reducing the PWM duty cycle. This adjustment ensures that the controller's output PWM is just enough to control the servo motor to rotate to the specified angle. Once the servo motor reaches the command angle, the controller's output PWM remains unchanged.
[0046] In another exemplary embodiment, a control system for a model aircraft servo based on PWM communication is provided, the system comprising:
[0047] An angle acquisition module is configured to acquire the real-time voltage of the model aircraft servo and calculate the current angle value of the model aircraft servo based on the real-time voltage.
[0048] The PWM signal output module is configured to calculate the PWM signal to be output based on the deviation between the commanded angle value and the current angle value. The algorithm part adopts pure digital integral control, and the deviation is only used to determine the integral threshold and the direction of increase or decrease, and does not participate in the calculation.
[0049] Specifically, the angle acquisition module includes a PWM signal controller, as referenced. Figure 2 The PWM signal controller (hereinafter referred to as the controller) includes a potentiometer, an ADC, a communication chip, and a main control chip connected in sequence. The potentiometer is mounted on the output shaft of the model aircraft servo. The controller controls the deflection of the model aircraft servo by outputting PWM to the servo, and obtains the angle value of the servo by acquiring the real-time voltage of the potentiometer through the ADC. The ADC is model MXT2028.
[0050] The design establishes a communication protocol between the host computer and the controller. Before receiving the first valid command from the host computer, the controller does not output PWM. After receiving the valid command, the controller continuously outputs a PWM signal corresponding to the specified angle. The controller's main control chip uses SPI to control an AD chip to acquire the potentiometer feedback voltage and obtain the real-time deflection angle value of the servo motor. The deflection angle value of the electric servo motor is acquired multiple times within a unit of time, and the current servo motor deflection angle is obtained through mean filtering and first-order hysteresis filtering.
[0051] The above detailed embodiments are a description of the present invention. It should not be considered that the specific embodiments of the present invention are limited to these descriptions. For those skilled in the art, several simple deductions and substitutions can be made without departing from the concept of the present invention, and all of these should be considered to fall within the protection scope of the present invention.
Claims
1. A control method of a model airplane rudder based on PWM communication, characterized in that, The method comprises the following steps: S1, collecting real-time voltage of a model ship rudder motor, and calculating current angle value of the model ship rudder motor according to the real-time voltage; S2, calculating the PWM signal that should be output according to the deviation of the instruction angle value and the current angle value, wherein the algorithm part adopts pure digital integral control, and the deviation is only used for judging the integral threshold and the increase / decrease direction and does not participate in the operation; The calculation of the PWM signal that should be output according to the deviation of the instruction angle value and the current angle value comprises: The control operation is performed once every fixed time period, and whether the absolute value of the deviation is lower than the threshold Ve is judged first; if it is lower than the threshold, it is not processed, and the previous PWM output can be kept; if it is higher than the threshold Ve, the integral is performed according to the positive / negative of the deviation until the duty cycle of the output PWM reaches the upper limit received by the model ship rudder motor; The integral according to the positive / negative of the deviation comprises: When the deviation is positive, the integral Ie is increased by 1 digital quantity, and when the deviation is negative, the integral Ie is decreased by 1 digital quantity; the integral Ie is limited in amplitude, multiplied by the integral coefficient, and the result is given to the PWM signal controller.
2. The control method of a PWM communication-based model ship rudder engine according to claim 1, characterized in that, The collection of the real-time voltage of the model ship rudder motor comprises: A potentiometer is installed on the output shaft of the model ship rudder motor, and the voltage is collected through the potentiometer.
3. The control method of a PWM communication-based model ship rudder engine according to claim 1, characterized in that, Further comprising: The communication specification of the upper computer and the controller is designed, the controller does not output the PWM signal before the controller receives the first valid instruction sent by the upper computer, and after the controller receives the valid instruction sent by the upper computer, the PWM signal corresponding to the angle is continuously output.
4. The control method of a PWM communication-based model ship rudder engine according to claim 1, characterized in that, The calculation of the current angle value of the model ship rudder motor according to the real-time voltage comprises: The deflection angle value of the electric rudder motor is collected multiple times in a unit time.
5. The control method of a PWM communication-based model ship rudder engine according to claim 4, characterized in that, The calculation of the current angle value of the model ship rudder motor according to the real-time voltage further comprises: The deflection angle value is obtained through mean value filtering and first-order lag filtering.
6. The control method of a PWM communication-based model ship steering engine according to claim 1, wherein, When the rudder angle turns the instruction angle, the integral is reduced, the duty cycle of the PWM is reduced, and the PWM signal output by the PWM signal controller is just controlled to rotate the model ship rudder motor to the specified angle after adjustment; after the model ship rudder motor rotates to the specified angle, the PWM signal output by the PWM signal controller remains unchanged.
7. A control system for a PWM communication-based model airplane servo, characterized by, The system comprises: An angle collection module configured to collect real-time voltage of a model ship rudder motor, and calculate current angle value of the model ship rudder motor according to the real-time voltage; A PWM signal output module configured to calculate the PWM signal that should be output according to the deviation of the instruction angle value and the current angle value, wherein the algorithm part adopts pure digital integral control, and the deviation is only used for judging the integral threshold and the increase / decrease direction and does not participate in the operation; The calculation of the PWM signal that should be output according to the deviation of the instruction angle value and the current angle value comprises: The control operation is performed once every fixed time period, and whether the absolute value of the deviation is lower than the threshold Ve is judged first; if it is lower than the threshold, it is not processed, and the previous PWM output can be kept; if it is higher than the threshold Ve, the integral is performed according to the positive / negative of the deviation until the duty cycle of the output PWM reaches the upper limit received by the model ship rudder motor; The integral according to the positive / negative of the deviation comprises: When the deviation is positive, the integral Ie is increased by one digital quantity, and when the deviation is negative, the integral Ie is decreased by one digital quantity. The integral Ie is limited in amplitude, multiplied by an integral coefficient, and the result is given to a PWM signal controller.
8. A control system for a PWM communication based model aeronautical rudder motor according to claim 7, characterized in that, The angle acquisition module comprises a PWM signal controller, and the PWM signal controller comprises a potentiometer, an ADC, a communication chip and a master control chip connected in sequence.
Citation Information
Patent Citations
Steering engine control method
CN112650112A