Rookie learning four-axis controller 3: Digital integration method DDA implementation of linear interpolation

Source: Internet
Author: User

The dot-by-point comparison method of the previous article is obviously unable to draw a straight line with an inclined angle. Because the x-axis and y-axis are never synchronized, that is, like playing billiards, you hit one, I hit one, and if I get into the ball, I'm going to hit another one.

That is, if the line is 45 degrees, there is no way to draw it, only the jagged shape.

How do I implement x and y simultaneous motion? In other words, if you want to draw a 45-degree line, do X and y move at the same time?

For example, the starting point is 0, 0, the end point is 5, 5, if the comparison method by point, it will need to exercise 10 times, if the two axes simultaneously moving, then 5 steps can be achieved. The path to implementation is as follows:

The initial value is 0, 0, and then the next step, we increase each coordinate 5, then the result is 5, 5, this will overflow, that is, overflow to start the movement one step. After overflow cleared, next add 5, and overflow, continue to move one step at the same time. A total of 5 steps will be achieved.

Wait, of course, you can set the register overflow value to 5, so that the register uses 3 bits on the line, but if you want to move to (3,7) coordinates? Obviously, the registers we use can be used with an overflow value of 7.

In this case, we need to use the register actually needs 3, one is the initial value of the deposit (3,7), a deposit 7 this threshold, one is the accumulator. We can dispense a register of thresholds directly. In other words, a 3-bit register is used, and the threshold value is 8.

Number of steps X Cumulative x remainder X is overflow Y Cumulative Y remainder Y is overflow
0 0 0 0 0 0 0
1 3 0 0 7 0 0
2 6 0 0 14 6 1
3 9 1 1 13 5 1
4 4 0 0 12 4 1
5 7 0 0 11 3 1
6 10 2 1 10 2 1
7 5 0 0 9 1 1
8 8 0 1 8 0 1

That is, when the x-axis and y-axis overflow simultaneously, the x and Y axes are in synchronous motion.

The question is, for example, how many steps do we need to exercise from the (0,0) movement to the point of (2554,47)?

That is, as long as the next 2554 can be installed in the register of the number of bits can be, that is, using 4096来 as an accumulator. The speed of movement is the period of 4096* pulse equivalent. In fact, this time is much slower than 2554+47.

But the benefits of doing this are obvious, and we're not every graphic, it's jagged.

We can easily implement direct actual passes like the graphic above

Thus, multi-coordinates linkage and multi-coordinate curve interpolation are realized, which has been widely used in contour control.

One more example.



There is no use of the formula, if interested can find textbooks to understand, the schematic is as follows:

There is also a circular DDA interpolation, in view of my hard to understand the digital integration method, and improve the DDA interpolation quality with more difficult to understand the left-shift normalization and other technologies, dry too much, I intend to start another article.
Think of Li Yu a sentence: The key to solve the problem, obviously most of the time is not to your eyes staring at the lock, but to go to other places to find.

Obviously, I initially intend to understand what is interpolation, what is linkage, in the search on Baidu, there is no way to understand clearly, and in the casual, in order to understand the DDA, multi-axis linkage concept to solve.

Rookie learning four-axis controller 3: Digital integration method DDA implementation of linear interpolation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.