A pan-tilt control method, pan-tilt unit, device, and storage medium.
By periodically receiving signals when CAN bus communication errors occur and controlling the motor to stop working when no signal is received within a timeout period, the problem of motor erratic rotation or overheating caused by CAN bus errors is solved, thus extending the service life of the gimbal.
Patent Information
- Application Number
- CN202210468943.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-04-29
AI Technical Summary
The CAN bus is prone to errors under strong electromagnetic interference or hardware failure, which can lead to problems such as motor running erratically or overheating and burning out.
By receiving signals at regular intervals and controlling the motor to stop working when no signal is received within a timeout period, a protection mode is set to prevent the motor from running erratically or overheating, including measures to set the current value to zero and the current target value to zero.
This effectively prevents the motor from spinning erratically or overheating, protecting the motor and extending the lifespan of the gimbal.
Smart Images

Figure CN114967536B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control technology, and more specifically, to a gimbal control method, gimbal, device, and storage medium. Background Technology
[0002] To achieve a richer shooting experience and better shooting results, gimbals are increasingly used in filming. Typically, the camera is mounted on a gimbal for shooting. The gimbal allows for fixing the camera, adjusting its posture, and maintaining it stably in a specific position, thus enabling stable, smooth, and multi-angle shooting. Three-axis gimbals are one of the more common gimbal structures currently available.
[0003] For gimbal attitude control, in the gimbal attitude control closed loop, the attitude control module relies on the motor mechanical angle fed back by the motor control module via the CAN bus for decoupling calculation. The motor control module relies on the current target value sent by the attitude control module via the CAN bus to complete the motor current closed-loop control. The CAN bus is a widely used and easy-to-use fieldbus, but it is also prone to errors and transmission / reception failures when subjected to strong electromagnetic interference or other hardware faults. If the CAN bus interface of a certain circuit board malfunctions, or if a circuit board is offline due to power failure or other reasons, it will cause errors in the attitude control closed loop operation, resulting in erratic motor rotation or even motor overheating and burnout. Summary of the Invention
[0004] To overcome the shortcomings of CAN bus, which is prone to errors leading to transmission and reception failures, and which can easily cause motors to run erratically or even overheat and burn out, this invention provides a gimbal control method, gimbal, device, and storage medium.
[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0006] A pan-tilt-zoom (PTZ) control method includes the following steps:
[0007] The system receives a first signal for controlling the motor's operation at regular intervals; if the first signal is not received within a preset time, the system stops the motor from operating.
[0008] A second signal, including motor mechanical angle data, is periodically acquired; if the second signal is not received within a preset time, the motor is controlled to stop working.
[0009] This technical solution proposes a CAN bus communication error protection design. When the corresponding functional module in the pan-tilt unit fails to receive the first signal for controlling the motor operation within a timeout period, it enters the protection mode and automatically sets the motor current value to zero, causing the motor to stop outputting torque to protect the motor. When the corresponding functional module in the pan-tilt unit fails to receive the second signal, which includes the motor mechanical angle data, within a timeout period, the corresponding functional module cannot adjust the first signal. At this time, it enters the protection mode and sets the corresponding motor current target value to zero, controlling the corresponding motor to stop outputting torque to protect the motor.
[0010] Furthermore, the present invention also proposes a gimbal for use in the gimbal control method proposed in the above-mentioned technical solution, wherein the gimbal includes:
[0011] Electric motor;
[0012] The first module is used to output a first signal for controlling the operation of the motor according to the control command;
[0013] The second module is used to control the motor according to the first signal and to feed back a second signal including the motor mechanical angle data to the first module according to the working state of the motor.
[0014] The first module adjusts the first signal according to the second signal;
[0015] When the first module does not receive the second signal within a preset time, the first module outputs a first signal with a command to control the motor to stop working to the second module.
[0016] If the second module does not receive the first signal within a preset time, the second module controls the motor to stop working.
[0017] Furthermore, the present invention also proposes a gimbal control device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the gimbal control method proposed in the above technical solution.
[0018] Furthermore, the present invention also proposes a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the gimbal control method proposed in the above technical solution.
[0019] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: the present invention determines whether there is an abnormality in the CAN bus interface or an error in the closed-loop operation of attitude control by judging the signal reception, and takes corresponding protective measures according to the detection results, effectively avoiding the motor from running randomly or overheating, and avoiding affecting the service life of the gimbal. Attached Figure Description
[0020] Figure 1This is a flowchart of the three-axis gimbal attitude control and protection method in Example 1.
[0021] Figure 2 A flowchart illustrating the CAN bus communication error protection mechanism for the attitude control module.
[0022] Figure 3 This is a flowchart for stall overcurrent protection.
[0023] Figure 4 This is a flowchart for over-temperature protection.
[0024] Figure 5 This is a diagram of the gimbal architecture in Example 2. Detailed Implementation
[0025] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.
[0026] To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions;
[0027] It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.
[0028] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0029] Example 1
[0030] This embodiment proposes a three-axis gimbal attitude control and protection method, such as... Figure 1 The diagram shown is a flowchart of the three-axis gimbal attitude control and protection method in this embodiment.
[0031] To address the issue that the CAN bus is prone to errors leading to transmission and reception failures when subjected to strong electromagnetic interference or other hardware malfunctions, this embodiment proposes a gimbal control method, including the following steps:
[0032] (1) Receive the first signal for controlling the operation of the motor at regular intervals; if the first signal is not received within a preset time, control the motor to stop working.
[0033] (2) The second signal, including the mechanical angle data of the motor, is collected periodically; if the second signal is not received within a preset time, the motor is controlled to stop working.
[0034] Steps (1) and (2) can be executed in parallel or sequentially.
[0035] In one alternative embodiment, the motors in the gimbal include a pitch motor, a roll motor, and a yaw motor, and the gimbal is a three-axis gimbal.
[0036] In one alternative embodiment, the second signal includes pitch motor mechanical angle data and roll motor mechanical angle data.
[0037] like Figure 2 As shown, if the second signal is not received within a preset time, the second signal is judged as follows:
[0038] Determine if the pitch motor mechanical angle data has not been received within the preset time:
[0039] If yes, then control the roll motor and yaw motor to stop working, and control the pitch motor to continue working; if no, then further determine whether the preset time has elapsed without receiving the roll motor mechanical angle data:
[0040] If so, the yaw motor will stop working, while the pitch and roll motors will continue to work; otherwise, the pitch, roll, and yaw motors will continue to work.
[0041] In a specific implementation, the gimbal control method is applied to a three-axis gimbal that includes a motor control module and an attitude control module.
[0042] The motor control module is used to control the operation of the motor and to collect the motor's mechanical angle data and generate a second signal to send to the attitude control module.
[0043] The attitude control module is used to generate a first signal for controlling the operation of the motor based on the control command or the motor mechanical angle data contained in the second signal, combined with the attitude control decoupling algorithm. The first signal includes the target current value for controlling the target motor.
[0044] The attitude control decoupling algorithm calculates the desired current based on attitude data and motor mechanical angle data through decoupling. Attitude data includes gimbal attitude and body angular velocity, acquired by an inertial measurement unit.
[0045] The motor control module is connected to the attitude control module. With the CAN bus functioning normally, the motor control module transmits the mechanical angle data it collects from the pitch, roll, and yaw motors to the attitude control module. The attitude control module calculates the target current value for each motor based on the attitude control decoupling algorithm and transmits this target current value back to the motor control module. The motor control module then controls the current value of the corresponding motor based on the received target current value.
[0046] When the CAN bus is subjected to strong electromagnetic interference or other hardware failures that cause communication errors, the motor control module and attitude control module are detected and analyzed.
[0047] Specifically, when the motor control module does not receive the current target value from the attitude control module within a preset time, the motor control module enters the protection mode, controls the motor current value to be set to 0, and stops the motor from outputting torque to protect the motor.
[0048] When the attitude control module does not receive mechanical angle data from the motor control module within a preset time, the attitude control module enters protection mode, sets the corresponding motor current target value to 0 and outputs it to the motor control module, which then controls the corresponding motor to stop outputting torque to protect the motor.
[0049] Furthermore, the specific steps of the attitude control module in the CAN bus communication error protection process include:
[0050] Determine if the attitude control module has not received pitch motor mechanical angle data from the motor control module within a preset time:
[0051] If so, set the target values for roll motor current and yaw motor current to zero, and output the target value for pitch motor current.
[0052] If not, further determine whether the attitude control module has not received the roll motor mechanical angle data from the motor control module within the preset time:
[0053] If so, the yaw motor current target value is set to zero, and the pitch motor current target value and roll motor current target value are output; otherwise, the attitude control module outputs the pitch motor current target value, roll motor current target value, and yaw motor current target value to the motor control module.
[0054] This embodiment provides a three-axis gimbal attitude control protection method for CAN bus communication errors. It detects and judges abnormal CAN bus interface transmission and reception or attitude control closed-loop operation errors, and takes corresponding protection measures to effectively prevent motor erratic rotation or motor overheating, thus avoiding affecting the service life of the three-axis gimbal.
[0055] In another optional embodiment, a gimbal control method is proposed that further includes a stall protection mechanism to address the phenomenon of motor stalling caused by excessive external torque that the torque generated by the motor cannot be overcome, or by mechanical failure causing the motor rotor and stator to become stuck.
[0056] When a stall occurs, the motor will generate a large current to produce a large torque to resist the resistance. Prolonged stall and overcurrent will cause heat to accumulate in the motor and motor board, which can easily reduce the life of the motor or motor board, or even cause direct damage.
[0057] In this embodiment, the stall overcurrent protection is continuously or intermittently executed during a gimbal control cycle. Specifically, as follows: Figure 3As shown, the first signal received at the specified time is evaluated:
[0058] When the first signal is greater than the preset current value threshold and the holding time reaches the preset time threshold, the first signal is set to the preset safety value and output.
[0059] When the first signal is less than the preset current value threshold and the holding time reaches the preset time threshold, the original first signal is output.
[0060] In a specific implementation, the gimbal control method is applied to a three-axis gimbal that includes a motor control module and an attitude control module.
[0061] When the motor is subjected to excessive external torque, making it impossible for the motor to generate sufficient torque, or when the rotor and stator of the motor become stuck due to mechanical failure, resulting in a stalled motor, the attitude control module determines the target value of its output current.
[0062] When the target current value output by the attitude control module is greater than the preset current value threshold and the holding time reaches the preset time threshold, the attitude control module sets the target current value to the preset safety value and outputs it.
[0063] Specifically, when the target current value of the attitude control closed-loop output is detected to be too high for an extended period of time, the system enters a protection mode and forcibly sets the target current value to a safe value, which can be a preset target current value.
[0064] When the target current value output by the attitude control module is less than the preset current value threshold and the holding time reaches the preset time threshold, the attitude control module outputs the original target current value to the motor control module.
[0065] When the target current value of the attitude control closed-loop output decreases, it can be considered that the three-axis gimbal has disengaged from the stall state, and the target current value returns to the target current value output by the attitude control closed-loop. This avoids overheating and damage to the motor and motor control module due to excessive motor current over a prolonged period.
[0066] Furthermore, in response to the phenomenon that the motor and motor board will experience unexpected temperature rise when the stall overcurrent protection mechanism fails and heat dissipation is poor, and that prolonged overheating will reduce the life of the gimbal or even directly damage the gimbal, this embodiment continuously or intermittently performs overheat protection during a gimbal control cycle.
[0067] like Figure 4 As shown, in this embodiment, a temperature sensor is used to collect temperature signals from the motor control module and / or attitude control module. When the temperature of the motor control module and / or attitude control module is greater than a preset temperature threshold, the motor control module and / or attitude control module are controlled to stop working.
[0068] Since the motor and motor control module are generally installed in the same aluminum alloy arm, the motor temperature and the motor control module temperature are basically the same. Therefore, the over-temperature protection mechanism only needs to collect the motor board temperature parameter.
[0069] In a specific implementation, the temperature data of the MCU inside the motor control module and attitude control module is monitored by temperature sensors. If the temperature exceeds the limit, the corresponding drive circuit is forcibly shut down to protect the motor, as well as the motor control module and attitude control module.
[0070] In an optional embodiment, to address the issue that the internal program of the gimbal main control board may run away and enter an infinite loop under conditions of external interference, unstable power supply, or software errors, this embodiment sets up a watchdog mechanism in the MCU of the gimbal.
[0071] This embodiment utilizes the MCU's independent watchdog mechanism. If the program unexpectedly crashes and fails to feed the watchdog within a timeout period, the watchdog will restart the program, ensuring that the program quickly returns to normal.
[0072] Example 2
[0073] This embodiment proposes a gimbal, applying the gimbal control method proposed in Embodiment 1. For example... Figure 5 The diagram shown is an architecture diagram of the gimbal in this embodiment.
[0074] The gimbal proposed in this embodiment includes a motor, a first module 110, and a second module 120.
[0075] In this embodiment, the first module 110 is used to output a first signal for controlling the operation of the motor according to the control command.
[0076] In this embodiment, the second module 120 is used to control the motor according to the first signal and to feed back a second signal including motor mechanical angle data to the first module 110 according to the working state of the motor.
[0077] The first module 110 adjusts the first signal according to the second signal.
[0078] When the first module 110 does not receive the second signal within a preset time, the first module 110 outputs a first signal with a command to control the motor to stop working to the second module 120.
[0079] When the second module 120 does not receive the first signal within a preset time, the second module 120 controls the motor to stop working.
[0080] In one alternative embodiment, the gimbal is a three-axis gimbal, whose motors include a pitch motor, a roll motor, and a yaw motor.
[0081] In one optional embodiment, the first module 110 is an attitude control module or attitude board in the gimbal; the second module 120 is a motor control module or motor board in the gimbal.
[0082] In one optional embodiment, the first signal for controlling the operation of the motor includes the target current value of each motor, and the second module controls the operating power of the motor according to the target current value in the first signal.
[0083] In one optional embodiment, the second signal including motor mechanical angle data includes pitch motor mechanical angle data and roll motor mechanical angle data.
[0084] In practice, if the motor control module does not receive the current target value from the attitude control module within a preset time, the motor control module will set the motor current value to zero.
[0085] If the attitude control module does not receive mechanical angle data from the motor control module within a preset time, the attitude control module will output a first signal to the motor control module to set the target current value to zero.
[0086] In an optional embodiment, when the first module 110 does not receive the second signal for a preset time, it determines the nature of the second signal:
[0087] Determine whether the first module 110 has not received pitch motor mechanical angle data within the preset time:
[0088] If so, the first module 110 outputs a first signal to the second module 120 to control the roll motor and yaw motor to stop working, and to control the pitch motor to continue working;
[0089] If not, then further determine whether the first module 110 has not received the roll motor mechanical angle data for a preset time:
[0090] If so, the first module 110 outputs a first signal to the second module 120 to control the yaw motor to stop working and to control the pitch motor and roll motor to continue working; otherwise, the first module 110 outputs a first signal to the second module 120 to control the pitch motor, roll motor and yaw motor to continue working.
[0091] In an optional embodiment, in response to the phenomenon of motor stalling caused by excessive external torque that the torque generated by the motor cannot be overcome, or by mechanical failure causing the rotor and stator of the motor to become stuck, the gimbal in this embodiment is also equipped with a stall overcurrent protection module 200, which is used to judge the first signal output by the first module 110.
[0092] In this embodiment, the stall overcurrent protection module 200 determines the target current value output by the first module 110:
[0093] 1) When the target value of the working current used to control the motor operation in the first signal output by the first module 110 is greater than the preset current value threshold and the holding time reaches the preset time threshold, the stall overcurrent protection module 200 feeds back a signal to the first module 110, and the first module 110 sets the first signal to the preset safety value and outputs it.
[0094] 2) When the first signal output by the first module 110 is less than or equal to the preset current value threshold and the holding time reaches the preset time threshold, the stall overcurrent protection module 200 feeds back a signal to the first module 110, and the first module 110 outputs the original first signal to the second module 120.
[0095] In a specific implementation, when the stall overcurrent protection module 200 detects that the target current value of the attitude control closed-loop output is excessive for an extended period, it controls the attitude control module to enter protection mode, forcibly setting the target current value to a safe value, such as a preset target current value. When the stall overcurrent protection module 200 detects that the target current value of the attitude control closed-loop output decreases, it can be considered that the three-axis gimbal has disengaged from the stall state. At this time, the attitude control module resumes using the target current value of the attitude control closed-loop output, thereby preventing the motor and motor control module from overheating and being damaged due to excessive motor current over a prolonged period.
[0096] In an optional embodiment, in the event that the stall overcurrent protection mechanism fails and the heat dissipation is poor, the motor and motor board will generate an unexpected temperature rise. Prolonged overheating will reduce the life of the gimbal or even directly damage the gimbal. In this embodiment, the gimbal is also equipped with an overheat protection module 300, which is used to collect and judge the temperature signals of the first module 110 and / or the second module 120 through temperature sensors.
[0097] When the temperature of the first module 110 and / or the second module 120 exceeds a preset temperature threshold, the over-temperature protection module 300 controls the first module 110 and / or the second module 120 to stop working.
[0098] In one specific implementation, temperature data from the MCUs inside the motor control module and attitude control module are monitored by temperature sensors. Overheating triggers a forced shutdown of the corresponding drive circuits to protect the motor, as well as the motor control module and attitude control module. When the temperature of the motor control module and / or attitude control module exceeds a preset temperature threshold, the over-temperature protection module 300 controls the motor control module and / or attitude control module to stop operating.
[0099] In an optional embodiment, in response to the possibility that the internal program of the gimbal main control board may run out of control and enter an infinite loop under the circumstances of external interference, unstable power supply, or software error, the gimbal in this embodiment is also equipped with a watchdog module 400 to control the periodic operation of the first module 110 and the second module 120.
[0100] This embodiment utilizes the MCU's independent watchdog mechanism. If the program unexpectedly crashes and fails to feed the watchdog within a timeout period, the watchdog will restart the program, ensuring that the program quickly returns to normal.
[0101] Example 3
[0102] This embodiment provides a gimbal control device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the gimbal control method proposed in Embodiment 1 above.
[0103] Example 4
[0104] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a controller, implements the gimbal control method proposed in Embodiment 1 above.
[0105] The same or similar labels correspond to the same or similar parts;
[0106] The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.
[0107] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A gimbal control method, characterized in that, Includes the following steps: The system receives the first signal used to control the motor's operation at regular intervals. If the first signal is not received within a preset time, the control motor stops working; the motor includes a pitch motor, a roll motor, and a yaw motor; The system periodically collects a second signal, including motor mechanical angle data; if the second signal is not received within a preset time, the system controls the motor to stop working. in, The second signal includes pitch motor mechanical angle data and roll motor mechanical angle data; wherein, if the second signal is not received within a preset time, the second signal is judged as follows: Determine if the pitch motor mechanical angle data has not been received within the preset time: If so, then control the roll motor and yaw motor to stop working, and control the pitch motor to continue working; If not, further determine whether the roll motor mechanical angle data has not been received within the preset time: If so, control the yaw motor to stop working, and control the pitch and roll motors to continue working; Otherwise, the pitch, roll, and yaw motors will continue to operate.
2. The gimbal control method according to claim 1, characterized in that, The first signal includes the target value of the motor's operating current, which is used to control the motor's operating power.
3. The gimbal control method according to claim 2, characterized in that, It also includes the following steps: The first signal received at the time is judged: When the first signal is greater than the preset current value threshold and the holding time reaches the preset time threshold, the first signal is set to the preset safety value and output. When the first signal is less than the preset current value threshold and the holding time reaches the preset time threshold, the original first signal is output.
4. The gimbal control method according to claim 1, characterized in that, It also includes the following steps: A watchdog mechanism is set up to control the periodic execution of the gimbal control method.
5. A gimbal, characterized in that, The gimbal control method according to any one of claims 1 to 4 is applied; the gimbal comprises: Electric motors; the electric motors include pitch motors, roll motors, and yaw motors; The first module (110) is used to output a first signal for controlling the operation of the motor according to the control command; The second module (120) is used to control the motor according to the first signal and to feed back a second signal including motor mechanical angle data to the first module (110) according to the working state of the motor; the second signal includes pitch motor mechanical angle data and roll motor mechanical angle data; The first module (110) adjusts the first signal according to the second signal; When the first module (110) does not receive the second signal within a preset time, the first module (110) outputs a first signal with a command to control the motor to stop working to the second module (120); When the second module (120) does not receive the first signal within a preset time, the second module (120) controls the motor to stop working; in, If the first module (110) does not receive the second signal within a preset time, the second signal is judged as follows: Determine whether the first module (110) has not received pitch motor mechanical angle data for a preset time: If so, the first module (110) outputs a first signal to the second module (120) to control the roll motor and yaw motor to stop working, and to control the pitch motor to continue working; If not, then further determine whether the first module (110) has not received the roll motor mechanical angle data for a preset time: If so, the first module (110) outputs a first signal to the second module (120) to control the yaw motor to stop working and to control the pitch motor and roll motor to continue working; otherwise, the first module (110) outputs a first signal to the second module (120) to control the pitch motor, roll motor and yaw motor to continue working.
6. The gimbal according to claim 5, characterized in that, The gimbal also includes a stall overcurrent protection module (200) for judging the first signal output by the first module (110): When the target value of the working current used to control the motor operation in the first signal output by the first module (110) is greater than the preset current value threshold and the holding time reaches the preset time threshold, the stall overcurrent protection module (200) feeds back a signal to the first module (110), and the first module (110) sets the first signal to the preset safety value and outputs it; When the first signal output by the first module (110) is less than or equal to the preset current value threshold and the holding time reaches the preset time threshold, the stall overcurrent protection module (200) feeds back a signal to the first module (110), and the first module (110) outputs the original first signal to the second module (120).
7. The gimbal according to claim 5, characterized in that, The gimbal also includes an over-temperature protection module (300), which is used to collect and judge the temperature signals of the first module (110) and / or the second module (120) through temperature sensors: when the temperature of the first module (110) and / or the second module (120) is greater than the preset temperature threshold, the over-temperature protection module (300) controls the first module (110) and / or the second module (120) to stop working.
8. The gimbal according to claim 5, characterized in that, The gimbal also includes a watchdog module (400) for controlling the periodic operation of the first module (110) and the second module (120).
9. A gimbal control device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the gimbal control method according to any one of claims 1 to 4.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the gimbal control method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Control device for high-speed dome camera holder
CN101980089A
Motor stalling detection method and system
CN103840432A
Cloud deck gesture control method and system
CN106681369A
Method for controlling pan tilt, pan tilt and computer readable storage medium
CN112166395A
Pan-tilt, control method thereof and external control device
CN112166396A