Motion control method, electronic device, and computer-readable storage medium

By dividing the speed control range in the camera motion control and optimizing the speed control parameters, the problem of slow acceleration in the low-speed range of the camera was solved, and rapid start-stop and energy efficiency were achieved.

CN116506729BActive Publication Date: 2026-04-14ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2023-04-12
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing camera motion control methods accelerate too slowly at low and medium speeds, resulting in motion lag, inability to start and stop quickly, and waste of motor torque.

Method used

By dividing the speed control range, different speed control parameters are determined according to the target speed and motion mode, an acceleration control curve is generated, the camera's motion control strategy is optimized, and the torque performance of different speed ranges is matched.

Benefits of technology

It improves the camera's startup performance in the low-to-medium speed range, reduces startup lag, increases energy utilization, and reduces motion power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116506729B_ABST
    Figure CN116506729B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a motion control method, an electronic device and a computer readable storage medium. A motion control method comprises: in response to a motion instruction, determining a target speed and a target motion mode corresponding to the motion instruction, wherein different target motion modes correspond to different speed control models; determining a target speed control interval corresponding to the target speed; determining a speed control parameter of the speed control model corresponding to the target motion mode in the target speed control interval, and obtaining an acceleration control curve corresponding to the target speed control interval according to the target motion mode, the speed control parameter and the target speed; wherein the speed control parameter of the speed control model corresponding to the same motion mode in different speed control intervals is different; and controlling the camera motion according to the acceleration control curve. Thus, the starting performance of the camera at low speed is effectively improved, and the problem of starting lag is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of camera motion control technology, and more particularly to a motion control method, electronic device, and computer-readable storage medium. Background Technology

[0002] Currently, surveillance cameras are mainly divided into two categories: bullet cameras and dome cameras. The main difference between bullet and dome cameras is the addition of a pan-tilt unit (PTZ). The movement of the PTZ in horizontal and vertical directions drives the movement of the camera on the PTZ, achieving flexible monitoring of scenes of interest. The quality of the PTZ's movement often affects the monitoring effect. To ensure that the PTZ moves well at any speed and distance, acceleration and deceleration control strategies need to be introduced during PTZ control.

[0003] A simplified diagram of the existing PTZ camera control system is shown below. Figure 1 As shown, after receiving the motion command from the upper layer application of the PTZ camera mechanism, the PTZ microcontroller unit (MCU) manually offline fits or plans an acceleration and deceleration curve in real time, and then converts the motion value on the curve into the corresponding number of pulses or pulse frequency. After being processed by the pulse generator, pulse distributor, power amplifier and other modules in the stepper motor drive, the stepper motor is driven to rotate, and then the PTZ is moved through the transmission mechanism.

[0004] Considering the characteristic that stepper motor torque output decreases with increasing speed, making it most prone to step loss at high speeds, the maximum acceleration of the planned S-shaped acceleration / deceleration curve is a fixed value regardless of whether the user controls the pan-tilt-zoom (PTZ) at any speed via a joystick or web button. This ensures that the camera maintains its position throughout its full-speed range without losing steps (i.e., prioritizing accurate scene capture when stopped). This maximum acceleration is primarily determined based on torque assessment at high speeds. While this ensures the device maintains its position across the entire speed range (e.g., 0.1 degrees / second to 300 degrees / second), it also wastes the motor's torque output capability at low and medium speeds. This results in slower acceleration / deceleration at these speeds, hindering faster start-stop and leading to greater motion lag. Summary of the Invention

[0005] This invention provides a motion control method, electronic device, and computer-readable storage medium to solve the problem in the prior art where the camera accelerates too slowly at low and medium speeds, making it impossible to start and stop more quickly, thus resulting in greater motion lag.

[0006] This invention provides a motion control method, comprising:

[0007] In response to a motion command, the target speed and target motion mode corresponding to the motion command are determined, wherein different target motion modes correspond to different speed control models;

[0008] Determine the corresponding target speed control range based on the target speed;

[0009] Determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the acceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed; wherein the speed control parameters of the speed control model corresponding to the same motion mode are different in different speed control ranges;

[0010] The camera movement is controlled according to the acceleration control curve.

[0011] Optionally, if the camera is a pan-tilt camera, the speed control parameters corresponding to any speed control interval are determined as follows:

[0012] The first acceleration is determined based on the actual maximum output torque corresponding to the maximum acceleration position during the acceleration process of the pan-tilt camera using the target motion mode with the upper limit speed of the speed control range as the target.

[0013] For any moment-frequency characteristic inflection point in the target speed control range, the second acceleration is determined based on the first acceleration;

[0014] Based on each of the second accelerations, determine the speed control parameters corresponding to the target motion mode in the target speed control range;

[0015] Specifically, for any moment-frequency characteristic inflection point within the target velocity control range, the following steps are performed sequentially to determine the second acceleration:

[0016] Based on the conditions that the upper limit speed of the speed control range is taken as the target and the acceleration at the maximum acceleration position is the first acceleration during the acceleration process of the pan-tilt camera using the target motion mode, the third acceleration corresponding to the inflection point of the torque-frequency characteristic is determined, and the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic is determined based on the third acceleration.

[0017] Determine whether the theoretical output torque is less than the actual maximum output torque of the PTZ camera at the inflection point of the torque-frequency characteristic;

