Calculation of the difference between the miss amount and the actual angle

This article can be regarded as engineering experience, I will summarize and record it myself, and I hope my experience can be helpful to you.

The miss amount refers to the distance difference between the target and the center point. Generally, the actual angle difference between the target position and the center point is calculated according to the amount of missed target fed back, and the motor is driven to move the device according to the angle difference, so that the center point of the device coincides with the target position, so that the device can always move with the target position. . Generally used in object tracking modes of brick towers or pods.

In my application, the amount of miss is the pixel value fed back by the tracker (that is, the image processing module). This pixel value is the pixel difference between the center point of the image and the target position. Divided into horizontal pixel difference and vertical pixel difference. As shown in the figure below (hand-drawn is a bit rough, let’s just look at it), the dotted frame represents the screen, the small cross in the center represents the center point of the image, and the small frame in the upper right corner represents the target position. PIX means pixel, PIX_y is the vertical pixel difference between the center point and the target, PIX_x is the horizontal pixel difference between the center point and the target.

We need to get the value of the horizontal and vertical distance difference, the formula: pixel * cell size = distance value. We already know the number of pixels. The pixel size is a characteristic of the movement, which can be found in the movement manual, or ask the manufacturer. If our pixel size is 12μm (1000μm=1mm), the horizontal pixel difference PIX_x=10, then the distance value=12*10=120μm. From this we can get the horizontal and vertical error distance value. (Supplement: The video image on the screen is composed of many pixels. For example, the resolution of 1080x1920 actually means that the entire image is composed of 1080 pixels horizontally and 1920 pixels vertically. The pixel size refers to this The size of one pixel.)

After getting the error distance value at this end of the screen, you can start to calculate the error angle of the actual object. Let’s look at another picture. Do you still remember the eyepiece objective lens and convex lens imaging principle in junior high school? This is probably it. In the figure, ac is the error distance value at the screen end that we just calculated. If we look through the screen vertically, ef is the size of the actual object after imaging conversion, that is, the actual size of ac. What we need is the angle α, because ac is the difference in the amount of miss, so α is the angle value of the miss, that is to say, the center point can reach the target position by moving these angles. α=2β, tanβ=ab/ad, ab=ac/2, where bd is the current focal length, if it is a fixed-focus movement, just enter the focal length value directly, if it is a variable-magnification movement, then it needs to be calculated before Read the current focal length value from the movement and then participate in the calculation. In summary, α=2β=arctan((ac/2)/bd). At this point, the error angle value is calculated, and the target point can be reached by moving according to the angle value. In practical applications, the amount of miss is real-time because the device is moving. Changes, so the error angle also changes in real time, a set of appropriate PID parameters can better achieve the tracking effect.

That’s all for now. My current understanding is like this. If there is something unclear or wrong, welcome to ask questions or give advice and discussions in the comment area. I will be very grateful.

 

 

Guess you like

Origin blog.csdn.net/shijizai/article/details/128360582