Servos and Stepper Motors

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 8 Pulse Width Modulation (PWM)
Advertisements

Lab7: Introduction to Arduino
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Motor Control Lab Using Altera Nano FPGA
ELCT 201 week 13 Analog ON/OFF control system conversion to Digital ON/OFF control system.
L.
Intro to Programming and Microcontrollers. Activity Group into pairs and sit back-to-back. Pick one person who is going to draw. The other person will.
Arduino. Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source.
Finish your programs from last week STOPLIGHT CIRCUIT! You may need … – int – void setup() – void loop() – pinMode – digitalWrite – delay.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
TechKnowTone Contents: Servo Features Servo Connections Coding Library Sample Sketch Questions …Applications… Arduino Coding – Servo Motors.
chipKit Sense Switch & Control LED
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
Working with Arduino: Lesson #4: Servos EGN1007. Learning Goals Learning Goals: The student will be able to: 1.Build a complete circuit using the Arduino.
Intro to Arduino Programming. Draw your circuits before you build them From Arduino 330 Ohm From Arduino 330 Ohm From Arduino 330 Ohm.
Good LED Circuit 5V0 GND. What Voltage Does Meter See? Answer: 5 V.
LECTURE 2 – INPUTS THIS LECTURE WILL INTRODUCE HOW TO INPUT SIGNALS INTO AN ARDUINO.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
A3144 SENSITIVE HALL-EFFECT SWITCHES & AH Linear Hall sensor
MAKE: AN ELECTRONICS WORKSHOP
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Motor TYWu.
Microcontroller basics Embedded systems for mortals.
Microcontroller basics Embedded systems for mortals.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Introduction to Arduino A very basic intro to Arduino, the IDE and the Servos class.
Arduino DC Motor Motion Control Instructor: Dr Matthew Khin Yi Kyaw.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
ARDUINO 실습 과제 보 고서. PWM 은 아날로그 출력이라는 함수를 사용하게 되는데 이 출력에는 3, 5, 6, 9, 10, 11 번의 핀만 사용 가능. ( 숫자 옆 에 ~ 표시 )
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Pulse-Width Modulation: Simulating variable DC output
Arduino Application: Speed control of small DC Motors
CSE 341 Project : Ultrasonic Radar PRESENTED BY: NAME : AKIFA TASNEEM ID : SECTION: 02 1.
Hacking on Arduino George Patterson
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
Having fun with code, using Arduino in a middle school CS classroom
Introduction to Motors, servos and steppers
H-Bridge Motor Driver.
Introduction to Physical Computing
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
A3144 SENSITIVE HALL-EFFECT SWITCHES & AH Linear Hall sensor
If you want to swing an robot arm or …
Microcontroller basics
Microcontroller basics
UTA010 : Engineering Design – II
Program the robotic arm
Get Your Project Started with Arduino
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino Part 1 Topics: Microcontrollers Programming Basics
Arduino Uno and sensors
Roller Coaster Design Project
Arduino Application: Speed control of small DC Motors
IoT Programming the Particle Photon.
CS-4540 Robotics - Lab 05 Switch inputs to the Arduino Uno
Introducing the Arduino Uno
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
Topics: Programming Constructs: loops & conditionals Digital Input
Arduino : Introduction & Programming
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Arduino Motor Lab Inspired by NYU ITP project
UNIT 11: RC-SERVOMOTOR CONTROL
Robotics System Lecture 11_12: DC Motor
Setting up a basic program with Arduino
SAURABH GINGADE.
Interrupts.
Pulse-Width Modulation: Simulating variable DC output
A modular robot for use in the RoboSumo lab
Presentation transcript:

Servos and Stepper Motors CS-4540 Robotics - Lab 05 Servos and Stepper Motors

Including this as a handy reference for the lab http://forum.arduino.cc/index.php/topic,146315.0.html http://forum.arduino.cc/index.php?action=dlattach;topic=146315.0;attach=90365

Revisiting the “Connecting a switch to an I/O pin lab” sample software This is an example of the bad code from last lab. DO NOT USE. It was copy-pasted from a web page and contains hidden ‘non breaking’ spaces which do not compile when posted into the Arduino IDE. Only use this to practice finding code breaking characters. //sample switch code const int buttonPin = 4; const int ledPin =  8; int buttonState = 0; void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT); } void loop() {   buttonState = digitalRead(buttonPin);   if (buttonState == HIGH) {     digitalWrite(ledPin, HIGH); } else {     digitalWrite(ledPin, LOW);

Finding hidden characters in the text file Using Notepad++

Finding hidden characters in the text file Using Notepad++ OUCH!

Small stepper motor with driver electronics http://www.instructables.com/id/Controlling-a-Stepper-Motor-with-an-Arduino/ Small stepper motor with driver electronics The driver board acts as an amplifier so that the low current signal output from the Arduino can be converted to the high power high current required to drive the motor.

Stepper motor driver code *** Sample of the code *** /*    BYJ48 Stepper motor code    Connect :    IN1 >> D8    IN2 >> D9    IN3 >> D10    IN4 >> D11    VCC ... 5V Prefer to use external 5V Source    Gnd    written By :Mohannad Rawashdeh   https://www.instructables.com/member/Mohannad+Rawashdeh/      28/9/2013   */ #define IN1  8 #define IN2  9 #define IN3  10 #define IN4  11 int Steps = 0; boolean Direction = true;// gre unsigned long last_time; unsigned long currentMillis ; int steps_left=4095; long time; void setup() { Serial.begin(115200); pinMode(IN1, OUTPUT);  pinMode(IN2, OUTPUT);  pinMode(IN3, OUTPUT);  pinMode(IN4, OUTPUT);  // delay(1000); } void loop() { *** see actual code in CSNS resources text file *** Stepper Driver Code for 4096 steps/revolution motor Using the code from this instructable because it works better with the motors we have, which are 4096 steps/revolution steppers. http://www.instructables.com/id/BYJ48-Stepper-Motor/

Wiring up the stepper and drive circuit Negative side of the power supply connects to this pin Positive side of the power supply connects to this pin

Stepper wiring pictorial

PWM Servos http://www.instructables.com/id/Arduino-Servo-Motors/ Black or Brown wire The servos we are using are small enough that the Arduino can provide enough power to safely run them. Larger more powerful Servos would require a separate power supply the same as we used on the stepper.

Using the built-in servo library and example code

Lab assignment Setup and run a stepper motor demo program. Hold and stop the Stepper for a brief moment while running – does it return to it’s original start point? Or has it forgotten where it is. See how fast you can get the stepper to turn one complete revolution. Setup and run the servo motor demo program. Hold and stop the Servo for a brief moment while running – does it return to it’s original start point? Or has it forgotten where it is. See how fast you can get the Servo to turn all the way one direction and return. Start thinking about how you would hook 2 steppers or Servos to the Arduino and program it to draw a square using the 2-arm pen potter.

References http://www.instructables.com/id/Arduino-Servo-Motors/ http://forum.arduino.cc/index.php/topic,146315.0.html http://forum.arduino.cc/index.php?action=dlattach;topic=146315.0;attac h=90365 http://www.instructables.com/id/Controlling-a-Stepper-Motor-with-an- Arduino/ http://www.instructables.com/id/BYJ48-Stepper-Motor/