[0018] If it is less than, then the first acceleration is determined as the second acceleration;

[0019] If it is not less than, then redetermine the first acceleration and return to the step of determining the third acceleration corresponding to the inflection point of the torque-frequency characteristic.

[0020] Optionally, the re-determining of the first acceleration specifically includes:

[0021] The current first acceleration is reduced and used as the new first acceleration, where the reduction value is determined according to the preset ratio of the first acceleration initially determined.

[0022] Optionally, the first acceleration satisfies the following relationship:

[0023]

[0024] The theoretical output torque corresponding to the inflection point of the torque-frequency characteristic satisfies the following relationship:

[0025]

[0026] Where T1 is the actual maximum output torque corresponding to the position of maximum acceleration, T 拐点理论 J is the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic. 球 Let n be the moment of inertia of the PTZ camera. 传动比 J is the transmission ratio of the PTZ camera. 电机 Let f be the moment of inertia of the motor shaft of the PTZ camera, a1 be the first acceleration determined initially, a3 be the third acceleration, and f be the moment of inertia of the motor shaft of the PTZ camera. 球 η is the frictional torque of the PTZ camera. 安全 λ is the torque safety factor. 效率 The torque transmission efficiency of the transmission mechanism of the pan-tilt camera.

[0027] Optionally, the target speed control range is divided according to the range of motion speeds corresponding to different types of monitored targets;

[0028] Alternatively, if the camera is a PTZ camera, the target speed control range is divided according to the inflection point of the torque-frequency characteristic of the PTZ camera's motor.

[0029] Optionally, if the motion command includes a motion termination condition, then after controlling the camera motion according to the acceleration control curve, the method further includes:

[0030] Determine the deceleration control curve corresponding to the acceleration control curve, and determine the constant speed control curve based on the acceleration control curve and the deceleration control curve;

[0031] First, the camera movement is controlled according to the uniform speed control curve. After the process of controlling the camera movement according to the uniform speed control curve is completed, the camera movement is controlled according to the deceleration control curve.

[0032] The uniform speed control curve includes a curve with a control time of 0 and a curve with a control time of non-0.

[0033] Optionally, if the motion command does not include a motion termination condition, then after controlling the camera motion according to the acceleration control curve, it further includes:

[0034] If no stop command is received from the user when the target speed is reached, the camera is controlled to move at a constant speed according to the target speed; after determining the deceleration control curve corresponding to the acceleration control curve and receiving the stop command triggered by the user, the camera is controlled to move according to the deceleration control curve.

[0035] If a stop command triggered by the user is received before the target speed is reached, a deceleration control curve corresponding to the acceleration control curve is determined, and the camera movement is controlled according to the deceleration control curve.

[0036] Optionally, determining the deceleration control curve corresponding to the acceleration control curve includes:

[0037] Determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the deceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed.

[0038] Alternatively, the deceleration control curve can be obtained by mirroring the acceleration control curve.

[0039] Based on the same inventive concept, embodiments of the present invention also provide an electronic device, comprising:

[0040] A trigger module is used to respond to a motion command and determine the target speed and target motion mode corresponding to the motion command, wherein different target motion modes correspond to different speed control models;

[0041] The calculation module is used to determine the corresponding target speed control range based on the target speed; determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range; and obtain the acceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed; wherein the speed control parameters of the speed control model corresponding to the same motion mode are different in different speed control ranges.

[0042] An acceleration module is used to control the camera movement according to the acceleration control curve.

[0043] Based on the same inventive concept, embodiments of the present invention also provide an electronic device, including: a processor and a memory for storing processor-executable instructions;

[0044] The processor is configured to execute the instructions to implement the motion control method.

[0045] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that is used to implement the motion control method described above.

[0046] The beneficial effects of this invention are as follows:

[0047] The motion control method, electronic device, and computer-readable storage medium provided in this invention divide the speed into multiple different speed control intervals. By setting different speed control parameters for the camera to move in different speed control intervals with the same motion mode, the maximum torque performance of the camera's motion mechanism in each speed control interval can be fully matched, improving the starting performance at low and medium speeds, reducing start-up lag, and enabling the camera to start up faster. It can also improve the energy utilization rate of the camera during motion, indirectly reducing the camera's motion power consumption. Attached Figure Description

[0048] Figure 1 This is a structural block diagram of a PTZ camera control system in the prior art;

[0049] Figure 2 The above is a flowchart of the motion control method provided in the embodiments of the present invention.

[0050] Figure 3 This is a function relationship diagram of the speed control model corresponding to the first motion mode involved in the embodiments of the present invention;

[0051] Figure 4 This is one of the flowcharts of the motion control method provided in the embodiments of the present invention;

[0052] Figure 5 This is a second partial flowchart of the motion control method provided in an embodiment of the present invention;

[0053] Figure 6 This is a schematic diagram comparing the torque-frequency characteristic curve of the gimbal with the function relationship of the speed control model corresponding to the first motion mode when using the first motion mode for motion control in an embodiment of the present invention.

[0054] Figure 7This is a schematic diagram showing the comparison between the speed control curve and the acceleration curve when using a first motion mode for motion control in an embodiment of the present invention.

[0055] Figure 8 This is one of the structural schematic diagrams of an electronic device provided in an embodiment of the present invention;

