A method for detecting and recovering a pan-tilt camera from an unexpected turn

By installing a magnet and a magnetic encoder in the vertical stepper motor of the pan/tilt camera, and using the angle information of the magnetic encoder to adjust the number of motor pulses, the problem of large errors and high costs in the detection of unexpected U-turns of the pan/tilt camera is solved, and accurate positioning is achieved. recover.

CN116248853BActive Publication Date: 2024-10-08CHINA KEY SYST & INTEGRATED CIRCUIT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211572101.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2024-10-08
Estimated Expiration
2042-12-08

AI Technical Summary

Technical Problem

The PTZ camera accidentally turns around due to jitter or wind in the external environment. The existing technology has large detection errors, high costs, and complex program processing, making it difficult to accurately detect and restore the original position.

Method used

Install a magnet and a magnetic encoder in the vertical stepper motor, obtain the rotation angle of the magnetic encoder through the MCU main controller, set the upper limit point of the vertical stepper motor to 0°, and use the angle accumulation and reduction values ​​of the magnetic encoder Adjust the number of motor pulses to detect and restore the original position of the pan/tilt camera.

Benefits of technology

It achieves accurate detection and recovery of U-turns caused by external force changes when the pan/tilt camera is stopped or fixed, reducing errors and costs, and simplifying program processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248853B_ABST
    Figure CN116248853B_ABST
Patent Text Reader

Abstract

The invention discloses a method for detecting and restoring an unexpected U-turn of a pan-tilt camera, and belongs to the field of video image monitoring. When the pan-tilt camera stops or monitors at a designated fixed position, when an external force causes the camera to turn downward, the MCU main controller does not control the rotation of the vertical stepper motor, so the vertical mechanism angle based on the vertical stepper motor remains unchanged, but the vertical mechanism angle based on the magnetic encoder changes; the MCU main controller of the pan-tilt camera compares the vertical mechanism angle based on the magnetic encoder with the vertical mechanism angle based on the vertical stepper motor, and if the difference exceeds a preset threshold, the MCU main controller modifies the vertical mechanism angle based on the vertical stepper motor to the vertical mechanism angle based on the magnetic encoder, and takes the original vertical mechanism angle based on the vertical stepper motor as the target, starts the vertical stepper motor to rotate to the target position, thereby restoring to the position before the pan-tilt camera is changed by the external force.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of video image monitoring, and in particular to a method for detecting and restoring an accidental U-turn of a pan / tilt camera. Background Art

[0002] For PTZ cameras installed outdoors, such as those installed on roads and bridges, external factors such as traffic and wind may cause the PTZ camera to accidentally turn in its pitch direction due to shaking or wind, thereby changing the camera image. In severe cases, the camera may point vertically downward, giving people the impression that the PTZ camera is damaged. However, the PTZ camera can actually be controlled to rotate upward or downward and it can rotate normally.

[0003] In order to solve this problem, a solution was proposed: add Hall-sensing cylindrical magnets in a regular pattern on the path that the PTZ camera must pass through to drive the vertical mechanism to rotate. However, there is an error in detection, especially between two magnets with a large angle, the error is even greater, and it may not be detected after the external force changes; and multiple magnets increase the cost and the difficulty of program processing. Summary of the invention

[0004] The purpose of the present invention is to provide a method for detecting and restoring an accidental U-turn of a pan / tilt camera, so as to solve the problems in the background technology.

[0005] In order to solve the above technical problems, the present invention provides a method for detecting and recovering an accidental U-turn of a pan / tilt camera, comprising:

[0006] A magnet is mounted on a back section of a motor shaft in a vertical stepping motor, and a PCB board is mounted on the back of the vertical stepping motor, wherein a magnetic encoder is mounted on the PCB board;

[0007] The MCU main controller of the PTZ camera obtains the rotation angle of the magnetic encoder. After powering on, the MCU main controller first controls the vertical stepper motor to move downward for a distance, and then moves upward until the Hall sensor for positioning detection at the upper limit position is found. This position is taken as the upper limit point of the vertical stepper motor, and the vertical mechanism angle based on the vertical stepper motor is set to 0°, that is, the number of vertical stepper motor pulses is set to 0;

