Difference: Lecture9:SteppingMotors (1 vs. 8)

Revision 82017-11-03 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Slide 1: Stepping Motors

Line: 303 to 303
 

Call getopt and interpret

Changed:
<
<
getOptInterpret.png
>
>
callGetOpt.png
 

Write the stepper program

Line: 350 to 350
 
META FILEATTACHMENT attachment="lecture_9_upload.odp" attr="" comment="" date="1509528553" name="lecture_9_upload.odp" path="lecture_9_upload.odp" size="711653" user="uli" version="1"
META FILEATTACHMENT attachment="stepperMain.png" attr="" comment="" date="1509537724" name="stepperMain.png" path="stepperMain.png" size="25311" user="uli" version="1"
META FILEATTACHMENT attachment="getOpts.png" attr="" comment="" date="1509540656" name="getOpts.png" path="getOpts.png" size="16986" user="uli" version="1"
Deleted:
<
<
META FILEATTACHMENT attachment="getOptInterpret.png" attr="" comment="" date="1509540656" name="getOptInterpret.png" path="getOptInterpret.png" size="24887" user="uli" version="1"
 
META FILEATTACHMENT attachment="stepperMake.png" attr="" comment="" date="1509545995" name="stepperMake.png" path="stepperMake.png" size="49660" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="callGetOpt.png" attr="" comment="" date="1509695182" name="callGetOpt.png" path="callGetOpt.png" size="40029" user="uli" version="1"
 
META TOPICMOVED by="uli" date="1508507143" from="UCC_Course.Lecture8:SteppingMotors" to="UCC_Course.Lecture9:SteppingMotors"

Revision 72017-11-01 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Slide 1: Stepping Motors

Line: 94 to 94
 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.

Changed:
<
<
step1.png step2.png  

step4.png

>
>
step1.png step2.png step3.png

step4.png

 

Signal Table for Single Phase Forward

Revision 62017-11-01 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Deleted:
<
<

 

Stepping Motors

Lecture 9

Uli Raich

UCC semester 2017/2018

Line: 17 to 14
 

A lecture on youtube

Changed:
<
<
There is an excellent lecture describing the usage of exactly our stepper motor setup on youtube
>
>
There is an excellent tutorial describing the usage of exactly our stepper motor setup on youtube
 

Stepping Motors versus DC Motors

Line: 72 to 69
 powering the orange line it is flowing in the opposite direction

Changed:
<
<

Motor Movement

>
>

Motor Movement (Single Step Forward)

 
Changed:
<
<
First we power the first coil in such a way the the first tooth has a
>
>
First we power the first coil in such a way that the first tooth has a
  south pole and the second one a north pole, which
Line: 97 to 94
 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.

Changed:
<
<
step1.png step2.png step3.png

step4.png

>
>
step1.png step2.png  

step4.png

 

Signal Table for Single Phase Forward

Line: 114 to 111
 to 4 GPIO pins on the Raspberry Pi cobbler

Then we create the following signal table, which is a 2-dimensional array of booleans:

Deleted:
<
<

Sending the pulses to the hardware

Now 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.

stepTable.png

 
Deleted:
<
<

Going through one step cycle

oneCycle.png

 

Other modes of operation

Single Step forward (and backward) works fine but we can do better.

Line: 145 to 127
 

Movement Double Phase Forward

doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Deleted:
<
<

 

Double Step Forward Table

Of course our signal table must change correspondingly,

Line: 194 to 174
 
Deleted:
<
<

 

Programming Half Step Mode

Again, apart from the fact that we must now pass through

Line: 214 to 193
  that there are 2 independent libraries available:

  • wiringPi
Changed:
<
<
  • wigpio
>
>
  • pigpio
 Why would we be interested to use a different library?

Line: 247 to 226
  with the pigpio daemon on the Raspberry Pi
Deleted:
<
<

 

Documentation of pigpio

Changed:
<
<
Start Presentation

Slide 1: Stepping Motors

Lecture 9

Uli Raich

UCC semester 2017/2018

