Week 9 | 24-03-2021
Files:
Planning:
- Decide the machine-to-be-built,
- Divide the whole group into sub-teams,
- Divide the work for sub-teams,
- Execute..
Tools:
Stepper Motors,
Ultimaker,
Aluminium Extrusions,
Trotec Laser Cutter,
Prusa Printer,
Arduino IDE,
Arduino Nano.
// MultiStepper.pde
// -*- mode: C++ -*-
// Use MultiStepper class to manage multiple steppers and make them all move to
// the same position at the same time for linear 2d (or 3d) motion.
#include
#include
// EG X-Y position bed driven by 2 steppers
// Alas its not possible to build an array of these with different pins for each :-(
AccelStepper stepper1(AccelStepper::FULL4WIRE, 2, 3, 4, 5);
AccelStepper stepper2(AccelStepper::FULL4WIRE, 8, 9, 10, 11);
// Up to 10 steppers can be handled as a group by MultiSteppe
MultiStepper steppers;
void setup() {
Serial.begin(9600);
// Configure each stepper
stepper1.setMaxSpeed(100);
stepper2.setMaxSpeed(100);
// Then give them to MultiStepper to manage
steppers.addStepper(stepper1);
steppers.addStepper(stepper2);
}
void loop() {
long positions[2]; // Array of desired stepper positions
positions[0] = 1000;
positions[1] = 50;
steppers.moveTo(positions);
steppers.runSpeedToPosition(); // Blocks until all are in position
delay(1000);
// Move to a different coordinate
positions[0] = -100;
positions[1] = 100;
steppers.moveTo(positions);
steppers.runSpeedToPosition(); // Blocks until all are in position
delay(1000);
}
Image Description
A stepper motor consists of two main parts, a rotor and a stator. The rotor is the part of the motor that actually spins and provides work. The stator is the stationary part of the motor that houses the rotor. In a stepper motor, the rotor is a permanent magnet. The stator consists of multiple coils that act as electromagnets when an electrical current is passed through them. The electromagnetic coil will cause the rotor to align with it when charged. The rotor is propelled by alternating which coil has a current running through it.
Image Description
An H-Bridge is a circuit comprised of 4 switches that can safely drive a DC motor or stepper motor.Unlike a single transistor which only allow you to control the speed of a motor, H-bridges allow you to also control the direction in which the motor spins. It does this by opening different switches (the transistors) to allow the current to flow in different directions and thus changing the polarity on the motor.
Make a website with Mobirise