[0008] At the same time, the angle of the magnetic encoder is obtained at the upper limit point, and the accumulated rotation angle of the magnetic encoder at this position is set to 0°; from the upper limit point, the vertical stepper motor drives the pan / tilt camera to move downward, the angle value of the magnetic encoder increases cyclically, and the accumulated rotation value of the magnetic encoder also increases; then the vertical stepper motor drives the pan / tilt camera to move upward, the angle value of the magnetic encoder decreases cyclically, and the accumulated rotation value of the magnetic encoder also decreases, until it moves to the upper limit point and drops to 0 degrees;

[0009] When the PTZ camera stops or monitors at a specified fixed position, when external force causes the camera to turn downward, the MCU main controller does not control the vertical stepper motor to rotate, so the vertical mechanism angle based on the vertical stepper motor remains unchanged, but the vertical mechanism angle based on the magnetic encoder changes;

[0010] The MCU main controller of the pan-tilt camera compares the vertical mechanism angle based on the magnetic encoder with the vertical mechanism angle based on the vertical stepper motor. If the difference exceeds the preset threshold, the MCU main controller will modify the vertical mechanism angle based on the vertical stepper motor to the vertical mechanism angle based on the magnetic encoder, and start the vertical stepper motor to rotate to the target position with the original vertical mechanism angle based on the vertical stepper motor as the target, thereby restoring the position of the pan-tilt camera before the external force changed it.

[0011] In one embodiment, the magnetic encoder faces the magnet, and the distance between the two meets the requirements of the magnetic encoder.

[0012] In one embodiment, when the vertical stepping motor rotates, the motor shaft drives the magnet to rotate, and the north and south magnetic lines of force of the magnet rotate synchronously. When the rotating magnetic lines of force pass through the magnetic encoder, the magnetic encoder outputs angle information between 0 and 360 degrees.

[0013] In one embodiment, it is defined that starting from the upper limit point position, the vertical stepper motor drives the pan-tilt camera to move downward, the number of pulses marking the vertical stepper motor increases, and the angle value of the vertical mechanism increases; after leaving the upper limit point position, it moves upward again, the number of pulses marking the vertical stepper motor decreases, and the angle value of the vertical mechanism decreases, until it moves to the upper limit point position and drops to 0 degrees; according to the maximum range value of the angle that the vertical mechanism can rotate from the upper limit point position downward, the maximum pulse value of the vertical stepper motor rotation is set.

[0014] In one embodiment, the accumulated rotation value of the magnetic encoder is calculated in the timer interrupt service function of the MCU main controller: each time the timer interrupt service function is entered, the accumulated rotation value of the magnetic encoder is added to the difference between the current magnetic encoder angle and the previous magnetic encoder angle value.

[0015] In one embodiment, the relationship between the accumulated value of the angle rotation of the magnetic encoder and the vertical mechanism angle is calculated by the following formula:

[0016] Vertical mechanism angle = accumulated value of magnetic encoder rotation / transmission ratio of vertical mechanism and motor.

[0017] The present invention provides a method for detecting and recovering an accidental U-turn of a pan-tilt camera. When the pan-tilt camera is stopped or monitoring at a designated fixed position, when an external force causes the camera to turn downward, the vertical stepping motor can be started to rotate to a target position, thereby recovering to the position before the external force changed the pan-tilt camera. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a schematic diagram of the connection structure between the vertical stepping motor and the magnetic encoder.

[0019] Figure 2 This is a schematic diagram of the connection between the MCU main controller and the magnetic encoder via SPI.

[0020] Figure 3 The present invention provides a flow chart of a method for detecting and recovering an accidental U-turn of a pan / tilt camera. DETAILED DESCRIPTION

[0021] The following is a further detailed description of a method for detecting and recovering a pan-tilt camera accidentally turning around, in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description. It should be noted that the accompanying drawings are in a very simplified form and are not in precise proportions, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention.