[0056] Figure 9 This is a second schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0057] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. However, the exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided to make the present invention more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the figures denote the same or similar structures, and therefore repeated descriptions of them will be omitted. Terms describing position and direction in the present invention are illustrative based on the accompanying drawings, but changes can be made as needed, and all such changes are included within the scope of protection of the present invention. The accompanying drawings of the present invention are for illustrative purposes only and do not represent actual proportions.

[0058] It should be noted that specific details are set forth in the following description to provide a full understanding of the invention. However, the invention can be practiced in many ways other than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below. The following description is a preferred embodiment for carrying out the present application; however, the description is for the purpose of illustrating the general principles of the application and is not intended to limit the scope of the application. The scope of protection of this application shall be determined by the appended claims.

[0059] The motion control method, electronic device, and computer-readable storage medium provided in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0060] This invention provides a motion control method applied to a camera. The camera can be a surveillance camera including a pan-tilt-zoom (PTZ) unit, or other cameras with motion capabilities. The following description will primarily use a PTZ camera performing in-situ rotation as an example.

[0061] like Figure 2 As shown, the motion control method includes:

[0062] S100. Initialize the camera. This includes, but is not limited to, obtaining the current camera hardware parameters (such as the camera's rated maximum speed, moment of inertia, drive current, etc.).

[0063] S110. In response to a motion command, determine the target speed and target motion mode corresponding to the motion command. Different target motion modes correspond to different speed control models.

[0064] In practical implementation, the camera's movement includes, but is not limited to, tracking targets in the environment and monitoring the environment. Therefore, the movement command can be a command to control the camera to perform tracking or monitoring. Both tracking and monitoring can be performed repeatedly along a predetermined route. That is, the tracking process can be a back-and-forth movement along a predetermined route following the reciprocating movement of the monitored target, and the monitoring process can be a periodic or non-periodic repeated monitoring of the target area or monitored target along a predetermined route.

[0065] The motion commands can be sent via wired or wireless communication through a console or control device connected to the camera; they can also be triggered by the user controlling the camera's own buttons or switches; or they can be implemented through manual input. The motion commands include, but are not limited to, the type of action the camera needs to perform (e.g., tracking or monitoring), the distance to be moved, the time required for the movement, the target speed, the target to be captured, the direction of movement, and the monitoring angle. The motion commands can be sent and received in the form of data packets, transmitted as signals, or transmitted as data codes. For example, if the control system of the camera detects a target area that needs to be tracked, it then sends a motion command to the camera via wireless communication, causing the camera to begin moving to track the target.

[0066] In practice, determining the target speed and target motion mode corresponding to the motion command can be done through a pre-set correspondence between the motion command and the target speed and target motion mode, or it can be done through a pre-set program. For example, a pre-set program can be used to parse the motion command transmitted in the form of data packets, and the command type can be determined based on the parsed data information.

[0067] In practical implementation, the target speed can include, but is not limited to, the speed required to keep the monitored target always in the center of the image or within the frame when the camera tracks or monitors the target. Motion modes can include, but are not limited to: a first motion mode executed according to an S-shaped acceleration / deceleration algorithm, a second motion mode executed according to an e-shaped acceleration / deceleration algorithm, a third motion mode executed according to an e+S-shaped acceleration / deceleration algorithm, and a fourth motion mode executed according to a half-S-shaped acceleration / deceleration algorithm, etc. The S-shaped acceleration / deceleration algorithm, based on an S-curve model, makes the camera's acceleration / deceleration process S-shaped, and the acceleration curve triangular (e.g., ...). Figure 3 (As shown) or trapezoidal; the e-acceleration / deceleration algorithm is based on an exponential model, causing the speed curve of the camera's acceleration / deceleration process to rise or fall exponentially; the e+S-type acceleration / deceleration algorithm is a combination of the aforementioned exponential e-type acceleration / deceleration and S-type acceleration / deceleration, that is, the exponential model is used in the start-up phase, and the S-model is used in the second half of the acceleration (for details, please refer to the content of Chinese patent application CN111198561A, which will not be repeated here); the half-S-type acceleration / deceleration algorithm is that the acceleration decreases as the speed increases, and the trend of the acceleration curve is similar to that of the "e+S" model.

[0068] S120. Determine the corresponding target speed control range based on the target speed.

[0069] As an optional implementation, for cameras with motion capabilities, including pan-tilt-zoom (PTZ) cameras, the target speed control range is divided according to the motion speed range corresponding to tracking different types of monitored targets.

[0070] In practice, the tracking speed of the camera when tracking different types of monitored targets can be pre-calculated. For any type of monitored target, the appropriate speed range can be determined based on statistical indicators such as the average, maximum, and median values ​​corresponding to that type. For example, for four different types of monitored targets—pedestrians, bicycles, electric vehicles, and motor vehicles—the maximum camera speed V when tracking the corresponding monitored target can be obtained statistically. 行人 V 自行车 V 电动车 V 机动车 Four non-overlapping target velocity control intervals (0, V) can be obtained. 行人 ]、(V 行人 V 自行车 ]、(V 自行车 V 电动车 ]、(V 电动车 V 机动车 In this way, the most efficient control strategy can be selected in subsequent steps to control the camera movement based on the different movement speeds of different types of monitored targets.

[0071] As another optional implementation, if the camera is a pan-tilt camera, the target speed control range is divided according to the inflection point of the torque-frequency characteristic of the camera's motor.

[0072] In practical implementation, the inflection point of the torque-frequency characteristic can be determined by the torque-frequency characteristic curve of the PTZ camera's motor. For example, for a PTZ camera using a stepper motor, the inflection point of the torque-frequency characteristic can be determined by the torque-frequency characteristic curve of the stepper motor. This simplifies the steps of determining the acceleration control curve in subsequent control processes.

[0073] S130. Determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the acceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters and the target speed.

[0074] Among them, the speed control parameters of the speed control model corresponding to the same motion mode are different in different speed control ranges.

[0075] S140. Control the camera movement according to the acceleration control curve.

[0076] In this way, by dividing the speed into multiple different speed control intervals, the embodiments of the present invention set different speed control parameters when the camera moves in the same motion mode in different speed control intervals. This can fully match the maximum torque performance of the camera's motion mechanism in each speed control interval, improve the starting performance at low and medium speeds, reduce starting lag, and enable the camera to start up faster. It can also improve the energy utilization rate of the camera during the motion process, thereby indirectly reducing the camera's motion power consumption.

[0077] Furthermore, such as Figure 4 As shown, if the camera is a PTZ camera, for any speed control interval, the speed control parameters corresponding to the speed control interval are determined in the following way:

[0078] S210. Determine the first acceleration based on the actual maximum output torque corresponding to the maximum acceleration position during the acceleration process of the pan-tilt camera using the target motion mode with the upper limit speed of the speed control range as the target.

[0079] In practice, the actual maximum output torque corresponding to the maximum acceleration position can be determined by the pre-acquired torque-frequency characteristic curve of the PTZ camera. For the same speed control range, the maximum acceleration position may differ for different motion modes. For example, if the first motion mode uses an S-curve model, the maximum acceleration position is at half the upper limit speed of the speed control range; if the third motion mode uses an e+S model, the maximum acceleration position is at the start of acceleration.

[0080] S220. For any moment-frequency characteristic inflection point in the target speed control range, determine the second acceleration based on the first acceleration.

[0081] S230. Determine the speed control parameters corresponding to the target motion mode in the target speed control range based on each of the second accelerations.

[0082] In the specific implementation process, if the target speed control interval corresponds to a moment frequency characteristic inflection point, then the speed control parameters of the target motion mode in the target speed control interval can be directly determined according to the second acceleration corresponding to the moment frequency characteristic inflection point; if the target speed control interval corresponds to multiple moment frequency characteristic inflection points, then the speed control parameters of the target motion mode in the target speed control interval can be determined according to the smallest second acceleration among the second accelerations.

[0083] In practice, different motion modes correspond to different speed control parameters. For example, for the first motion mode described above, the speed control parameter is the maximum acceleration during the entire acceleration process, that is, the second acceleration is directly used as the speed control parameter; while for the second motion mode described above, the speed control parameter is the acceleration time calculated based on the second acceleration. The speed control parameters for other motion modes can be deduced by analogy from the functional properties of the corresponding speed control model, which will not be elaborated here.

[0084] Among them, such as Figure 5 As shown, for any moment-frequency characteristic inflection point in the target velocity control range, the following steps are performed sequentially to determine the second acceleration:

[0085] S221. During the acceleration motion of the pan-tilt camera using the target motion mode, a third acceleration corresponding to the inflection point of the torque-frequency characteristic is determined based on the condition that the upper limit speed of the speed control range is the target and the acceleration at the maximum acceleration position is the first acceleration. The theoretical output torque corresponding to the inflection point of the torque-frequency characteristic is determined based on the third acceleration.

[0086] In practical implementation, it is necessary to determine the third acceleration corresponding to the inflection point of the torque-frequency characteristic based on the functional properties of the velocity control model corresponding to the target motion mode. For example, for the first motion mode mentioned above, the third acceleration needs to be calculated using the linearly changing functional relationship of the acceleration in the S-curve model; while for the second motion mode mentioned above, the third acceleration needs to be calculated using the exponentially changing functional relationship of the acceleration in the exponential model.

[0087] S222. Determine whether the theoretical output torque is less than the actual maximum output torque of the PTZ camera at the inflection point of the torque-frequency characteristic.

[0088] If the result of step S222 is not less than, then step S223 is executed; if the result of step S222 is less than, then step S224 is executed.

[0089] S223. Redetermine the first acceleration. Return to step S221.

[0090] In practice, the method for redetermining the first acceleration can be selected based on the actual performance of the PTZ camera. Each time the first acceleration is redetermined, the current first acceleration can be reduced by a certain value before being used as the redetermined first acceleration. The reduction value can be a preset value, or it can be a preset percentage of the initially determined first acceleration used as the reduction value each time (for example, the reduction value of the first acceleration each time is 5% of the initially determined first acceleration).

[0091] S224. The first acceleration is determined as the second acceleration.

[0092] For example, such as Figure 6As shown, for the first motion mode executed according to the S-shaped acceleration / deceleration algorithm, the position of maximum acceleration is half of the upper limit speed of the speed control range. The actual maximum output torque corresponding to this position can be determined using the torque-frequency characteristic curve based on this speed, and the first acceleration can be determined based on the actual maximum output torque. Since the camera's output torque is not constant, it is also necessary to verify whether the PTZ camera can achieve the acceleration corresponding to the torque-frequency characteristic inflection point during the acceleration process using the target motion mode, with the upper limit speed of the speed control range as the target and the acceleration at the maximum acceleration position as the first acceleration. That is, whether the actual maximum output torque at the torque-frequency characteristic inflection point can support the PTZ camera to achieve the corresponding third acceleration. If the actual maximum output torque at the inflection point of the torque-frequency characteristic is insufficient to support the PTZ camera to reach the corresponding third acceleration, it indicates that the initially determined first acceleration is too large. The acceleration process needs to be slowed down to ensure the PTZ camera can support the acceleration. Therefore, the first acceleration needs to be reduced, and the acceleration at the maximum acceleration position needs to be re-examined during the acceleration process using the target motion mode. Under the condition that the upper limit speed of the speed control range is the target and the acceleration at the maximum acceleration position is the first acceleration, the PTZ camera can reach the acceleration corresponding to the inflection point of the torque-frequency characteristic. If the actual maximum output torque at the inflection point of the torque-frequency characteristic is sufficient to support the PTZ camera to reach the corresponding third acceleration, then the initially determined first acceleration can be used as the second acceleration. Since there is only one inflection point of the torque-frequency characteristic in the target speed control range in this example, the second acceleration can be directly used as the speed control parameter corresponding to the target motion mode in the target speed control range. Based on the S-curve model, the second acceleration, and the target speed, the final acceleration control curve can be determined.

[0093] For a pan-tilt camera, when the camera reaches a motion speed v, the output torque and acceleration satisfy the following relationship:

[0094]

[0095] Among them, T v a is the output torque of the pan-tilt camera when it reaches a motion speed v. v For T v The corresponding acceleration, J 球 Let n be the moment of inertia of the PTZ camera. 传动比 J is the transmission ratio of the PTZ camera. 电机 f is the moment of inertia of the motor shaft of the pan-tilt camera. 球 η is the frictional torque of the PTZ camera. 安全λ is the torque safety factor. 效率 The torque transmission efficiency of the transmission mechanism of the pan-tilt camera.

[0096] In the specific implementation process, η 安全 The value can be 2; for belt-driven pan-tilt cameras, λ 效率 It can take the value 0.9.

[0097] Furthermore, according to the above equation, the first acceleration satisfies the following relationship:

[0098]

[0099] The theoretical output torque corresponding to the inflection point of the torque-frequency characteristic satisfies the following relationship:

[0100]

[0101] Where T1 is the actual maximum output torque corresponding to the position of maximum acceleration, T 拐点理论 Let a1 be the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic, a3 be the first acceleration determined for the first time, and a4 be the third acceleration.

[0102] In this way, based on the characteristics of the stepper motor, the actual maximum output torque of the PTZ camera can be increased in the speed control range of the smaller the movement speed. Compared with the existing technology that controls the acceleration of all speed ranges based on the output torque under high-speed movement, this can improve the acceleration efficiency of the PTZ camera at low target speeds, reduce lag, and ensure that the PTZ movement does not lose steps, thus ensuring the accuracy of the open-loop control of the PTZ camera.

[0103] As an optional implementation, if the motion command includes a motion termination condition (e.g., the motion command indicates the total time of the camera's motion, or the motion command indicates the total path of the camera's motion, etc.), then after controlling the camera's motion according to the acceleration control curve, as follows... Figure 2 As shown, the method further includes:

[0104] S151. Determine the deceleration control curve corresponding to the acceleration control curve, and determine the constant speed control curve based on the acceleration control curve and the deceleration control curve.

[0105] S161. Control the camera movement according to the uniform speed control curve. The uniform speed control curve includes curves with a control time of 0 and curves with a control time of non-0.

[0106] After completing the process of controlling the camera movement according to the uniform speed control curve, S171, control the camera movement according to the deceleration control curve.

[0107] In the specific implementation process, if the total path of the camera's movement is relatively small, the camera will first accelerate according to the acceleration control curve, and then immediately decelerate according to the deceleration control curve after reaching the target speed. Finally, the camera will reach the expected endpoint exactly when it decelerates to 0. In this case, the control time of the uniform speed control curve in step S161 is 0, meaning there is no uniform speed phase during the camera's movement. Conversely, if the total path of the camera's movement is relatively large, the camera will first accelerate according to the acceleration control curve, and after reaching the target speed, it will maintain a uniform speed for a period before decelerating according to the deceleration control curve. Finally, the camera will reach the expected endpoint exactly when it decelerates to 0. In this case, the control time of the uniform speed control curve in step S161 is not 0, meaning there is a uniform speed phase during the camera's movement.

[0108] As another optional implementation, if the motion command does not include a motion termination condition, then after controlling the camera motion according to the acceleration control curve, it also includes (not shown in the figure):

[0109] If no stop command is received from the user when the target speed is reached, the camera is controlled to move at a constant speed according to the target speed; after determining the deceleration control curve corresponding to the acceleration control curve and receiving the stop command triggered by the user, the camera is controlled to move according to the deceleration control curve.

[0110] If a stop command triggered by the user is received before the target speed is reached, a deceleration control curve corresponding to the acceleration control curve is determined, and the camera movement is controlled according to the deceleration control curve.

[0111] For example, such as Figure 7 As shown, the user controls the PTZ camera using the joystick or buttons on the controller in the first motion mode described above. Each motion command triggered by the user does not include a motion termination condition. After determining the target speed, the PTZ camera determines which speed control range the target speed falls within. For example, if the PTZ camera determines the target speed v... x In the corresponding low-speed control range, the second acceleration 'a' corresponding to the low-speed control range is applied. x2 Planning Figure 7 The speed control curve and acceleration curve are shown in medium to thick lines. First, the gimbal is controlled in real time to move towards the target at speed v according to the acceleration control curve ABC. x Accelerate in the direction of the target speed v, until the target speed is reached. x The camera maintains a constant speed until the user resets the joystick or releases the control button to trigger a stop command, then decelerates and stops by pressing the deceleration control curve DEF. For example, if the target speed determined by the PTZ camera is v...y For the corresponding medium-speed control range, the second acceleration a corresponding to the medium-speed control range is applied. y2 Planning Figure 7 The thin solid lines indicate the speed control curve and acceleration curve. First, the PTZ camera is controlled in real-time according to the acceleration control curve AGH to move towards the target at a speed v. y Accelerate in the direction of the target speed v, until the target speed is reached. y It maintains a constant speed until it receives a stop command triggered by the user, at which point it decelerates. Figure 7 (The deceleration process is not shown in the image).

[0112] In the specific implementation process, the method of generating the stop command is similar to that of generating the motion command, and can be referred to the corresponding content above. It will not be repeated here.

[0113] The above solution can achieve better motion control effects for control methods such as jogging / key control.

[0114] Since the acceleration control curve obtained through the solution provided in this embodiment of the invention is a highly efficient acceleration control strategy for the camera in the target motion mode within the target speed control range, and the camera's deceleration process is the opposite of the acceleration process in terms of acceleration direction, the deceleration control curve can be obtained by referring to the acceleration change relationship corresponding to the acceleration control curve and changing the direction of acceleration. Therefore, determining the deceleration control curve corresponding to the acceleration control curve can specifically include any of the following methods:

[0115] (1) Calculate the deceleration control curve using a process similar to that in step S130. That is, determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the deceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed.

[0116] (2) The acceleration control curve is mirrored to obtain the deceleration control curve. For example, if the camera has been moving at a constant speed for a period of time and then receives a stop command triggered by the user, the straight line parallel to the vertical axis and passing through the midpoint of the constant speed movement can be used as the axis of symmetry, and the acceleration control curve is mirrored to obtain the deceleration control curve.

[0117] Based on the same inventive concept, such as Figure 8 As shown, embodiments of the present invention also provide an electronic device, including:

[0118] Trigger module M1 is used to respond to a motion command and determine the target speed and target motion mode corresponding to the motion command, wherein different target motion modes correspond to different speed control models;

[0119] The calculation module M2 is used to determine the corresponding target speed control range based on the target speed; determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range; and obtain the acceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed; wherein the speed control parameters of the speed control model corresponding to the same motion mode are different in different speed control ranges.

[0120] The acceleration module M3 is used to control the camera movement according to the acceleration control curve.

[0121] Optionally, if the camera is a pan-tilt camera, the speed control parameters corresponding to any speed control interval are determined as follows:

[0122] The first acceleration is determined based on the actual maximum output torque corresponding to the maximum acceleration position during the acceleration process of the pan-tilt camera using the target motion mode with the upper limit speed of the speed control range as the target.

[0123] For any moment-frequency characteristic inflection point in the target speed control range, the second acceleration is determined based on the first acceleration;

[0124] Based on each of the second accelerations, determine the speed control parameters corresponding to the target motion mode in the target speed control range;

[0125] Specifically, for any moment-frequency characteristic inflection point within the target velocity control range, the following steps are performed sequentially to determine the second acceleration:

[0126] Based on the conditions that the upper limit speed of the speed control range is taken as the target and the acceleration at the maximum acceleration position is the first acceleration during the acceleration process of the pan-tilt camera using the target motion mode, the third acceleration corresponding to the inflection point of the torque-frequency characteristic is determined, and the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic is determined based on the third acceleration.

[0127] Determine whether the theoretical output torque is less than the actual maximum output torque of the PTZ camera at the inflection point of the torque-frequency characteristic;

[0128] If it is less than, then the first acceleration is determined as the second acceleration;

[0129] If it is not less than, then redetermine the first acceleration and return to the step of determining the third acceleration corresponding to the inflection point of the torque-frequency characteristic.

[0130] Optionally, the re-determining of the first acceleration specifically includes:

[0131] The current first acceleration is reduced and used as the new first acceleration, where the reduction value is determined according to the preset ratio of the first acceleration initially determined.

[0132] Optionally, the first acceleration satisfies the following relationship:

[0133]

[0134] The theoretical output torque corresponding to the inflection point of the torque-frequency characteristic satisfies the following relationship:

[0135]

[0136] Where T1 is the actual maximum output torque corresponding to the position of maximum acceleration, T 拐点理论 J is the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic. 球 Let n be the moment of inertia of the PTZ camera. 传动比 J is the transmission ratio of the PTZ camera. 电机 Let f be the moment of inertia of the motor shaft of the PTZ camera, a1 be the first acceleration determined initially, a3 be the third acceleration, and f be the moment of inertia of the motor shaft of the PTZ camera. 球 η is the frictional torque of the PTZ camera. 安全 λ is the torque safety factor. 效率 The torque transmission efficiency of the transmission mechanism of the pan-tilt camera.

[0137] Optionally, the target speed control range is divided according to the range of motion speeds corresponding to different types of monitored targets;

[0138] Alternatively, if the camera is a PTZ camera, the target speed control range is divided according to the inflection point of the torque-frequency characteristic of the PTZ camera's motor.

[0139] Optionally, if the motion command includes a motion termination condition, the electronic device further includes:

[0140] The constant speed deceleration module M4 is used to determine the deceleration control curve corresponding to the acceleration control curve, and to determine the constant speed control curve based on the acceleration control curve and the deceleration control curve.

[0141] First, the camera movement is controlled according to the uniform speed control curve. After the process of controlling the camera movement according to the uniform speed control curve is completed, the camera movement is controlled according to the deceleration control curve.

[0142] The uniform speed control curve includes a curve with a control time of 0 and a curve with a control time of non-0.

[0143] Optionally, if the motion command does not include a motion termination condition, the electronic device further includes:

[0144] The constant speed deceleration module M4 is used to control the camera to move at a constant speed according to the target speed if no stop command triggered by the user is received when the target speed is reached; after determining the deceleration control curve corresponding to the acceleration control curve and receiving the stop command triggered by the user, the camera is controlled to move according to the deceleration control curve.

[0145] If a stop command triggered by the user is received before the target speed is reached, a deceleration control curve corresponding to the acceleration control curve is determined, and the camera movement is controlled according to the deceleration control curve.

[0146] Optionally, determining the deceleration control curve corresponding to the acceleration control curve includes:

[0147] Determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the deceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed.

[0148] Alternatively, the deceleration control curve can be obtained by mirroring the acceleration control curve.

[0149] In the several embodiments provided in this application, it should be understood that the device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or modules, and may be electrical, mechanical, or other forms.

[0150] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0151] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0152] Since the specific methods by which the various modules of the electronic device perform their operations have been described in detail in the embodiments of the motion control method described above, they will not be repeated here.