Slide 2: The 27BJY-48 stepper motor and its ULN-2803 driver module

stepping.png

Slide 3: Stepping Motors versus DC Motors

While 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 WEB page of pigpio can be found here

pigpioPage.png
 

Changed:
<
<

The Driver Card

The 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 chip

The little PCB has 4 LEDs on it to show which of the 2 coils is

powered and in which direction. This is very useful to demonstrate which signals

are sent to the motor and it illustrates nicely the functioning of the motor.

>
>

Types of functions in pigpio

 
Added:
>
>
Going through all the function in pigpio during the lecture is impossible.
I have not used the all neither!

  • There are functions to
  • Initialize the library and close it
  • Control gpio lines and read from or write to them
  • Get a call-back when a gpio state changes
  • Access routines to the I2C bus
  • Access routines to the SPI interface
  • PWM functions
  • Functions for use of a serial device
 

Changed:
<
<

Connecting the Driver to the Motor

>
>

Features of pigpio

 
Changed:
<
<
connections.png
>
>
features.png
 
Changed:
<
<
We can see from the connections that when powering the pink line
>
>

This is how to use the library

 
Changed:
<
<
the coil current is flowing in one direction while when
>
>
usage.png
 
Changed:
<
<
powering the orange line it is flowing in the opposite direction
>
>
Please convert this to what will be required in your source code.
 

Changed:
<
<

Motor Movement

First 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

>
>

Initializing pigpio

 
Changed:
<
<
(the poles are inversed with respect to the first step).

Now we switch on only the second coil with inverse current to make

>
>
You must include
#include <pigpiod_if2.h>

… and then you can happily use pigpio functions
 
Changed:
<
<
the rotor move to the forth tooth. From now on the whole cycle repeats.

step1.png step2.png step3.png

step4.png

>
>
stepperMain.png
 

Deleted:
<
<

Signal Table for Single Phase Forward

We 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 hardware

Line: 371 to 276
 oneCycle.png

Changed:
<
<

Other modes of operation

Single 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

doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Double Step Forward Table

Of 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 mode

For 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 mode

An 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

step1.png doubleStep1.png step2.png doubleStep2.png
step3.png doubleStep3.png step4.png doubleStep4.png

Half Step Forward Table

Programming Half Step Mode

Again, 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 library

Up 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:

  • wiringPi
  • wigpio
Why would we be interested to use a different library?

Advantages of pigpio

The pigpio library comes in 2 versions:

  • The standard one where calls to the library code
    results in direct access to the hardware
  • The daemon version where first a daemon (pigpiod)
    is started and then the hardware access is only made in this daemon

Accessing the daemon

The 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

  • pipes (when running on the Raspberry Pi) or

  • through sockets when running on a remote system
    like our Ubuntu PC
There is a library version that runs on the PC

We can write C programs on the PC with hardware access

to our devices on the bread board through pigpio calls to the

PC version of the library which communicates

with the pigpio daemon on the Raspberry Pi

Documentation of pigpio

Start Presentation

Slide 1: Stepping Motors

Lecture 9

Uli Raich

UCC semester 2017/2018

Slide 2: The 27BJY-48 stepper motor and its ULN-2803 driver module

stepping.png

Slide 3: Stepping Motors versus DC Motors

While 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 Card

The 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 chip

The little PCB has 4 LEDs on it to show which of the 2 coils is

powered and in which direction. This is very useful to demonstrate which signals

are sent to the motor and it illustrates nicely the functioning of the motor.

>
>

A typical Makefile with pigpio

 
Added:
>
>
stepperMake.png
 

Changed:
<
<

Connecting the Driver to the Motor

>
>

Reading command line arguments

 
Changed:
<
<
connections.png
>
>
You say: This we have seen before and you are right.
 
Changed:
<
<
We can see from the connections that when powering the pink line
>
>
However, some commands use very complex command line arguments
 
Changed:
<
<
the coil current is flowing in one direction while when
>
>
and the system provides a parser for it.
 
Changed:
<
<
powering the orange line it is flowing in the opposite direction