[0022] like Figure 1 As shown, the magnet 2 is installed on the back section of the motor shaft 3 in the vertical stepping motor 6 of the pan-tilt camera, and the PCB board 4 is installed on the back of the vertical stepping motor 6 through the screws 5. A magnetic encoder 1 is installed on the PCB board 4. The magnetic encoder 1 is facing the magnet 2, and the distance between the two is set to meet the requirements of the magnetic encoder.

[0023] In the above-mentioned installed device, when the vertical stepping motor 6 rotates, the motor shaft 3 drives the magnet 2 to rotate, and the north and south magnetic lines of force of the magnet 2 rotate synchronously. When the rotating magnetic lines of force pass through the magnetic encoder 1, the magnetic encoder 1 outputs angle information between 0 and 360 degrees.

[0024] The magnetic encoder 1 is connected to the MCU main controller CKS32F1x via SPI (serial communication interface). Figure 2 As shown, the processor obtains the rotation angle of the magnetic encoder 1 through the SPI interface.

[0025] like Figure 3As shown in the figure, after powering on, the MCU main controller CKS32F1x of the PTZ camera controls the vertical stepper motor to move downward for a distance, and then move upward until it finds the Hall sensor for upper limit position detection, and this position is the upper limit point of the vertical stepper motor. Set the vertical mechanism angle to 0°, that is, set the vertical stepper motor pulse number to 0; the vertical mechanism is a mechanism with a gear, which is driven by the gear of the vertical stepper motor to move vertically up and down, and has a transmission ratio coefficient with the vertical stepper motor.

[0026] The vertical mechanism angle and the number of stepper motor pulses can be calculated by the following formula:

[0027]

[0028] Define that starting from the upper limit point, the vertical stepper motor drives the PTZ camera to move downward, the number of pulses marking the vertical stepper motor increases, and the vertical mechanism angle value increases; after leaving the upper limit point, it moves upward again, the number of pulses marking the vertical stepper motor decreases, and the vertical mechanism angle value decreases until it moves to the upper limit point and drops to 0 degrees. According to the maximum range of the vertical mechanism's rotation angle from the upper limit point, set the maximum pulse value of the vertical stepper motor's rotation.

[0029] At the given upper limit point, the angle of the magnetic encoder is obtained. The accumulated rotation angle of the magnetic encoder at this position is set to 0°; from the upper limit point, the vertical stepper motor drives the PTZ camera to move downward, the angle value of the magnetic encoder increases cyclically, and the accumulated rotation value of the magnetic encoder also increases; then the vertical stepper motor drives the PTZ camera to move upward, the angle value of the magnetic encoder decreases cyclically, and the accumulated rotation value of the magnetic encoder also decreases, until it moves to the upper limit point and drops to 0 degrees.

[0030] The angle value of the magnetic encoder is obtained in the timer interrupt service program of the MCU main controller CKS32F1x; the accumulated rotation value of the magnetic encoder is calculated in the timer interrupt service function: each time the timer interrupt service function is entered, the accumulated rotation value of the magnetic encoder is added to the difference between the current magnetic encoder angle and the previous magnetic encoder angle value.

[0031] The relationship between the accumulated angle rotation value obtained by the magnetic encoder and the vertical mechanism angle can be calculated by the following formula:

[0032]

[0033] When the PTZ camera stops or monitors at a specified fixed position, when external force causes the camera to turn downward, the MCU main controller CKS32F1x does not control the rotation of the vertical stepper motor. Therefore, the vertical mechanism angle based on the vertical stepper motor remains unchanged, but the vertical mechanism angle based on the magnetic encoder changes.

[0034] The MCU main controller CKS32F1x of the pan-tilt camera compares the vertical mechanism angle based on the magnetic encoder with the vertical mechanism angle based on the vertical stepper motor. If the difference exceeds a certain threshold, the MCU main controller CKS32F1x will modify the vertical mechanism angle based on the vertical stepper motor to the vertical mechanism angle based on the magnetic encoder, and start the vertical stepper motor to rotate to the target position with the original vertical mechanism angle based on the vertical stepper motor as the target, thereby restoring the position of the pan-tilt camera before the external force changed it.

[0035] The above description is only a description of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any changes or modifications made by a person skilled in the art in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.