[0153] Based on the same inventive concept, embodiments of the present invention also provide an electronic device, such as... Figure 9 As shown, it includes: a processor 110 and a memory 120 for storing instructions executable by the processor 110;

[0154] The processor 110 is configured to execute the instructions to implement the image compression method as described in the first aspect, or the image decompression method as described in the second aspect.

[0155] In specific implementations, the electronic device may vary considerably due to differences in configuration or performance. It may include one or more processors 110, memory 120, and computer-readable storage media 130. The memory 120 and / or computer-readable storage media 130 may contain one or more application programs 131 or data 132. The memory 120 and / or computer-readable storage media 130 may also contain one or more operating systems 133, such as Windows, Mac OS, Linux, iOS, Android, Unix, FreeBSD, etc. The memory 120 and computer-readable storage media 130 may be temporary or persistent storage. The application program 131 may include one or more of the aforementioned modules (…). Figure 9 (Not shown in the image), each module may include a series of instruction operations. Furthermore, the processor 110 may be configured to communicate with the computer-readable storage medium 130 and execute a series of instruction operations in the computer-readable storage medium 130 on the electronic device. The electronic device may also include one or more power supplies (…). Figure 9 (not shown in the image); one or more network interfaces 140, including wired network interface 141 and / or wireless network interface 142; one or more input / output / interfaces 143.

[0156] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that is used to implement the motion control method described above.

[0157] The motion control method, electronic device, and computer-readable storage medium provided in this invention divide the speed into multiple different speed control intervals. By setting different speed control parameters for the camera to move in different speed control intervals with the same motion mode, the maximum torque performance of the camera's motion mechanism in each speed control interval can be fully matched, improving the starting performance at low and medium speeds, reducing start-up lag, and enabling the camera to start up faster. It can also improve the energy utilization rate of the camera during motion, indirectly reducing the camera's motion power consumption.

[0158] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0159] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0160] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0161] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0162] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A motion control method, characterized in that, include: In response to a motion command, the target speed and target motion mode corresponding to the motion command are determined, wherein different target motion modes correspond to different speed control models; Determine the corresponding target speed control range based on the target speed; Determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the acceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed; wherein the speed control parameters of the speed control model corresponding to the same motion mode are different in different speed control ranges; The camera movement is controlled according to the acceleration control curve. Wherein, if the camera is a pan-tilt camera, for any speed control interval, the speed control parameter corresponding to the speed control interval is determined in the following way: The first acceleration is determined based on the actual maximum output torque corresponding to the maximum acceleration position during the acceleration process of the pan-tilt camera using the target motion mode with the upper limit speed of the speed control range as the target. For any moment-frequency characteristic inflection point in the target speed control range, the second acceleration is determined based on the first acceleration; Based on each of the second accelerations, determine the speed control parameters corresponding to the target motion mode in the target speed control range; Specifically, for any moment-frequency characteristic inflection point within the target velocity control range, the following steps are performed sequentially to determine the second acceleration: Based on the conditions that the upper limit speed of the speed control range is taken as the target and the acceleration at the maximum acceleration position is the first acceleration during the acceleration process of the pan-tilt camera using the target motion mode, the third acceleration corresponding to the inflection point of the torque-frequency characteristic is determined, and the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic is determined based on the third acceleration. Determine whether the theoretical output torque is less than the actual maximum output torque of the PTZ camera at the inflection point of the torque-frequency characteristic; If it is less than, then the first acceleration is determined as the second acceleration; If it is not less than, then redetermine the first acceleration and return to the step of determining the third acceleration corresponding to the inflection point of the torque-frequency characteristic.

