In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Take a new look at the following external indecent diagram and external structure diagram of the stepper motor: the stepper motor has a total of five leads, of which the white one is the common end, which is connected to the 5V power supply, and the following orange, yellow, pink and blue correspond to phases A, B, C and D; then if you want to connect the A phase winding, you only need to ground the orange wire, and phase B is × × grounded, and so on. According to the explanation of the above single four-beat and eight-beat task progress, the following winding mastery sequence table can be obtained, as shown in Table 9-1:
Table 9-1 master sequence table of eight-beat windings
12345678P1-Red VCCVCCVCCVCCVCCVCCVCCVCCP2- Orange GNDGND
GNDP3- yellow
GNDGNDGND
P4-powder
GNDGNDGND
P5-blue
GNDGNDGND
We master the local P1.0~P1.3 of the stepper motor and the display of the 74HC138 decoder on the board. We talked about the jumper in Chapter 3. By adjusting the position of the jumper cap, the P1.0~P1.3 can master the four windings of the stepper motor, as shown in figure 9-5.
Figure 9-5 shows the decoding and selection jumpers for stepper motors
If you want to use the motor, you need to adjust the four jumper caps to the left side of the jumper group (the practical position on the opening board), that is, the left side needle and the two needles are connected (corresponding to the two ends and the lower needles in the truth diagram). You can use P1.0 to P1.3 to master the stepper motor, if you want to use the display part again, you have to change back to the right side. What if everyone wants to show both the local normal task and the motor task? The jumper cap is held on the right side, and the master pin of the stepper motor (that is, the row needle on the left) is connected with the DuPont wire to the other single-chip microcomputer IO which is not in use temporarily.
Let's take a look at the reason diagram of our stepper motor. The master circuit of the stepper motor is shown in figure 9-6.
Figure 9-6 stepping motor master circuit
Of course, the IO port of the single-chip microcomputer can directly input the voltage of 0V and 5V, but the current driving ability, that is, the ability to carry load is very unlimited, so we add a transistor to the control line of each phase to improve the driving ability. As can be seen from the figure, if phase An is to be connected, it must be Q2 on, and phase A, that is, the orange line, is equivalent to grounding, so phase A winding is turned on, and the lower 4 bits of P1 port of single-chip microcomputer should enter 0b1110, that is, 0xE; if you want An and B to turn on opposite, then Q2 and Q3 should be turned on, and 4 bits lower of P1 port should be input 0b1100, that is, 0xC, and so on, we can lose the following octave rhythm IO master code array:
Unsigned char code BeatCode [8] = {0xE, 0xC, 0xD, 0x9, 0xB, 0x3, 0x7, 0x6}
At this point, it seems that all the logic results have been dealt with, and reincarnation will send the values in this array to P1 port. However, you only need to think deeply about it and you will find that there is another achievement: how long does it take to send data, that is, how long should a rhythm continue? Is it casual? Of course not, this time is determined by the starting frequency of the stepper motor. The starting frequency is the highest pulse frequency at which the stepper motor can start normally under no-load condition. if the pulse frequency is higher than this value, the motor can not start normally. Table 9-2 is the stepper motor parameter table provided by the manufacturer. Let's take a look at it.
Table 9-2 28BYJ-48 stepper motor parameter table
Power supply
Voltage phase number phase resistance
Ω step angle acceleration ratio start frequency
P.P.S torque
G.cm noise
DB insulating dielectric
Electric intensity 5V450 ±10% 5.625 / 641≤ 64 ≥ 550 ≥ 300 ≤ 35600VAC
The parameter given in the table is ≥ 550. the unit is P.P.S, that is, pulses per second, which means that the motor is guaranteed to start normally when you give 550stepper second. Then the conversion to a single rhythm to continue the work is 1s/550=1.8ms, in order to enable the motor to start, we can master the rhythm refresh time is greater than 1.8ms. With this parameter, we can start to write the most complex motor migration and transformation program, as follows:
# include unsigned char code BeatCode [8] = {/ / IO code corresponding to stepper motor rhythm 0xE, 0xC, 0xD, 0x9, 0xB, 0x3, 0x7, 0x6}; void delay (); void main () {unsigned char tmp; / / define a temporary variable unsigned char index = 0; / / define rhythm input index while (1) {tmp = P1; / / use tmp to temporarily store the value after P1 port tmp = tmp & 0xF0 / / use & Operation clear low 4 bits / / use | write the rhythm code to the lower 4 digits tmp = tmp | BeatCode [index]; / / send the lower 4 bit rhythm code and the high 4 bit original value back to P1 = tmp; index++; / / rhythm input index increment index = index & 0x07; / / use & the operation is completed to 8 return zero delay () / / delay 2ms, that is, 2ms performs one beat} / * software delay function, the delay is about 2ms * / void delay () {unsigned int i = 200; while (iMub -);}
Download the program to the board and try it! See if the motor is turning? Remember to change the jumper!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.