Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
MotorsIntroduction | |||||||||
Line: 58 to 59 | |||||||||
| |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
A stepper object is created with: | |||||||||
Deleted: | |||||||||
< < | |||||||||
from stepper import steppingMotor stepper = steppingMotor() # the parameters p1,p2,p3,p4 are optional and allow to connect the stepping motor to different GPIO lines |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
MotorsIntroduction | ||||||||
Line: 52 to 52 | ||||||||
will move the servo to 90 degrees.
Stepping Motor | ||||||||
Changed: | ||||||||
< < | In order to learn about how stepping motors work please refer to the 2017 course on embedded systems lecture 9: UCC_Course/Lecture9:SteppingMotors. We will use a 27BJY-48 stepper motor with its associated ULN-2803 driver module. http://robocraft.ru/files/datasheet/28BYJ-48.pdf![]() ![]() | |||||||
> > | In order to learn about how stepping motors work please refer to the 2017 course on embedded systems lecture 9: Embedded_Systems/Lecture9:SteppingMotors. We will use a 27BJY-48 stepper motor with its associated ULN-2803 driver module. http://robocraft.ru/files/datasheet/28BYJ-48.pdf![]() ![]() | |||||||
The stepping Motor class included in the MicroPython binary uses the following default connections
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
MotorsIntroduction | ||||||||
Line: 42 to 42 | ||||||||
The servo motor is connected to the WeMos D1 as follows
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
I wrote and integrated into the MicroPython binary a simple servo driver which makes it extremely simple to control the servo motor: | ||||||||
Deleted: | ||||||||
< < | ||||||||
from servo import Servo servo = Servo() servo.angle(90) |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
MotorsIntroduction | ||||||||
Line: 99 to 99 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
MotorsIntroduction | ||||||||
Line: 9 to 9 | ||||||||
The DC motor | ||||||||
Changed: | ||||||||
< < | The DC motor we use need ~ 350 mA of power and can therefore not be run when the ESP32 power is coming from the USB connector, delivering a maximum ~200mA. We will need an external power supply! | |||||||
> > | The DC motor we use needs ~ 350 mA of power and can therefore not be run when the ESP32 power is coming from the USB connector, delivering a maximum ~200mA. We will need an external power supply! | |||||||
![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
MotorsIntroduction | ||||||||
Line: 20 to 20 | ||||||||
As shown in the photo on the right 2 solder bridges must be installed to
| ||||||||
Changed: | ||||||||
< < | The motor control shield is accessed as an I2C device on address 0x30. I2C access is managed by an STM32F030 micro controller, which unfortunately is delivered with buggy firmware. When trying, I saw the device on the I2C bus immediately after reset but when trying a second time it disappeared from the bus. | |||||||
> > | The motor control shield is accessed as an I2C device on address 0x30. I2C access is managed by an STM32F030 micro controller, which unfortunately is delivered with buggy firmware. When trying, I saw the device on the I2C bus immediately after reset but when trying a second time it had disappeared from the bus. | |||||||
Fortunately for us other people have noticed this before and Piotr Bugalski has written replacement firmware which works reliably. Have a look at https://hackaday.io/project/18439-motor-shield-reprogramming ![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
MotorsIntroduction | ||||||||
Changed: | ||||||||
< < | We have 3 different types of motors in out kit: | |||||||
> > | We have 3 different types of motors in our kit: | |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
MotorsIntroduction | ||||||||
Line: 74 to 74 | ||||||||
| ||||||||
Changed: | ||||||||
< < | You can set the mode with the method stepMode(): | |||||||
> > | You can set the mode with the method stepMode(): | |||||||
stepper.stepMode(stepper.DOUBLE_PHASE_FORWARD)You can change the movement speed with the method waitAfterSteps() which defines how long to wait after each step in ms. Valid values are 2..1000. Again the method returns the value currently in use if called without a parameter. | ||||||||
Line: 84 to 83 | ||||||||
Finally the method move(noOfSteps) moves the stepping motor noOfSteps in the mode and with the speed currently selected. | ||||||||
Added: | ||||||||
> > | The exercise sheet in odt format: https://iotworkshop.africa/pub/IoT_Course_English/Motors/exercise_7.odt | |||||||
-- ![]() Comments | ||||||||
Line: 94 to 97 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MotorsIntroduction | |||||||||||||||
Line: 44 to 44 | |||||||||||||||
| |||||||||||||||
Added: | |||||||||||||||
> > | I wrote and integrated into the MicroPython binary a simple servo driver which makes it extremely simple to control the servo motor: | ||||||||||||||
Changed: | |||||||||||||||
< < |
I wrote and integrated into the MicroPython binary a simple servo driver which makes it extremely simply to control the servo motor: from servo import Servo servo = Servo() servo.angle(90) | ||||||||||||||
> > | from servo import Servo servo = Servo() servo.angle(90) | ||||||||||||||
will move the servo to 90 degrees. | |||||||||||||||
Added: | |||||||||||||||
> > | Stepping MotorIn order to learn about how stepping motors work please refer to the 2017 course on embedded systems lecture 9: UCC_Course/Lecture9:SteppingMotors. We will use a 27BJY-48 stepper motor with its associated ULN-2803 driver module. http://robocraft.ru/files/datasheet/28BYJ-48.pdf![]() ![]()
from stepper import steppingMotor stepper = steppingMotor() # the parameters p1,p2,p3,p4 are optional and allow to connect the stepping motor to different GPIO linesThe steppingMotor class uses different modes for stepping:
stepper.stepMode(stepper.DOUBLE_PHASE_FORWARD)You can change the movement speed with the method waitAfterSteps() which defines how long to wait after each step in ms. Valid values are 2..1000. Again the method returns the value currently in use if called without a parameter. The method clrAll() set all coils (IN1..IN4) to zero. Finally the method move(noOfSteps) moves the stepping motor noOfSteps in the mode and with the speed currently selected. | ||||||||||||||
-- ![]() |
Line: 1 to 1 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MotorsIntroduction | |||||||||||||
Line: 33 to 33 | |||||||||||||
| |||||||||||||
Added: | |||||||||||||
> > | The Servo MotorThe servo motor we use is of type SG90. It is a cheap hobbyist servo which can be run directly off the ESP32 power supply even it that board is powered through an USB connector. For connections and technical details pleas consult the SG90 data sheet![]() ![]()
from servo import Servo servo = Servo() servo.angle(90) will move the servo to 90 degrees. | ||||||||||||
-- ![]() Comments | |||||||||||||
Line: 42 to 60 | |||||||||||||
| |||||||||||||
Added: | |||||||||||||
> > |
|
Line: 1 to 1 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||
> > |
MotorsIntroductionWe have 3 different types of motors in out kit:
The DC motorThe DC motor we use need ~ 350 mA of power and can therefore not be run when the ESP32 power is coming from the USB connector, delivering a maximum ~200mA. We will need an external power supply!![]()
![]() ![]()
![]() Comments
|