Intel Do-It-Yourself Challenge Arduino Motor Shield Nicolas Vailliet Intel Software.

Slides:



Advertisements
Similar presentations
Intel Do-It-Yourself Challenge WiFi
Advertisements

Intel Do-It-Yourself Challenge Networking
Intel Do-It-Yourself Challenge Lab 5: Controlling Galileo from a webpage Nicolas Vailliet
Win8 on Intel Programming Course Win8 for developers, in detail Cédric Andreolli Intel.
Win8 on Intel Programming Course Desktop : Introduction Cédric Andreolli Intel Software.
Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
Win8 on Intel Programming Course Desktop : WPF Cédric Andreolli Intel Software
EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
EMS1EP Lecture 8 Pulse Width Modulation (PWM)
10+10 Descending the Design Funnel Chapter 1.4 in Sketching User Experiences: The Workbook.
Intel Do-It-Yourself Challenge node.js
The State Transition Diagram
Internet of Things with Intel Edison Servo motors with Pololu Controller Pierre Collet
Win8 on Intel Programming Course Desktop : Sensors Cédric Andreolli Intel Software
Lecture 1 – Arduino Basics
Intel Do-It-Yourself Challenge Intel Galileo and Edison Paul Guermonprez Intel Software.
Internet of Things with Intel Edison Getting started with your board Pierre Collet Intel.
Lab7: Introduction to Arduino
Internet of Things with Intel Edison Web controller
Intel Do-It-Yourself Challenge Lab 3: A demo with LED and sensor
Internet of Things with Intel Edison GPIO on Edison
Embedded Sumo 1T4 – 1T5 UTRA.
Win8 on Intel Programming Course Win8 and Intel Paul Guermonprez Intel Software
Why Should I Sketch? Chapter 1.2 in Sketching User Experiences: The Workbook.
Intel Do-It-Yourself Challenge Sensors Nicolas Vailliet Intel Software
Intel Do-It-Yourself Challenge Pololu USB Controller Nicolas Vailliet Intel Software.
Intel Do-It-Yourself Challenge : Let’s build an autonomous drone Paul Guermonprez Intel.
The Keyboard Study Lecture /slide deck produced by Saul Greenberg, University of Calgary, Canada Notice: some material in this deck is used from other.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Intel Do-It-Yourself Challenge Arduino sketches and full SD image Nicolas Vailliet Intel.
The Branching Storyboard Chapter 4.3 in Sketching the User Interface: The Workbook Image from:
Using the Arduino to Make an LED Flash Work in teams of two! living with the lab digital I/O pins (I/O = input / output) USB cable plug power pins.
Internet of Things with Intel Edison Presentation Paul Guermonprez Intel Software
Win8 on Intel Programming Course Desktop : Perceptual Computing Cédric Andreolli Intel.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
Internet of Things with Intel Edison Led sensor lab
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Sequential Storyboards Chapter 4.1 in Sketching the User Interface: The Workbook Image from:
Intel Do-It-Yourself Challenge Hello World with the Arduino IDE Nicolas Vailliet Intel.
Intel Do-It-Yourself Challenge Lab 1: Intel Galileo’s Arduino side Nicolas Vailliet
CPSC 581 Human Computer Interaction II Interaction Design Lecture /slide deck produced by Saul Greenberg, University of Calgary, Canada Notice: some material.
Intel Do-It-Yourself Challenge Lab 2: Intel Galileo’s Linux side Nicolas Vailliet Intel.
Collecting Images & Clippings Chapter 2.3 in Sketching User Experiences: The Workbook.
Graphical Screen Design Part 1: Contrast, Repetition, Alignment, Proximity Lecture /slide deck produced by Saul Greenberg, University of Calgary, Canada.
Win8 on Intel Programming Course Modern UI : Sensors Cédric Andreolli Intel Software.
Win8 on Intel Programming Course Modern UI : Features Cédric Andreolli Intel Software.
Intel Do-It-Yourself Challenge OpenCV
Win8 on Intel Programming Course The challenge Paul Guermonprez Intel Software
RC CAR CONTROLLER BASED ON INTEL GALILEO SOC PLATFORM Nadav Shiloach Sagi Sabag Supervisor: Idan Shmuel Spring 2014 One Semester Project PROJECT’S ENDING.
Win8 on Intel Programming Course Modern UI HelloWorld in HTML5/JS Cédric Andreolli Intel.
Internet of Things with Intel Edison Compiling and running Pierre Collet Intel Software.
Introduction to the Arduino
The Animated Sequence Chapter 5.1 in Sketching User Experiences: The Workbook.
Intel Do-It-Yourself Challenge Wi-Fi Nicolas Vailliet Intel Software
Internet of Things with Intel Edison CylonJS Pierre Collet Intel Software
Sketching Vocabulary Chapter 3.4 in Sketching User Experiences: The Workbook Drawing objects, people, and their activities.
Win8 on Intel Programming Course Paul Guermonprez Intel Software
Design of Everyday Things Part 2: Useful Designs? Lecture /slide deck produced by Saul Greenberg, University of Calgary, Canada Images from:
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
The Narrative Storyboard Chapter 4.4 in Sketching User Experiences: The Workbook.
Introduction to Arduino A very basic intro to Arduino, the IDE and the Servos class.
Pulse-Width Modulation: Simulating variable DC output
Intel Do-It-Yourself Challenge Compile C/C++ for Galileo
Controlling Servos with the Arduino
Sketching Vocabulary Chapter 3.4 in Sketching User Experiences: The Workbook Drawing objects, people, and their activities.
Mini Robot Chassis Top View
Agenda Video pre-presentations Digital sketches & photo traces
Methodology Overview 2 basics in user studies Lecture /slide deck produced by Saul Greenberg, University of Calgary, Canada Notice: some material in this.
Arduino Uno circuit basics
Presentation transcript:

