Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||
Stepping MotorsLecture 9Uli RaichUCC semester 2017/2018 | |||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||
< < | The 27BJY-48 stepper motor an its ULN-2803 driver module | ||||||||||||||||||||||||||||||||||||||||
> > | The 27BJY-48 stepper motor and its ULN-2803 driver module | ||||||||||||||||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > |
A lecture on youtubeThere is an excellent lecture describing the usage of exactly our stepper motor setup on youtube | ||||||||||||||||||||||||||||||||||||||||
Stepping Motors versus DC MotorsWhile DC motors simply spin when they are powered, | |||||||||||||||||||||||||||||||||||||||||
Line: 104 to 113 | |||||||||||||||||||||||||||||||||||||||||
to 4 GPIO pins on the Raspberry Pi cobbler | |||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||
< < | Then we create the following signal table, which is a 2-dimensional array of booleans:
| ||||||||||||||||||||||||||||||||||||||||
> > | Then we create the following signal table, which is a 2-dimensional array of booleans: | ||||||||||||||||||||||||||||||||||||||||
Sending the pulses to the hardwareNow all we have to do is to go through this table and, for each step, send a high level to the GPIO pin to which we connected the coils. | |||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||
< < | |||||||||||||||||||||||||||||||||||||||||
> > |
![]() | ||||||||||||||||||||||||||||||||||||||||
Going through one step cycle | |||||||||||||||||||||||||||||||||||||||||
Line: 136 to 142 | |||||||||||||||||||||||||||||||||||||||||
a higher torque and can therefore handle bigger loads. | |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > | Movement Double Phase Forward
Double Step Forward TableOf course our signal table must change correspondingly, our program to send out the signals for one full cycle stays the same however.Programming double step forward modeFor this, nothing much is to be said:We change the table, but since the program is independent from the contents of the stepping table, the code stays strictly the same Position of rotor in doubleStepForward modeAn important point to note is that the rotor moves half a step further than in single Step Forward because its north pole is now attracted by the top and the bottom south poles. By first powering only the upper coil, then powering both coils then powering again only one pole of the lower coil it should be possible to move the motor by half steps only and by doing so increase its resolution. This is what we call half step mode and it is a combination of single and double step forward modes. The torque of the motor is less than in double step forward and the speed is only about half because now we need 8 steps for a full cycle.Movement Half Step Forward
Half Step Forward TableProgramming Half Step ModeAgain, apart from the fact that we must now pass through a table of 8 entries instead of 4 the program does not change. If we use the signature of all bits being zero as end of table indicator then no change at all is required.The pigpio libraryUp to now we always used wiringPi to access our GPIO pins. I explained in the first lecture on the Raspberry Pi that there are 2 independent libraries available:
Advantages of pigpioThe pigpio library comes in 2 versions:
Accessing the daemonThe daamon is started once before we make any hardware access: sudo pigpiod After this all hardware access can be make by a normal user The program communicates with the deamon through library calls which connect to the daemon through
Documentation of pigpio![]() Slide 1: Stepping MotorsLecture 9Uli RaichUCC semester 2017/2018Slide 2: The 27BJY-48 stepper motor and its ULN-2803 driver module![]() Slide 3: Stepping Motors versus DC MotorsWhile DC motors simply spin when they are powered, stepping motors can be moved in defined steps and thus positioned very precisely. They contain 2 coils which can be powered in positive or negative direction making the current flow in normal or reverse direction and thus creating magnetic fields of opposite polarity The rotor has a series of magnets (16 in case of the 28BYJ-48 which we are using) with alternating opposite polarization. A north pole followed by a south pole followed by a north pole and so on. The motor base has 2*16 teeth which can be polarized as north or south poles depending on the direction of the coil current. Here is the data sheet of the 28BYJ-48![]() Slide 4: The Driver CardThe maximum current that a GPIO pin on the Raspberry Pi can deliver is 60 mA which is insufficient to power the motor coils. We therefore need a driver circuit (Darlington stage) to amplify this current. In our case we use the ULN-2803![]() Slide 5: Connecting the Driver to the Motor![]() Slide 6: Motor MovementFirst we power the first coil in such a way the the first tooth has a south pole and the second one a north pole, which makes the rotor (whose north magnet is considered) moves to the first tooth. Then we switch off the first coil and power the second coil such that the first tooth of the lower row has a south pole. This makes the rotor move to this tooth. Now switch off the second coil and switch the first one on again, however this time with reverse current. The second tooth of the upper row now has the south pole (the poles are inversed with respect to the first step). Now we switch on only the second coil with inverse current to make the rotor move to the forth tooth. From now on the whole cycle repeats.
| ||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > | Signal Table for Single Phase ForwardWe have seen in the last slide how we have to power the coils to make the stepping motor move by 1 cycle, which is 4 steps in case of Single Phase Forward stepping How does this translate into a program? We connect the 4 phases (coil 1 forward, coil 2 backward, coil 1 backward, coil 2 forward) to 4 GPIO pins on the Raspberry Pi cobbler Then we create the following signal table, which is a 2-dimensional array of booleans:Sending the pulses to the hardwareNow all we have to do is to go through this table and, for each step, send a high level to the GPIO pin to which we connected the coils.![]() Going through one step cycle![]() Other modes of operationSingle Step forward (and backward) works fine but we can do better. Up to now we have always powered only one coil at a time. It is however possible to power both coils at the same time. This will draw of course more current but the motor will get a higher torque and can therefore handle bigger loads.Movement Double Phase Forward | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > |
Double Step Forward TableOf course our signal table must change correspondingly, our program to send out the signals for one full cycle stays the same however.Programming double step forward modeFor this, nothing much is to be said:We change the table, but since the program is independent from the contents of the stepping table, the code stays strictly the same | ||||||||||||||||||||||||||||||||||||||||
Position of rotor in doubleStepForward modeAn important point to note is that the rotor moves half a step | |||||||||||||||||||||||||||||||||||||||||
Line: 163 to 426 | |||||||||||||||||||||||||||||||||||||||||
and the speed is only about half because now we need 8 steps for a full cycle. | |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > | Movement Half Step Forward
Half Step Forward TableProgramming Half Step ModeAgain, apart from the fact that we must now pass through a table of 8 entries instead of 4 the program does not change. If we use the signature of all bits being zero as end of table indicator then no change at all is required.The pigpio libraryUp to now we always used wiringPi to access our GPIO pins. I explained in the first lecture on the Raspberry Pi that there are 2 independent libraries available:
Advantages of pigpioThe pigpio library comes in 2 versions:
Accessing the daemonThe daamon is started once before we make any hardware access: sudo pigpiod After this all hardware access can be make by a normal user The program communicates with the deamon through library calls which connect to the daemon through
Documentation of pigpio%SLIDESHOWSTART%Stepping MotorsLecture 9Uli RaichUCC semester 2017/2018The 27BJY-48 stepper motor and its ULN-2803 driver module![]() Stepping Motors versus DC MotorsWhile DC motors simply spin when they are powered, stepping motors can be moved in defined steps and thus positioned very precisely. They contain 2 coils which can be powered in positive or negative direction making the current flow in normal or reverse direction and thus creating magnetic fields of opposite polarity The rotor has a series of magnets (16 in case of the 28BYJ-48 which we are using) with alternating opposite polarization. A north pole followed by a south pole followed by a north pole and so on. The motor base has 2*16 teeth which can be polarized as north or south poles depending on the direction of the coil current. Here is the data sheet of the 28BYJ-48![]() The Driver CardThe maximum current that a GPIO pin on the Raspberry Pi can deliver is 60 mA which is insufficient to power the motor coils. We therefore need a driver circuit (Darlington stage) to amplify this current. In our case we use the ULN-2803![]() Connecting the Driver to the Motor![]() Motor MovementFirst we power the first coil in such a way the the first tooth has a south pole and the second one a north pole, which makes the rotor (whose north magnet is considered) moves to the first tooth. Then we switch off the first coil and power the second coil such that the first tooth of the lower row has a south pole. This makes the rotor move to this tooth. Now switch off the second coil and switch the first one on again, however this time with reverse current. The second tooth of the upper row now has the south pole (the poles are inversed with respect to the first step). Now we switch on only the second coil with inverse current to make the rotor move to the forth tooth. From now on the whole cycle repeats.
Signal Table for Single Phase ForwardWe have seen in the last slide how we have to power the coils to make the stepping motor move by 1 cycle, which is 4 steps in case of Single Phase Forward stepping How does this translate into a program? We connect the 4 phases (coil 1 forward, coil 2 backward, coil 1 backward, coil 2 forward) to 4 GPIO pins on the Raspberry Pi cobbler Then we create the following signal table, which is a 2-dimensional array of booleans:Sending the pulses to the hardwareNow all we have to do is to go through this table and, for each step, send a high level to the GPIO pin to which we connected the coils.![]() Going through one step cycle![]() Other modes of operationSingle Step forward (and backward) works fine but we can do better. Up to now we have always powered only one coil at a time. It is however possible to power both coils at the same time. This will draw of course more current but the motor will get a higher torque and can therefore handle bigger loads.Movement Double Phase Forward
Double Step Forward TableOf course our signal table must change correspondingly, our program to send out the signals for one full cycle stays the same however.Programming double step forward modeFor this, nothing much is to be said:We change the table, but since the program is independent from the contents of the stepping table, the code stays strictly the same Position of rotor in doubleStepForward modeAn important point to note is that the rotor moves half a step further than in single Step Forward because its north pole is now attracted by the top and the bottom south poles. By first powering only the upper coil, then powering both coils then powering again only one pole of the lower coil it should be possible to move the motor by half steps only and by doing so increase its resolution. This is what we call half step mode and it is a combination of single and double step forward modes. The torque of the motor is less than in double step forward and the speed is only about half because now we need 8 steps for a full cycle.Movement Half Step Forward
Half Step Forward TableProgramming Half Step ModeAgain, apart from the fact that we must now pass through a table of 8 entries instead of 4 the program does not change. If we use the signature of all bits being zero as end of table indicator then no change at all is required.The pigpio libraryUp to now we always used wiringPi to access our GPIO pins. I explained in the first lecture on the Raspberry Pi that there are 2 independent libraries available:
Advantages of pigpioThe pigpio library comes in 2 versions:
Accessing the daemonThe daamon is started once before we make any hardware access: sudo pigpiod After this all hardware access can be make by a normal user The program communicates with the deamon through library calls which connect to the daemon through
Documentation of pigpio%SLIDESHOWEND% -- ![]() Slide 1: Stepping MotorsLecture 9Uli RaichUCC semester 2017/2018Slide 2: The 27BJY-48 stepper motor and its ULN-2803 driver module![]() Slide 3: Stepping Motors versus DC MotorsWhile DC motors simply spin when they are powered, stepping motors can be moved in defined steps and thus positioned very precisely. They contain 2 coils which can be powered in positive or negative direction making the current flow in normal or reverse direction and thus creating magnetic fields of opposite polarity The rotor has a series of magnets (16 in case of the 28BYJ-48 which we are using) with alternating opposite polarization. A north pole followed by a south pole followed by a north pole and so on. The motor base has 2*16 teeth which can be polarized as north or south poles depending on the direction of the coil current. Here is the data sheet of the 28BYJ-48![]() Slide 4: The Driver CardThe maximum current that a GPIO pin on the Raspberry Pi can deliver is 60 mA which is insufficient to power the motor coils. We therefore need a driver circuit (Darlington stage) to amplify this current. In our case we use the ULN-2803![]() Slide 5: Connecting the Driver to the Motor![]() Slide 6: Motor MovementFirst we power the first coil in such a way the the first tooth has a south pole and the second one a north pole, which makes the rotor (whose north magnet is considered) moves to the first tooth. Then we switch off the first coil and power the second coil such that the first tooth of the lower row has a south pole. This makes the rotor move to this tooth. Now switch off the second coil and switch the first one on again, however this time with reverse current. The second tooth of the upper row now has the south pole (the poles are inversed with respect to the first step). Now we switch on only the second coil with inverse current to make the rotor move to the forth tooth. From now on the whole cycle repeats.
Slide 7: Signal Table for Single Phase ForwardWe have seen in the last slide how we have to power the coils to make the stepping motor move by 1 cycle, which is 4 steps in case of Single Phase Forward stepping How does this translate into a program? We connect the 4 phases (coil 1 forward, coil 2 backward, coil 1 backward, coil 2 forward) to 4 GPIO pins on the Raspberry Pi cobbler Then we create the following signal table, which is a 2-dimensional array of booleans:Slide 8: Other modes of operationSingle Step forward (and backward) works fine but we can do better. Up to now we have always powered only one coil at a time. It is however possible to power both coils at the same time. This will draw of course more current but the motor will get a higher torque and can therefore handle bigger loads.Slide 9: Movement Double Phase Forward
Slide 10: Double Step Forward TableOf course our signal table must change correspondingly, our program to send out the signals for one full cycle stays the same however.Slide 11: Programming double step forward modeFor this, nothing much is to be said:We change the table, but since the program is independent from the contents of the stepping table, the code stays strictly the same Slide 12: Position of rotor in doubleStepForward modeAn important point to note is that the rotor moves half a step further than in single Step Forward because its north pole is now attracted by the top and the bottom south poles. By first powering only the upper coil, then powering both coils then powering again only one pole of the lower coil it should be possible to move the motor by half steps only and by doing so increase its resolution. This is what we call half step mode and it is a combination of single and double step forward modes. The torque of the motor is less than in double step forward and the speed is only about half because now we need 8 steps for a full cycle.Slide 13: Movement Half Step Forward
Slide 14: Half Step Forward TableSlide 15: Programming Half Step ModeAgain, apart from the fact that we must now pass through a table of 8 entries instead of 4 the program does not change. If we use the signature of all bits being zero as end of table indicator then no change at all is required.Slide 16: The pigpio libraryUp to now we always used wiringPi to access our GPIO pins. I explained in the first lecture on the Raspberry Pi that there are 2 independent libraries available:
Slide 17: Advantages of pigpioThe pigpio library comes in 2 versions:
Slide 18: Accessing the daemonThe daamon is started once before we make any hardware access: sudo pigpiod After this all hardware access can be make by a normal user The program communicates with the deamon through library calls which connect to the daemon through
Slide 19: Documentation of pigpioThe WEB page of pigpio can be found here![]() ![]() Slide 20: Features of pigpio![]() Slide 21: This is how to use the library![]() Slide 22: Sending the pulses to the hardwareNow all we have to do is to go through this table and, for each step, send a high level to the GPIO pin to which we connected the coils.![]() Slide 23: Going through one step cycle![]() | ||||||||||||||||||||||||||||||||||||||||
%SLIDESHOWEND%
-- ![]() Comments | |||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||
< < | |||||||||||||||||||||||||||||||||||||||||
> > | The WEB page of pigpio can be found here | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
Line: 183 to 1014 | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||
|