A display control method for driving servo azimuth and pitch rotation through a pointer dial
Through the display control method of pitch and rotation of the servo direction driving the pointer dial, the problem of insufficient intuitiveness and accuracy in the control method of photoelectric reconnaissance rotary table is solved, and accurate and intuitive servo control is achieved, which simplifies the operation process and improves the user experience.
Patent Information
- Application Number
- CN202411840300.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-12-13
AI Technical Summary
The existing photoelectric reconnaissance turntable control method cannot intuitively display the current position of the servo, the control accuracy is not high and the operation is complicated, especially when adjusting the target quickly and accurately, there are errors and troubles.
The display control method of driving the servo direction pitch and rotation of the pointer dial is adopted. By drawing the azimuth and pitch dial in the user interface, using the mouse and scroll wheel operations to generate angle commands, and combining the servo motor and position sensor to update the dial pointer position in real time to achieve precise control.
It provides accurate, intuitive and easy-to-operate servo orientation and pitch control, reduces misoperation and learning costs, and improves operation accuracy and user experience.
Smart Images

Figure CN119717896B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of optoelectronic detection, and in particular, a display control method for driving servo azimuth and elevation rotation through a pointer dial. Background Art
[0002] Optoelectronic detection turrets are widely used in important areas such as border control and coastline surveillance. Their main function is to identify and track targets (such as people, vehicles, ships, unmanned aerial vehicles, etc.) through the mounted optoelectronic balls. The optoelectronic detection turret generally consists of an optoelectronic ball and a bottom base. The optoelectronic ball is connected to the base through a servo slip ring and is internally equipped with a visible light lens and an infrared lens. By controlling the servo motor of the indoor display control terminal, the optoelectronic ball can rotate within the range of 0° to 360° in the horizontal azimuth and -90° to +90° in the elevation angle, thereby realizing the all-round monitoring of the target.
[0003] The existing control methods for optoelectronic detection turrets mainly include rocker control and direction key control, and both of these methods have certain deficiencies:
[0004] It is impossible to intuitively display the current position of the servo: The user cannot clearly and real-time know the azimuth and elevation angle where the current servo is located, lacking intuitive feedback.
[0005] The control accuracy is not high: When using rocker control, the accuracy of angle adjustment is relatively low. Especially when aiming at the target, multiple fine-tuning operations are required.
[0006] The operation is complex: The operation method of direction key control is complex and easy to be confused. Especially when controlling the azimuth rotation, the clockwise and counterclockwise directions are likely to cause trouble to the user. Summary of the Invention
[0007] The purpose of the present invention is to provide a display control method for driving servo azimuth and elevation rotation through a pointer dial, which solves the technical problems of providing accurate, intuitive and easy-to-operate servo azimuth control and elevation control.
[0008] To achieve the above purpose, the present invention adopts the following technical solution:
[0009] A display control method for driving servo azimuth and elevation rotation through a pointer dial, comprising the following steps:
[0010] Step 1: The user interface module draws an azimuth dial in a square QWidget control. The dial consists of 36 scale points, indicating different azimuth angles. Each scale point is spaced 10°. The position relationship is calculated through trigonometric functions, and the pointer points to the current angle, with the rotation control accurate to every 1°.
[0011] Draw a pitch dial inside the QWidget control, which contains 18 scale points, each point representing a pitch angle ranging from -90° to +90°. The pointer only moves within the left semi-circle range;
[0012] Step 2: The control module is used to obtain the control signals sent by the mouse. Specifically, the user double-clicks on the target angle on the dial through the mouse to control the servo motor to rotate to that angle. The mouse coordinates are converted into angle values, and a mouse control signal is issued when double-clicking to adjust the servo angle; The mouse wheel is used to finely adjust the azimuth or pitch angle. Each roll increases or decreases by 1°, and a azimuth or pitch control signal is issued through forward or reverse rolling to control the servo rotation;
[0013] Based on the horizontal control signal and the pitch control signal, obtain the current mouse position or rolling direction, and calculate the target azimuth or pitch angle to generate azimuth and pitch angle commands;
[0014] Step 3: The servo motor module reads the azimuth and pitch angle commands in real time and drives the motor to perform the corresponding rotation;
[0015] Step 4: The feedback module includes a position sensor, which is used to monitor the current position information of the motor in real time and transmit the data to the control module. The control module updates the pointer position of the dial in real time according to the feedback position information and displays the current actual angle of the servo motor for the user through the user interface module.
[0016] Preferably, when performing Step 1, when drawing the azimuth dial in the interface design, calculate the coordinate position of each scale through trigonometric functions and draw the pointer of the horizontal angle dial to point to the current angle; Similarly, when drawing the pitch dial, use trigonometric functions to calculate the scale position corresponding to the pitch angle and draw the pointer of the pitch angle dial so that it can only rotate within the left semi-circle.
[0017] Preferably, when performing Step 2, when the user double-clicks, convert the coordinates of the mouse position into an angle to generate a horizontal control signal or a pitch control signal for adjusting the servo motor, and the pointer follows the angle change; When the user scrolls the mouse wheel, judge whether it is clockwise or counterclockwise adjustment according to the rolling direction, and fix the adjustment step size to 1° to generate an azimuth or pitch control signal.
[0018] Preferably, the position sensor is a rotary encoder or a gyroscope.
[0019] Preferably, the control module receives the data input by the user interface module through a network cable, including the mouse position and the scroll wheel operation, and sends the generated azimuth and pitch angle commands to the servo motor module through a serial communication interface or a CAN bus interface. The servo motor module generates corresponding PWM signals according to the azimuth and pitch angle commands to control the motor speed or angle control. The feedback module feeds back the real-time monitored current position information of the motor to the control module through a serial communication interface or a CAN bus interface, and the control module then sends it to the user interface module through the network cable. The user interface module presents the current position information of the motor on the azimuth dial or the pitch dial according to the feedback.
[0020] A display control method for driving servo azimuth and pitch rotation through a pointer dial according to the present invention solves the technical problem of providing precise, intuitive, and easy-to-operate servo azimuth control and pitch control. In the present invention, the user can precisely control the rotation angle of the servo by double-clicking the mouse or sliding the scroll wheel, avoiding the errors and repeated adjustment problems in traditional joystick and direction key controls. The azimuth and pitch angles are displayed in real time through the scale of the dial and the rotation of the pointer, enabling the user to clearly know the current position and the target position of the servo, and the operation is more intuitive. Double-clicking the mouse and scroll wheel control replace the traditional multi-step operation method, with simple and intuitive operation, greatly reducing misoperations and learning costs. Compared with the traditional joystick and direction key control methods, the present invention can greatly improve the operation accuracy, especially when quickly and accurately adjusting to a specified angle, providing a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flowchart of the present invention;
[0022] Figure 2 is a schematic diagram of the azimuth dial interface of the present invention;
[0023] Figure 3 is a schematic diagram of the pitch dial interface of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0024] As Figures 1 - 3 shown, a display control method for driving servo azimuth and pitch rotation through a pointer dial includes the following steps:
[0025] Step 1: The user interface module draws an azimuth dial in a square QWidget control. The dial consists of 36 scale points, indicating different azimuth angles, with an interval of 10° between each scale point. The position relationship is calculated through trigonometric functions, and the pointer points to the current angle, with the rotation control accurate to every 1°;
[0026] Draw a pitch dial within the QWidget control, which contains 18 scale points, each point representing a pitch angle from -90° to +90°, and the pointer only moves within the left semi-circle range;
[0027] When drawing an azimuth dial in the interface design, calculate the coordinate positions of each scale through trigonometric functions, and draw the pointer of the horizontal angle dial to point to the current angle; similarly, when drawing the pitch dial, use trigonometric functions to calculate the scale positions corresponding to the pitch angles, and draw the pointer of the pitch angle dial so that it can only rotate within the left semi-circle.
[0028] QWidget is used to create and draw dial controls, which are used to control the azimuth and pitch angles of the servo motor. Specifically, QWidget is a container control used to hold and display graphical interface components, such as the azimuth dial and pitch dial mentioned in this embodiment.
[0029] Drawing graphics: QWidget can be used to draw custom graphics, such as dials, pointers, etc. In this embodiment, QWidget is used to draw the graphics of the azimuth dial and pitch dial.
[0030] Handling events: QWidget can receive events input by the user, such as mouse clicks, mouse movements, scroll wheel scrolls, etc., and corresponding operations can be performed in the event handling function.
[0031] Sub-control management: QWidget can contain other controls (such as buttons, text boxes, etc.) and allows layout management of these controls.
[0032] Control size and position management: Through QWidget, the size, position of the control can be set, and its display and hiding can be controlled.
[0033] Drawing callback: The paintEvent method of QWidget can be overridden to achieve custom drawing, such as drawing dial scales, pointers, and other UI elements.
[0034] In this embodiment, the specific azimuth dial interface design includes designing an azimuth dial, which consists of a circle composed of 36 scale points and a dial pointer starting from the center of the circle and pointing to the scale points. The specific steps are as follows:
[0035] Step 1-1: Create a square QWidget control with a size of a. The actual coordinates of the QWidget control take the upper left corner as the coordinate origin (0, 0), the horizontal right is the positive direction of the x-axis, and the vertical down is the positive direction of the y-axis.
[0036] Step 1-2: Take (a / 2, a / 2) as the center of the dial, draw the center point with a pixel of 4.
[0037] Step 1-3: Starting from directly above the center of the circle, draw tick marks at a radius of a / 3, numbered 0. Each tick mark is spaced 10° apart, for a total of 36 tick marks, with n having a maximum value of 35. The drawing coordinates of the tick marks are (a / 2 + a / 3×sin(n×10°), a / 2 - a / 3×cos(n×10°)), where n is the sequence number of the currently drawn tick mark.
[0038] Step 1-4: The dial pointer is drawn by drawing two lines with (-1, -1) and (1, 1) as the origin points and (0, -a / 3) as the end points respectively, and then translating them to the position of (a / 2, a / 2), and rotating according to the current angle so that the pointer points to the set angle. The initial angle is 0°.
[0039] The specific pitch dial consists of a left semi-circle composed of 18 tick marks and a dial pointer pointing from the center of the circle to the tick marks. The movement range of the dial pointer is only within the left semi-circle area. The specific steps are as follows:
[0040] Step 1-5: Create a QWidget control with a size of a. The actual coordinates of the QWidget control use the upper left corner as the coordinate origin (0, 0), with the horizontal right as the positive x-axis direction and the vertical down as the positive y-axis direction;
[0041] Step 1-6: Using (a / 2, a / 2) as the center of the dial, draw the center point with a pixel size of 4. Starting from directly below the center of the circle, draw tick marks at a radius of a / 3, numbered 18, with a scale value of -90°. Each tick mark above increases by 10°, for a total of 18 tick marks, with n having a maximum value of 35. The drawing coordinates of the tick marks are (a / 2 + a / 3×sin(n×10°), a / 2 - a / 3×cos(n×10°)), where n is the sequence number of the currently drawn tick mark.
[0042] Step 1-7: The dial pointer is drawn by drawing two lines with (-1, -1) and (1, 1) as the origin points and (0, -a / 3) as the end points respectively, and then translating them to the position of (a / 2, a / 2), and rotating according to the current angle so that the pointer points to the set angle. The initial angle is 270°.
[0043] Step 2: The control module is used to obtain the control signals sent by the mouse. Specifically, the user double-clicks on the target angle on the dial through the mouse to control the servo motor to rotate to that angle. The mouse coordinates are converted into angle values, and a mouse control signal is sent when double-clicking to adjust the servo angle; the mouse wheel is used to finely adjust the azimuth or pitch angle, with each roll increasing or decreasing by 1°. By rolling forward or backward, an azimuth or pitch control signal is sent to control the servo rotation;
[0044] Based on the horizontal control signal and the pitch control signal, obtain the current mouse position or scroll direction, and calculate the target azimuth or pitch angle to generate azimuth and pitch angle commands;
[0045] When the user double-clicks, the coordinates of the mouse position are converted into an angle, generating a horizontal control signal or a pitch control signal for adjusting the servo motor, and the pointer follows the angle change; when the user scrolls the mouse wheel, it is judged whether it is clockwise or counterclockwise adjustment according to the scrolling direction, and the adjustment step is fixed at 1°, generating an azimuth or pitch control signal.
[0046] In this embodiment, the mouse real-time displays the current corresponding azimuth and pitch angles within the dial. It is necessary to convert the current control coordinates of the mouse according to the position of the center of the circle and the distance from the mouse to the center of the circle into the corresponding azimuth angle and pitch angle within the dial.
[0047] When the mouse position is at the servo azimuth / pitch angle to be set, double-click the left mouse button to perform the control operation.
[0048] Scroll the mouse wheel, with each scroll step being 1°. When controlling the azimuth, scrolling up on the wheel is clockwise rotation; when controlling the pitch, scrolling up on the wheel is upward rotation.
[0049] Step 3: The servo motor module reads the azimuth and pitch angle commands in real time and drives the motor to perform the corresponding rotation;
[0050] In this embodiment, after receiving the azimuth and pitch angle commands, the servo motor module checks whether the current position of the servo motor is consistent with the position indicated by the azimuth and pitch angle commands according to the information fed back by the feedback module. If they are consistent, the servo motor is not driven to act additionally. Otherwise, the servo motor is driven to act.
[0051] Step 4: The feedback module includes a position sensor for real-time monitoring of the current position information of the motor and transmitting the data to the control module. The control module updates the pointer position of the dial in real time according to the fed-back position information and displays the current actual angle of the servo motor for the user through the user interface module. The position sensor is a rotary encoder or a gyroscope.
[0052] In this embodiment, the control module receives the data input by the user interface module through the network cable, including the mouse position and the scroll wheel operation, and sends the generated azimuth and pitch angle commands to the servo motor module through the serial communication interface or the CAN bus interface. The servo motor module generates the corresponding PWM signal according to the azimuth and pitch angle commands to control the motor speed or angle control. The feedback module feeds back the real-time monitored current position information of the motor to the control module through the serial communication interface or the CAN bus interface, and the control module then sends it to the user interface module through the network cable. The user interface module shows it on the azimuth dial or the pitch dial according to the fed-back current position information of the motor.
[0053] A display control method for driving servo azimuth and elevation rotation through a pointer dial according to the present invention solves the technical problem of providing precise, intuitive, and easy-to-operate servo azimuth control and elevation control. In the present invention, the user can precisely control the rotation angle of the servo by double-clicking the mouse or sliding the scroll wheel, avoiding the errors and repeated adjustment problems in traditional joystick and arrow key controls. The azimuth and elevation angles are displayed in real time through the scale of the dial and the rotation of the pointer, enabling the user to clearly know the current position and target position of the servo, and the operation is more intuitive. The double-click of the mouse and the scroll wheel control replace the traditional multi-step operation method, and the operation is simple and intuitive, greatly reducing the misoperation and learning cost. Compared with the traditional joystick and arrow key control methods, the present invention can significantly improve the operation accuracy, especially when quickly and accurately adjusting to a specified angle, and the user experience is better.
Claims
1. A display control method for driving servo azimuth and pitch rotation through a pointer dial, characterized in that: It includes the following steps: Step 1: The user interface module draws an azimuth dial in a square QWidget control. The dial consists of 36 scale points indicating different azimuth angles, with each scale point spaced 10°. The positional relationship between the scale points is calculated using trigonometric functions. The pointer points to the current angle, and the rotation control is accurate to every 1°; Similarly, a pitch dial is drawn within the QWidget control, containing 18 scale points, each representing a pitch angle from -90° to +90°. The pointer only moves within the left semi-circle; Step 2: The control module is used to obtain the control signals sent by the mouse. Specifically, the user double-clicks on the target angle on the dial through the mouse to control the servo motor to rotate to that angle. The mouse coordinates are converted into angle values, and a mouse control signal is sent when double-clicking to adjust the servo angle; the mouse wheel is used to finely adjust the azimuth or pitch angle, with each roll increasing or decreasing by 1°. By rolling forward or backward, an azimuth or pitch control signal is sent to control the servo rotation; Based on the horizontal control signal and the pitch control signal, the current mouse position or scroll direction is obtained, and the target azimuth or pitch angle is calculated to generate azimuth and pitch angle commands; Step 3: The servo motor module reads the azimuth and pitch angle commands in real-time and drives the motor to perform the corresponding rotation; Step 4: The feedback module includes a position sensor for real-time monitoring of the current position information of the motor and transmitting the data to the control module. The control module updates the pointer position of the dial in real-time based on the feedback position information and displays the current actual angle of the servo motor for the user through the user interface module.
2. The display control method for driving servo azimuth and pitch rotation through a pointer dial as claimed in claim 1, wherein: When performing Step 1, when drawing the azimuth dial in the interface design, the coordinate position of each scale is calculated using trigonometric functions, and the horizontal angle dial pointer is drawn, pointing to the current angle; similarly, when drawing the pitch dial, trigonometric functions are used to calculate the scale position corresponding to the pitch angle, and the pitch angle dial pointer is drawn so that it can only rotate within the left semi-circle.
3. A display control method for driving servo azimuth and pitch rotation through a pointer dial as claimed in claim 1, characterized in that: When performing Step 2, when the user double-clicks, the coordinates of the mouse position are converted into an angle to generate a horizontal control signal or a pitch control signal for adjusting the servo motor, and the pointer follows the angle change; when the user scrolls the mouse wheel, it is judged whether to adjust clockwise or counterclockwise according to the scroll direction, and the adjustment step size is fixed at 1° to generate an azimuth or pitch control signal.
4. A display control method for driving servo azimuth and elevation rotation through a pointer dial as claimed in claim 1, characterized in that: The position sensor is a rotary encoder or a gyroscope.
5. A display control method for driving servo azimuth and pitch rotation through a pointer dial as claimed in claim 1, characterized in that: The control module receives the data input by the user interface module through the network cable, including the mouse position and the wheel operation, and sends the generated azimuth and pitch angle commands to the servo motor module through the serial communication interface or the CAN bus interface. The servo motor module generates the corresponding PWM signal according to the azimuth and pitch angle commands to control the motor speed or angle control. The feedback module feeds back the real-time monitored current position information of the motor to the control module through the serial communication interface or the CAN bus interface, and the control module then sends it to the user interface module through the network cable. The user interface module reflects it on the azimuth dial or the pitch dial according to the feedback current position information of the motor.
Citation Information
Patent Citations
Monitoring system
CN104184991A
Cradle head steering control method and apparatus as well as electronic device and storage medium
CN108803669A