Motor Movement

First 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.

>
>
Have a look at getopt_long, which helps you in figuring out what the used wants.
 
Changed:
<
<
Now switch off the second coil and switch the first one on again,

however this time with reverse current. The second tooth of the

>
>
The stepper motor program had these options:
 
Changed:
<
<
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.

step1.png step2.png step3.png

step4.png

Signal Table for Single Phase Forward

We 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 hardware

Now 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.

stepTable.png

>
>
stepperUsage.png
 

Added:
>
>

Using getopt_long

 
Changed:
<
<

Going through one step cycle

>
>
First we include <getopt.h>
Then we create a table of options (last entry must be all zeros:
 
Changed:
<
<
oneCycle.png
>
>
getOpts.png
 

Changed:
<
<

Other modes of operation

Single 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.

>
>

Call getopt and interpret

 
Changed:
<
<
This will draw of course more current but the motor will get

a higher torque and can therefore handle bigger loads.

>
>
getOptInterpret.png
 
Deleted:
<
<

Movement Double Phase Forward

doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png
 

Added:
>
>

Write the stepper program

 
Changed:
<
<

Double Step Forward Table

Of 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 mode

For 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 mode

An 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

step1.png doubleStep1.png step2.png doubleStep2.png
step3.png doubleStep3.png step4.png doubleStep4.png

Half Step Forward Table

Programming Half Step Mode

Again, 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 library

Up 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:

  • wiringPi
  • wigpio
Why would we be interested to use a different library?

Advantages of pigpio

The pigpio library comes in 2 versions:

  • The standard one where calls to the library code
    results in direct access to the hardware
  • The daemon version where first a daemon (pigpiod)
    is started and then the hardware access is only made in this daemon

Accessing the daemon

The 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

  • pipes (when running on the Raspberry Pi) or

  • through sockets when running on a remote system
    like our Ubuntu PC
There is a library version that runs on the PC

We can write C programs on the PC with hardware access

to our devices on the bread board through pigpio calls to the

PC version of the library which communicates

with the pigpio daemon on the Raspberry Pi

Documentation of pigpio


%SLIDESHOWEND%

--

Start Presentation

Slide 1: Stepping Motors

Lecture 9

Uli Raich

UCC semester 2017/2018

Slide 2: The 27BJY-48 stepper motor and its ULN-2803 driver module

stepping.png

Slide 3: Stepping Motors versus DC Motors

While 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 Card

The 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 chip

The little PCB has 4 LEDs on it to show which of the 2 coils is

powered and in which direction. This is very useful to demonstrate which signals

are sent to the motor and it illustrates nicely the functioning of the motor.

Slide 5: Connecting the Driver to the Motor

connections.png

We can see from the connections that when powering the pink line

the coil current is flowing in one direction while when

powering the orange line it is flowing in the opposite direction

Slide 6: Motor Movement

First 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.

step1.png step2.png step3.png

step4.png

Slide 7: Signal Table for Single Phase Forward

We 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 operation

Single 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

doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Slide 10: Double Step Forward Table

Of 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 mode

For 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 mode

An 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

step1.png doubleStep1.png step2.png doubleStep2.png
step3.png doubleStep3.png step4.png doubleStep4.png

Slide 14: Half Step Forward Table

Slide 15: Programming Half Step Mode

Again, 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 library

Up 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:

  • wiringPi
  • wigpio
Why would we be interested to use a different library?

Slide 17: Advantages of pigpio

The pigpio library comes in 2 versions:

  • The standard one where calls to the library code
    results in direct access to the hardware
  • The daemon version where first a daemon (pigpiod)
    is started and then the hardware access is only made in this daemon

Slide 18: Accessing the daemon

The 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

  • pipes (when running on the Raspberry Pi) or

  • through sockets when running on a remote system
    like our Ubuntu PC
There is a library version that runs on the PC

We can write C programs on the PC with hardware access

to our devices on the bread board through pigpio calls to the

PC version of the library which communicates

with the pigpio daemon on the Raspberry Pi

Slide 19: Documentation of pigpio

The WEB page of pigpio can be found here

pigpioPage.png

Slide 20: Features of pigpio

features.png

Slide 21: This is how to use the library

usage.png

Please convert this to what will be required in your source code.

Slide 22: Sending the pulses to the hardware

Now 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.

stepTable.png

Slide 23: Going through one step cycle

oneCycle.png

>
>
With this information you should be able to write a program where the user can

  • Select the movement mode
  • Select the movement speed
  • Select if you turn clockwise or counter clock wise
  • Select how have to move of to which angle
  %SLIDESHOWEND%
Line: 1028 to 348
 
META FILEATTACHMENT attachment="stepperUsage.png" attr="" comment="" date="1509028686" name="stepperUsage.png" path="stepperUsage.png" size="38408" user="uli" version="1"
META FILEATTACHMENT attachment="usage.png" attr="" comment="" date="1509028686" name="usage.png" path="usage.png" size="17316" user="uli" version="1"
META FILEATTACHMENT attachment="lecture_9_upload.odp" attr="" comment="" date="1509528553" name="lecture_9_upload.odp" path="lecture_9_upload.odp" size="711653" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="stepperMain.png" attr="" comment="" date="1509537724" name="stepperMain.png" path="stepperMain.png" size="25311" user="uli" version="1"
META FILEATTACHMENT attachment="getOpts.png" attr="" comment="" date="1509540656" name="getOpts.png" path="getOpts.png" size="16986" user="uli" version="1"
META FILEATTACHMENT attachment="getOptInterpret.png" attr="" comment="" date="1509540656" name="getOptInterpret.png" path="getOptInterpret.png" size="24887" user="uli" version="1"
META FILEATTACHMENT attachment="stepperMake.png" attr="" comment="" date="1509545995" name="stepperMake.png" path="stepperMake.png" size="49660" user="uli" version="1"
 
META TOPICMOVED by="uli" date="1508507143" from="UCC_Course.Lecture8:SteppingMotors" to="UCC_Course.Lecture9:SteppingMotors"

Revision 52017-11-01 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Line: 1000 to 1000
 

Comments

Changed:
<
<
<--/commentPlugin-->
The WEB page of pigpio can be found here
>
>
The youtube video on stepping motors has been taken out of the lecture slides (lecture_9_upload.odt) because it would make the file too big for upload and I am not sure about copyright issues. However, you have the link to the video in the slides on this page.

-- Uli Raich - 2017-11-01

<--/commentPlugin-->
 
META FILEATTACHMENT attachment="stepping.png" attr="" comment="" date="1508158008" name="stepping.png" path="stepping.png" size="187310" user="uli" version="1"
META FILEATTACHMENT attachment="step1.png" attr="" comment="" date="1508161292" name="step1.png" path="step1.png" size="4875" user="uli" version="1"
Line: 1023 to 1027
 
META FILEATTACHMENT attachment="pigpioVariants.png" attr="" comment="" date="1509025396" name="pigpioVariants.png" path="pigpioVariants.png" size="21148" user="uli" version="1"
META FILEATTACHMENT attachment="stepperUsage.png" attr="" comment="" date="1509028686" name="stepperUsage.png" path="stepperUsage.png" size="38408" user="uli" version="1"
META FILEATTACHMENT attachment="usage.png" attr="" comment="" date="1509028686" name="usage.png" path="usage.png" size="17316" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="lecture_9_upload.odp" attr="" comment="" date="1509528553" name="lecture_9_upload.odp" path="lecture_9_upload.odp" size="711653" user="uli" version="1"
 
META TOPICMOVED by="uli" date="1508507143" from="UCC_Course.Lecture8:SteppingMotors" to="UCC_Course.Lecture9:SteppingMotors"

Revision 42017-10-26 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Added:
>
>

 

Stepping Motors

Lecture 9

Uli Raich

UCC 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

  stepping.png

Added:
>
>

A lecture on youtube

There is an excellent lecture describing the usage of exactly our stepper motor setup on youtube

 

Stepping Motors versus DC Motors

While 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:

    Step 1 Step 2 Step 3 Step 4
In 1 coil 1 + 1 0 0 0
In 2 coil 2 - 0 1 0 0
In 3 coil 1 - 0 0 1 0
In 4 coil 2 + 0 0 0 1
>
>
Then we create the following signal table, which is a 2-dimensional array of booleans:

 

Sending the pulses to the hardware

Now 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:
<
<

stepTable.png

>
>
stepTable.png

 

Going through one step cycle

Line: 136 to 142
  a higher torque and can therefore handle bigger loads.
Added:
>
>

Movement Double Phase Forward

doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Double Step Forward Table

Of 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 mode

For 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 mode

An 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

step1.png doubleStep1.png step2.png doubleStep2.png
step3.png doubleStep3.png step4.png doubleStep4.png

Half Step Forward Table

Programming Half Step Mode

Again, 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 library

Up 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:

  • wiringPi
  • wigpio
Why would we be interested to use a different library?

Advantages of pigpio

The pigpio library comes in 2 versions:

  • The standard one where calls to the library code
    results in direct access to the hardware
  • The daemon version where first a daemon (pigpiod)
    is started and then the hardware access is only made in this daemon

Accessing the daemon

The 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

  • pipes (when running on the Raspberry Pi) or

  • through sockets when running on a remote system
    like our Ubuntu PC
There is a library version that runs on the PC

We can write C programs on the PC with hardware access

to our devices on the bread board through pigpio calls to the

PC version of the library which communicates

with the pigpio daemon on the Raspberry Pi

Documentation of pigpio

Start Presentation

Slide 1: Stepping Motors

Lecture 9

Uli Raich

UCC semester 2017/2018

Slide 2: The 27BJY-48 stepper motor and its ULN-2803 driver module

stepping.png

Slide 3: Stepping Motors versus DC Motors

While 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 Card

The 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 chip

The little PCB has 4 LEDs on it to show which of the 2 coils is

powered and in which direction. This is very useful to demonstrate which signals

are sent to the motor and it illustrates nicely the functioning of the motor.

Slide 5: Connecting the Driver to the Motor

connections.png

We can see from the connections that when powering the pink line

the coil current is flowing in one direction while when

powering the orange line it is flowing in the opposite direction

Slide 6: Motor Movement

First 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.

step1.png step2.png step3.png

step4.png

 

Added:
>
>

Signal Table for Single Phase Forward

We 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 hardware

Now 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.

stepTable.png

Going through one step cycle

oneCycle.png

Other modes of operation

Single 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

 
doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Added:
>
>

Double Step Forward Table

Of 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 mode

For 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 mode

An 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

step1.png doubleStep1.png step2.png doubleStep2.png
step3.png doubleStep3.png step4.png doubleStep4.png

Half Step Forward Table

Programming Half Step Mode

Again, 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 library

Up 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:

  • wiringPi
  • wigpio
Why would we be interested to use a different library?

Advantages of pigpio

The pigpio library comes in 2 versions:

  • The standard one where calls to the library code
    results in direct access to the hardware
  • The daemon version where first a daemon (pigpiod)
    is started and then the hardware access is only made in this daemon

Accessing the daemon

The 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

  • pipes (when running on the Raspberry Pi) or

  • through sockets when running on a remote system
    like our Ubuntu PC
There is a library version that runs on the PC

We can write C programs on the PC with hardware access

to our devices on the bread board through pigpio calls to the

PC version of the library which communicates

with the pigpio daemon on the Raspberry Pi

Documentation of pigpio

%SLIDESHOWSTART%

Stepping Motors

Lecture 9

Uli Raich

UCC semester 2017/2018

The 27BJY-48 stepper motor and its ULN-2803 driver module

stepping.png

Stepping Motors versus DC Motors

While 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 Card

The 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 chip

The little PCB has 4 LEDs on it to show which of the 2 coils is

powered and in which direction. This is very useful to demonstrate which signals

are sent to the motor and it illustrates nicely the functioning of the motor.

Connecting the Driver to the Motor

connections.png

We can see from the connections that when powering the pink line

the coil current is flowing in one direction while when

powering the orange line it is flowing in the opposite direction

Motor Movement

First 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.

step1.png step2.png step3.png

step4.png

Signal Table for Single Phase Forward

We 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 hardware

Now 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.

stepTable.png

Going through one step cycle

oneCycle.png

Other modes of operation

Single 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

doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Double Step Forward Table

Of 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 mode

For 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 mode

An 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

step1.png doubleStep1.png step2.png doubleStep2.png
step3.png doubleStep3.png step4.png doubleStep4.png

Half Step Forward Table

Programming Half Step Mode

Again, 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 library

Up 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:

  • wiringPi
  • wigpio
Why would we be interested to use a different library?

Advantages of pigpio

The pigpio library comes in 2 versions:

  • The standard one where calls to the library code
    results in direct access to the hardware
  • The daemon version where first a daemon (pigpiod)
    is started and then the hardware access is only made in this daemon

Accessing the daemon

The 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

  • pipes (when running on the Raspberry Pi) or

  • through sockets when running on a remote system
    like our Ubuntu PC
There is a library version that runs on the PC

We can write C programs on the PC with hardware access

to our devices on the bread board through pigpio calls to the

PC version of the library which communicates

with the pigpio daemon on the Raspberry Pi

Documentation of pigpio


%SLIDESHOWEND%

--

Start Presentation

Slide 1: Stepping Motors

Lecture 9

Uli Raich

UCC semester 2017/2018

Slide 2: The 27BJY-48 stepper motor and its ULN-2803 driver module

stepping.png

Slide 3: Stepping Motors versus DC Motors

While 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 Card

The 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 chip

The little PCB has 4 LEDs on it to show which of the 2 coils is

powered and in which direction. This is very useful to demonstrate which signals

are sent to the motor and it illustrates nicely the functioning of the motor.

Slide 5: Connecting the Driver to the Motor

connections.png

We can see from the connections that when powering the pink line

the coil current is flowing in one direction while when

powering the orange line it is flowing in the opposite direction

Slide 6: Motor Movement

First 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.

step1.png step2.png step3.png

step4.png

Slide 7: Signal Table for Single Phase Forward

We 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 operation

Single 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

doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Slide 10: Double Step Forward Table

Of 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 mode

For 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 mode

An 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

step1.png doubleStep1.png step2.png doubleStep2.png
step3.png doubleStep3.png step4.png doubleStep4.png

Slide 14: Half Step Forward Table

Slide 15: Programming Half Step Mode

Again, 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 library

Up 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:

  • wiringPi
  • wigpio
Why would we be interested to use a different library?

Slide 17: Advantages of pigpio

The pigpio library comes in 2 versions:

  • The standard one where calls to the library code
    results in direct access to the hardware
  • The daemon version where first a daemon (pigpiod)
    is started and then the hardware access is only made in this daemon

Slide 18: Accessing the daemon

The 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

  • pipes (when running on the Raspberry Pi) or

  • through sockets when running on a remote system
    like our Ubuntu PC
There is a library version that runs on the PC

We can write C programs on the PC with hardware access

to our devices on the bread board through pigpio calls to the

PC version of the library which communicates

with the pigpio daemon on the Raspberry Pi

Slide 19: Documentation of pigpio

The WEB page of pigpio can be found here

pigpioPage.png

Slide 20: Features of pigpio

features.png

Slide 21: This is how to use the library

usage.png

Please convert this to what will be required in your source code.

Slide 22: Sending the pulses to the hardware

Now 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.

stepTable.png

Slide 23: Going through one step cycle

oneCycle.png

 %SLIDESHOWEND%

-- Uli Raich - 2017-10-16

Comments

Changed:
<
<
<--/commentPlugin-->
>
>
<--/commentPlugin-->
The WEB page of pigpio can be found here
 
META FILEATTACHMENT attachment="stepping.png" attr="" comment="" date="1508158008" name="stepping.png" path="stepping.png" size="187310" user="uli" version="1"
META FILEATTACHMENT attachment="step1.png" attr="" comment="" date="1508161292" name="step1.png" path="step1.png" size="4875" user="uli" version="1"
Line: 183 to 1014
 
META FILEATTACHMENT attachment="doubleStep4.png" attr="" comment="" date="1508232004" name="doubleStep4.png" path="doubleStep4.png" size="5591" user="uli" version="1"
META FILEATTACHMENT attachment="stepTable.png" attr="" comment="" date="1508232026" name="stepTable.png" path="stepTable.png" size="18780" user="uli" version="1"
META FILEATTACHMENT attachment="oneCycle.png" attr="" comment="" date="1508232026" name="oneCycle.png" path="oneCycle.png" size="19040" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="pigpioPage.png" attr="" comment="" date="1509025395" name="pigpioPage.png" path="pigpioPage.png" size="234273" user="uli" version="1"
META FILEATTACHMENT attachment="daemon.png" attr="" comment="" date="1509025394" name="daemon.png" path="daemon.png" size="17398" user="uli" version="1"
META FILEATTACHMENT attachment="features.png" attr="" comment="" date="1509025394" name="features.png" path="features.png" size="41150" user="uli" version="1"
META FILEATTACHMENT attachment="gpioI2C.png" attr="" comment="" date="1509025394" name="gpioI2C.png" path="gpioI2C.png" size="78581" user="uli" version="1"
META FILEATTACHMENT attachment="pigpioCalls.png" attr="" comment="" date="1509025395" name="pigpioCalls.png" path="pigpioCalls.png" size="67201" user="uli" version="1"
META FILEATTACHMENT attachment="pigpioLib.png" attr="" comment="" date="1509025395" name="pigpioLib.png" path="pigpioLib.png" size="62353" user="uli" version="1"
META FILEATTACHMENT attachment="pigpioVariants.png" attr="" comment="" date="1509025396" name="pigpioVariants.png" path="pigpioVariants.png" size="21148" user="uli" version="1"
META FILEATTACHMENT attachment="stepperUsage.png" attr="" comment="" date="1509028686" name="stepperUsage.png" path="stepperUsage.png" size="38408" user="uli" version="1"
META FILEATTACHMENT attachment="usage.png" attr="" comment="" date="1509028686" name="usage.png" path="usage.png" size="17316" user="uli" version="1"
 
META TOPICMOVED by="uli" date="1508507143" from="UCC_Course.Lecture8:SteppingMotors" to="UCC_Course.Lecture9:SteppingMotors"

Revision 32017-10-20 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Slide 1: Stepping Motors

Changed:
<
<

Lecture 8

Uli Raich

UCC semester 2017/2018

>
>

Lecture 9

Uli Raich

UCC semester 2017/2018

 

The 27BJY-48 stepper motor an its ULN-2803 driver module

Line: 183 to 183
 
META FILEATTACHMENT attachment="doubleStep4.png" attr="" comment="" date="1508232004" name="doubleStep4.png" path="doubleStep4.png" size="5591" user="uli" version="1"
META FILEATTACHMENT attachment="stepTable.png" attr="" comment="" date="1508232026" name="stepTable.png" path="stepTable.png" size="18780" user="uli" version="1"
META FILEATTACHMENT attachment="oneCycle.png" attr="" comment="" date="1508232026" name="oneCycle.png" path="oneCycle.png" size="19040" user="uli" version="1"
Added:
>
>
META TOPICMOVED by="uli" date="1508507143" from="UCC_Course.Lecture8:SteppingMotors" to="UCC_Course.Lecture9:SteppingMotors"

Revision 22017-10-17 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Slide 1: Stepping Motors

Line: 88 to 88
 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.

Changed:
<
<
step1.png step2.png step3.png step4.png
>
>
step1.png step2.png step3.png

step4.png

 

Added:
>
>

Signal Table for Single Phase Forward

We 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:

    Step 1 Step 2 Step 3 Step 4
In 1 coil 1 + 1 0 0 0
In 2 coil 2 - 0 1 0 0
In 3 coil 1 - 0 0 1 0
In 4 coil 2 + 0 0 0 1

Sending the pulses to the hardware

Now 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.

stepTable.png

Going through one step cycle

oneCycle.png

Other modes of operation

Single 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.

 

Added:
>
>
doubleStep1.png doubleStep2.png doubleStep3.png doubleStep4.png

Position of rotor in doubleStepForward mode

An important point to note is that the rotor moves half a step

further than in single StepForward 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.

  %SLIDESHOWEND%
Line: 107 to 177
 
META FILEATTACHMENT attachment="step3.png" attr="" comment="" date="1508161292" name="step3.png" path="step3.png" size="4864" user="uli" version="1"
META FILEATTACHMENT attachment="step4.png" attr="" comment="" date="1508161292" name="step4.png" path="step4.png" size="4757" user="uli" version="1"
META FILEATTACHMENT attachment="connections.png" attr="" comment="" date="1508162286" name="connections.png" path="connections.png" size="30612" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="doubleStep1.png" attr="" comment="" date="1508232004" name="doubleStep1.png" path="doubleStep1.png" size="5443" user="uli" version="1"
META FILEATTACHMENT attachment="doubleStep2.png" attr="" comment="" date="1508232004" name="doubleStep2.png" path="doubleStep2.png" size="5766" user="uli" version="1"
META FILEATTACHMENT attachment="doubleStep3.png" attr="" comment="" date="1508232004" name="doubleStep3.png" path="doubleStep3.png" size="5304" user="uli" version="1"
META FILEATTACHMENT attachment="doubleStep4.png" attr="" comment="" date="1508232004" name="doubleStep4.png" path="doubleStep4.png" size="5591" user="uli" version="1"
META FILEATTACHMENT attachment="stepTable.png" attr="" comment="" date="1508232026" name="stepTable.png" path="stepTable.png" size="18780" user="uli" version="1"
META FILEATTACHMENT attachment="oneCycle.png" attr="" comment="" date="1508232026" name="oneCycle.png" path="oneCycle.png" size="19040" user="uli" version="1"

Revision 12017-10-16 - uli

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="LectureSlides"

Start Presentation

Slide 1: Stepping Motors

Lecture 8

Uli Raich

UCC semester 2017/2018

Slide 2: The 27BJY-48 stepper motor an its ULN-2803 driver module

stepping.png

Slide 3: Stepping Motors versus DC Motors

While 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 Card

The 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 chip

The little PCB has 4 LEDs on it to show which of the 2 coils is

powered and in which direction. This is very useful to demonstrate which signals

are sent to the motor and it illustrates nicely the functioning of the motor.

Slide 5: Connecting the Driver to the Motor

connections.png

We can see from the connections that when powering the pink line

the coil current is flowing in one direction while when

powering the orange line it is flowing in the opposite direction

Slide 6: Motor Movement

First 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.

step1.png step2.png step3.png step4.png

-- Uli Raich - 2017-10-16

Comments

<--/commentPlugin-->

META FILEATTACHMENT attachment="stepping.png" attr="" comment="" date="1508158008" name="stepping.png" path="stepping.png" size="187310" user="uli" version="1"
META FILEATTACHMENT attachment="step1.png" attr="" comment="" date="1508161292" name="step1.png" path="step1.png" size="4875" user="uli" version="1"
META FILEATTACHMENT attachment="step2.png" attr="" comment="" date="1508161292" name="step2.png" path="step2.png" size="4823" user="uli" version="1"
META FILEATTACHMENT attachment="step3.png" attr="" comment="" date="1508161292" name="step3.png" path="step3.png" size="4864" user="uli" version="1"
META FILEATTACHMENT attachment="step4.png" attr="" comment="" date="1508161292" name="step4.png" path="step4.png" size="4757" user="uli" version="1"
META FILEATTACHMENT attachment="connections.png" attr="" comment="" date="1508162286" name="connections.png" path="connections.png" size="30612" user="uli" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback