Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the accuracy of migration and transformation of 28BYJ-48 stepper motor and its further analysis

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

How to achieve 28BYJ-48 stepper motor migration conversion accuracy and deepening analysis, I believe that many inexperienced people are helpless, for this reason this article summarizes the causes and solutions of the problem, through this article I hope you can solve this problem.

It's turned around, but doesn't it feel like something's wrong? Too slow? Hold on, we'll keep going. According to the explanation at the end of this chapter, when the eight-beat form, the stepper motor rotates one turn is required to 64 rhythms, and our program is that each rhythm continues for 2ms, then one turn should be 128ms, that is, one second to turn more than 7 turns, but how does it look like it is more than 7 seconds to turn one turn?

Then, it is time to understand the concept of "acceleration" in "permanent magnet acceleration stepping motor." Figure 9-7 is the disassembly diagram of this 28BYJ-48 stepper motor. As can be seen from the figure, the white pinion in the middle is the rotor input of the stepper motor. The 64 rhythms only make this pinion rotate once, and then it drives the light blue gear. This is the first acceleration. Everyone looks at the structure of the white gear on the upper right, in addition to the motor rotor and the final input shaft, the three transmission gears are mostly such a structure, composed of a layer of multi-teeth and a layer of less teeth, and each gear uses its own layer of less teeth to drive the next gear's multi-tooth layer, so every two gears are composed of a level of acceleration, a total of 4 levels of acceleration, then the total acceleration ratio is a number? How many revolutions does the rotor have to make before the input shaft makes one revolution?

Figure 9-7 External Gear Representation of Stepper Motor

Looking back at the acceleration ratio parameter in the motor parameter table--1: 64, the rotor rotates 64 times, and the input shaft finally rotates once, that is, the input shaft only rotates once after 64*64=4096 rhythms, 2ms*4096=8192ms, and only rotates once in 8 seconds. Is it exactly consistent with the test results just now? 4096 rhythm transition a circle, then a rhythm transition angle-step angle is 360/4096, look at the table step angle parameter 5.625/64, calculate to know that these two values are equal, everything has been consistent.

About the fundamental grasp of the truth should be here on all finished, however, we hope that everyone can cultivate a "theory is the only standard to hone the true meaning" of the way of thinking! Recall, what is the biggest feature of stepper motors? Accurately grasp the amount of migration transformation! So should we hone it to see if it's accurate? How accurate is that? How do you hone it? Turn it 90 degrees and measure it? If it is only 1 degree or less, can you measure it accurately? It's difficult without sophisticated instruments. Let's make it turn a few more full turns and see if it stops where it started. Correspondingly, we modify the program to facilitate the control of the motor to rotate arbitrary number of turns.

#include void TurnMotor (unsigned long angle); void main(){ TurnMotor(360*25); //360 degrees *25, i.e. 25 turns while (1); } /* Software delay function, delay about 2ms */ void delay(){ unsigned int i = 200; while (i--);} /* Stepper motor transition function, angle-Angle to be rotated */ void TurnMotor (unsigned long angle){ unsigned char tmp; //temporary variable unsigned char index = 0; //rhythm input index unsigned long beats = 0;//Total number of required beats//IO master code corresponding to stepper motor rhythm unsigned char code BeatCode[8] = { 0xE, 0xC, 0xD, 0x9, 0xB, 0x3, 0x7, 0x6}; //Total number of required beats calculated, 4096 beats corresponding to one beat =(angle*4096) / 360; //Determine that beats is not 0 to perform the cycle, and then subtract 1 while (beats--){ tmp = P1; //Use tmp to temporarily store the values after P1 port tmp = tmp & 0xF0; //Use & operation to clear the lower 4 bits tmp = tmp| BeatCode[index]; //with| The operation writes the rhythm code to the lower 4 bits P1 = tmp; //returns the rhythm code of the lower 4 bits and the original value of the upper 4 bits to P1 index++; //increments the rhythm input index index = index & 0x07; //finishes with the & operation to 8 to zero delay(); //delays 2ms, i.e. performs one beat} P1 = P1| 0x0 F; //all phases of enclosed motor}

In the above program, we first wrote a function to master the motor to rotate the specified angle, the angle value is given by the mode parameter of the function, and then in the main function, we can conveniently change the practical parameters when appropriating to master the motor to rotate the arbitrary angle. We used 360*25, which is 25 laps, but of course you can change it to any other value and see what happens. Our program will perform 25*8=200 seconds, first write down the initial position of the input shaft, then power up and wait patiently for it to complete, see if there is any error? What's going on? Where's the result? Didn't you say that you could accurately grasp the amount of migration and transformation?

This result is actually out of the acceleration ratio, look again, the acceleration ratio given by the manufacturer is 1:64, no matter which manufacturer consumes the motor, only the model is 28BYJ-48, its nominal acceleration ratio is more than 1:64. But in practice? Our calculations reveal that the true and accurate acceleration ratio is not 1:64, but 1:63.684! The method to obtain this data is also very complicated. Count the number of teeth of each gear in practice, and then multiply the acceleration ratios at all levels to obtain the consequences. The measured acceleration ratio is (32/9)*(22/11)*(26/9)*(31/10)≈63.684, thus obtaining a practical error of 0.0049, that is, about 0.5%. If we turn 100 times, we will be half a turn worse. Then we have only turned 25 times. Is it an eighth of a turn, which is 45 degrees, look at the error just now is 45 degrees. Then, according to the practical acceleration ratio of 1:63.684, the number of rhythms required for one turn is 64*63.684≈4076. Then change the 4096 in the motor drive function in the following program to 4076 and try again. Is there no trickling error? However, errors still exist in practice, because the following calculation results are mostly about equal, the practical error is about 0.000056, that is, 0.56 per 10,000 laps, only half a turn will be made, once it can be neglected.

So why are there errors in the manufacturer's parameters? Don't manufacturers know? To explain this result, we have to return to practical use, the most usual goal of the stepper motor is to master the purpose of turning a certain angle, usually within 360 degrees, and the final design goal of this 28BYJ-48 is to master the fan blade of the air conditioner, the movement scale of the fan blade will not exceed 180 degrees, so in this use place, the manufacturer gives an approximate integer acceleration ratio of 1:64 has been accurate enough, which is reasonable. However, as our program, we are different is to use it to drive the fan blade, we can make it shift many circles to do the rest, this time on the need for more accurate data, which is also our hope that students can understand and control, that is, we want to be able to "design" and process the results found in it, and not be so-called "ready-made plan" limit thinking.

After reading the above, do you know how to realize the method of 28BYJ-48 stepper motor migration transformation accuracy and deepening analysis? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report