2. The method as described in claim 1, characterized in that, The re-determination of the first acceleration specifically includes: The current first acceleration is reduced and used as the new first acceleration, where the reduction value is determined according to the preset ratio of the first acceleration initially determined.

3. The method as described in claim 1, characterized in that, The first acceleration satisfies the following relationship: The theoretical output torque corresponding to the inflection point of the torque-frequency characteristic satisfies the following relationship: in, This refers to the actual maximum output torque corresponding to the location of maximum acceleration. This is the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic. Let be the moment of inertia of the PTZ camera. This refers to the transmission ratio of the PTZ camera. This refers to the moment of inertia of the motor shaft of the pan-tilt camera. The first acceleration is determined for the first time. The third acceleration, The frictional torque of the PTZ camera is... For torque safety factor, The torque transmission efficiency of the transmission mechanism of the pan-tilt camera.

4. The method as described in claim 1, characterized in that, The target speed control range is defined based on the range of movement speeds corresponding to different types of monitored targets. Alternatively, if the camera is a PTZ camera, the target speed control range is divided according to the inflection point of the torque-frequency characteristic of the PTZ camera's motor.

5. The method as described in claim 1, characterized in that, If the motion command includes a motion termination condition, then after controlling the camera motion according to the acceleration control curve, the method further includes: Determine the deceleration control curve corresponding to the acceleration control curve, and determine the constant speed control curve based on the acceleration control curve and the deceleration control curve; First, the camera movement is controlled according to the uniform speed control curve. After the process of controlling the camera movement according to the uniform speed control curve is completed, the camera movement is controlled according to the deceleration control curve. The uniform speed control curve includes a curve with a control time of 0 and a curve with a control time of non-0.