Claims

1. A method for detecting and recovering an accidental U-turn of a PTZ camera, characterized in that: include: A magnet is mounted on a back section of a motor shaft in a vertical stepping motor, and a PCB board is mounted on the back of the vertical stepping motor, wherein a magnetic encoder is mounted on the PCB board; The MCU main controller of the PTZ camera obtains the rotation angle of the magnetic encoder. After powering on, the MCU main controller first controls the vertical stepper motor to move downward for a distance, and then moves upward until the Hall sensor for positioning detection at the upper limit position is found. This position is taken as the upper limit point of the vertical stepper motor, and the vertical mechanism angle based on the vertical stepper motor is set to 0°, that is, the number of vertical stepper motor pulses is set to 0; At the same time, the angle of the magnetic encoder is obtained at the upper limit point, and the accumulated rotation angle of the magnetic encoder at this position is set to 0°; from the upper limit point, the vertical stepper motor drives the pan / tilt camera to move downward, the angle value of the magnetic encoder increases cyclically, and the accumulated rotation value of the magnetic encoder also increases; then the vertical stepper motor drives the pan / tilt camera to move upward, the angle value of the magnetic encoder decreases cyclically, and the accumulated rotation value of the magnetic encoder also decreases, until it moves to the upper limit point and drops to 0 degrees; When the PTZ camera stops or monitors at a specified fixed position, when external force causes the camera to turn downward, the MCU main controller does not control the vertical stepper motor to rotate, so the vertical mechanism angle based on the vertical stepper motor remains unchanged, but the vertical mechanism angle based on the magnetic encoder changes; The MCU main controller of the pan-tilt camera compares the vertical mechanism angle based on the magnetic encoder with the vertical mechanism angle based on the vertical stepper motor. If the difference exceeds the preset threshold, the MCU main controller will modify the vertical mechanism angle based on the vertical stepper motor to the vertical mechanism angle based on the magnetic encoder, and start the vertical stepper motor to rotate to the target position with the original vertical mechanism angle based on the vertical stepper motor as the target, thereby restoring the position of the pan-tilt camera before the external force changed it.

2. The method for detecting and recovering an accidental U-turn of a PTZ camera as claimed in claim 1, characterized in that: The magnetic encoder faces the magnet, and the distance between the two meets the requirements of the magnetic encoder.

3. The method for detecting and recovering an accidental U-turn of a PTZ camera as claimed in claim 1, characterized in that: When the vertical stepping motor rotates, the motor shaft drives the magnet to rotate, and the north and south magnetic force lines of the magnet rotate synchronously. When the rotating magnetic force lines pass through the magnetic encoder, the magnetic encoder outputs angle information between 0 and 360 degrees.

4. The method for detecting and recovering an accidental U-turn of a PTZ camera as claimed in claim 1, characterized in that: It is defined that starting from the upper limit point, the vertical stepper motor drives the PTZ camera to move downward, the number of pulses marking the vertical stepper motor increases, and the vertical mechanism angle value increases; after leaving the upper limit point, it moves upward again, the number of pulses marking the vertical stepper motor decreases, and the vertical mechanism angle value decreases, until it moves to the upper limit point and drops to 0 degrees; according to the maximum range of the angle that the vertical mechanism can rotate from the upper limit point downward, the maximum pulse value of the vertical stepper motor rotation is set.

5. The method for detecting and recovering an accidental U-turn of a PTZ camera as claimed in claim 1, characterized in that: The accumulated rotation value of the magnetic encoder is calculated in the timer interrupt service function of the MCU main controller: each time the timer interrupt service function is entered, the accumulated rotation value of the magnetic encoder is added with the difference between the current magnetic encoder angle and the previous magnetic encoder angle value.

6. The method for detecting and recovering an accidental U-turn of a PTZ camera as claimed in claim 5, characterized in that: The relationship between the accumulated value of the angle rotation of the magnetic encoder and the vertical mechanism angle is calculated by the following formula: vertical mechanism angle = accumulated value of the angle rotation of the magnetic encoder / transmission ratio of the vertical mechanism to the motor.