Intel Do-It-Yourself Challenge Arduino Motor Shield Nicolas Vailliet Intel Software

We’ll need Arduino Motor Shield Galileo board booted with full Yocto image, network and ssh. A motor. Arduino Motor Shield.

The shield

Hello Motor

Let’s start Hardware First, be sure your Galileo is off. Plug the Arduino Motor Shield on your Galileo. Turn the board on, and connect with SSH. Plug a motor on channel A Software The motor can be controlled with GPIO, easily accessible from /sys/class/gpio/ Run the script from the next slide. If it does not work, we’ll see why in the PWM section.

Script # disable pins 12 & 9 just in case echo -n “12" > /sys/class/gpio/unexport echo -n “9" > /sys/class/gpio/unexport # enable pins 12 & 9 echo -n “12" > /sys/class/gpio/export echo -n "9" > /sys/class/gpio/export # we are going to send info on these pins echo -n "out" > /sys/class/gpio/gpio9/direction echo -n "out" > /sys/class/gpio/gpio12/direction # brake on channel A is off echo -n “0" > /sys/class/gpio/gpio9/value # moving forward on channel A echo -n “1” > /sys/class/gpio/gpio12/value

Pulse-Width Modulation

PWM Pulse-Width Modulation PWM stands for Pulse-Width Modulation and helps you to generate a periodic signal on a pin.

PWM Pulse-Width Modulation When you specify period and duty cycle values, the board generates the output HIGH only when the blue curve is over the red line. Otherwise, output is 0. In other words, you generate a squared signal which looks like this :

Warnings ! Warning ! Devices could be damaged by heat if you misconfigure IO ports. If it happens, don’t touch your devices ! Unplug the power supply and let it cool down 10 minutes. Warning ! Considering channel A, you will need to set pin 12 to 0 before modifying pwm3 period and duty_cycle values.

PWM Script # configuring PWM3 to control channel A voltage. echo -n "3" > /sys/class/pwm/pwmchip0/export # reverse command is the same but writing 3 into unexport echo -n "1" > /sys/class/pwm/pwmchip0/pwm3/enable # reverse command is printing 0 instead of 1 # PWM period write period in nanoseconds (here 5 milliseconds) echo -n “ " > /sys/class/pwm/pwmchip0/pwm3/period echo -n “650000" > /sys/class/pwm/pwmchip0/pwm3/duty_cycle # PWM duty cycle write in nanoseconds. # Simplified formula is duty cycle = ??0000 # (with ?? the percentage you want). Example with 65%

Summary script

Summary Pins Channel A (in parenthesis, values for the LSB image on SD card) Control pins are: 3 (18), 9 (19)and 12 (38) Brake : 9(19) Direction : 12 (38) Speed : PWM3 (mapped on 3) Pins Channel B Control pins are: 11 (25, 8 (26) and 13 (39) Brake : 8 (26) Direction : 13 (39) Speed : PWM4 (mapped on 11) Commands # print information about GPIO cat /sys/kernel/debug/gpio # exporting GPIO Port to file system echo -n “9" > /sys/class/gpio/export

Summary # GPIO Port Direction (in or out) echo -n “in" > /sys/class/gpio/gpio9/direction # Setting GPIO Port Drive Configuration # "pullup", "pulldown", "strong", or "hiz" # "strong" is recommended. echo -n "strong" > /sys/class/gpio/gpio9/drive # Reading GPIO Port cat /sys/class/gpio/gpio12/value # Writing GPIO Port echo -n "1" > /sys/class/gpio/gpio12/value echo -n "0" > /sys/class/gpio/gpio12/value # Reading analog value cat /sys/bus/iio/devices/iio # \:device0/in_voltage0_raw # # Please refer to Sergey’s blog about IO mapping on Galileo.

Arduino Sketch and C versions

Arduino sketch version Of course, you can do all of this with an Arduino sketch: int delay_time = 500; void setup() { pinMode(12, OUTPUT); pinMode(9, OUTPUT); } void loop(){ digitalWrite(9, LOW); digitalWrite(12, HIGH); analogWrite(3, 255); //Full speed on channel A delay(delay_time ); analogWrite(3, 50); //Low speed on channel A delay(delay_time); digitalWrite(12,LOW); delay(delay_time); }

C version Use the large Yocto LSB image If you have installed the full Linux Standard Base image, you should be able to write a C program to use your motors. Open IO files in sysfs and do the same as previously! With an SD card and embedded GCC, you can easily compile and run your program on the board!

C version Compilation If you want to cross-compile your program before loading it on the board, use Yocto cross-compiler. The procedure is the same than to create a Linux image, except the final bitbake command that is: bitbake image-sdk –c populate_sdk source /opt/poky/1.4.2/environment-setup-x86_64-poky- linux ${CC} myfile.c –o myfile

License Creative Commons – By 3.0 You are free: to Share — to copy, distribute and transmit the work to Remix — to adapt the work to make commercial use of the work Under the following conditions: Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). With the understanding that: Waiver — Any of the above conditions can be waived if you get permission from the copyright holder. Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license. Other Rights — In no way are any of the following rights affected by the license: – Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; – The author's moral rights; – Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.