6. The method as described in claim 1, characterized in that, If the motion command does not include a motion termination condition, then after controlling the camera movement according to the acceleration control curve, it also includes: If no stop command is received from the user when the target speed is reached, the camera is controlled to move at a constant speed according to the target speed; after determining the deceleration control curve corresponding to the acceleration control curve and receiving the stop command triggered by the user, the camera is controlled to move according to the deceleration control curve. If a stop command triggered by the user is received before the target speed is reached, a deceleration control curve corresponding to the acceleration control curve is determined, and the camera movement is controlled according to the deceleration control curve.

7. The method as described in claim 5 or 6, characterized in that, Determining the deceleration control curve corresponding to the acceleration control curve includes: Determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the deceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed. Alternatively, the deceleration control curve can be obtained by mirroring the acceleration control curve.

8. An electronic device, characterized in that, include: A trigger module is used to respond to a motion command and determine the target speed and target motion mode corresponding to the motion command, wherein different target motion modes correspond to different speed control models; The calculation module is used to determine the corresponding target speed control range based on the target speed; Determine the speed control parameters of the speed control model corresponding to the target motion mode in the target speed control range, and obtain the acceleration control curve corresponding to the target speed control range based on the target motion mode, the speed control parameters, and the target speed. The speed control parameters for the same motion mode are different in different speed control ranges. An acceleration module is used to control the camera movement according to the acceleration control curve; Wherein, if the camera is a pan-tilt camera, for any speed control interval, the speed control parameter corresponding to the speed control interval is determined in the following way: The first acceleration is determined based on the actual maximum output torque corresponding to the maximum acceleration position during the acceleration process of the pan-tilt camera using the target motion mode with the upper limit speed of the speed control range as the target. For any moment-frequency characteristic inflection point in the target speed control range, the second acceleration is determined based on the first acceleration; Based on each of the second accelerations, determine the speed control parameters corresponding to the target motion mode in the target speed control range; Specifically, for any moment-frequency characteristic inflection point within the target velocity control range, the following steps are performed sequentially to determine the second acceleration: Based on the conditions that the upper limit speed of the speed control range is taken as the target and the acceleration at the maximum acceleration position is the first acceleration during the acceleration process of the pan-tilt camera using the target motion mode, the third acceleration corresponding to the inflection point of the torque-frequency characteristic is determined, and the theoretical output torque corresponding to the inflection point of the torque-frequency characteristic is determined based on the third acceleration. Determine whether the theoretical output torque is less than the actual maximum output torque of the PTZ camera at the inflection point of the torque-frequency characteristic; If it is less than, then the first acceleration is determined as the second acceleration; If it is not less than, then redetermine the first acceleration and return to the step of determining the third acceleration corresponding to the inflection point of the torque-frequency characteristic.

9. An electronic device, characterized in that, include: A processor and a memory for storing processor-executable instructions; The processor is configured to execute the instructions to implement the motion control method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the motion control method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Motion control method and device for target tracking, computer equipment and storage medium

    CN111198561A

  • Motion control method and device, storage medium and electronic device

    CN112399086A

  • Method and device for determining motion parameters of camera holder, and storage medium

    CN112866569A