Internet of Things with Intel Edison Servo motors with Pololu Controller Pierre Collet www.Intel-Software-Academic-Program.com paul.guermonprez@intel.com.

Slides:



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

Intel Do-It-Yourself Challenge Lab 5: Controlling Galileo from a webpage Nicolas Vailliet
Project Title Here IEEE UCSD Overview Robo-Magellan is a robotics competition emphasizing autonomous navigation and obstacle avoidance over varied, outdoor.
LAB 9: Environment Setup for Tower System Chung-Ta King National Tsing Hua University CS 4101 Introduction to Embedded Systems.
Intel Do-It-Yourself Challenge Arduino Motor Shield Nicolas Vailliet Intel Software.
Lab 02: AEV Arduino Programming Basics Advanced Energy Vehicle (AEV)
Intel Do-It-Yourself Challenge Intel Galileo and Edison Paul Guermonprez Intel Software.
ZXM10 EISU Training.
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
How to use Arduino By: Andrew Hoffmaster.
Intel Do-It-Yourself Challenge Pololu USB Controller Nicolas Vailliet Intel Software.
Internet of Things with Intel Edison Presentation Paul Guermonprez Intel Software
Bread Boarding and Operating The IFI Robotic Control System.
Handheld TFTP Server with USB Andrew Pangborn Michael Nusinov RIT Computer Engineering – CE Design 03/20/2008.
Wireless Surveillance Vehicle Lance P. Riegert Rodrigo A. Urra Steve C. Wilson September 18, 2007Wireless Surveillance Vehicle1 of 20 Senior Design Project.
Design and Implementation of a Virtual Reality Glove Device Final presentation – winter 2001/2 By:Amos Mosseri, Shy Shalom, Instructors:Michael.
Technion – Israel Institute of Technology Department of Electrical Engineering High Speed Digital Systems Lab Project performed by: Naor Huri Idan Shmuel.
Internet of Things with Intel Edison Led sensor lab
1 Arduino Board: Arduino UNO Arduino Programing Environment: Arduino 0022
Topics 1.Taking the Lock into use – physical serialization 2.Detailed setup options 3.Using mobile broadband 4.Taking the Key into use.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Intel Do-It-Yourself Challenge Lab 1: Intel Galileo’s Arduino side Nicolas Vailliet
Robotics Research Laboratory Louisiana State University.
Chapter 7Assembling Your Own Computer System  7.1Assembling the Hardware 7.1Assembling the Hardware 7.1Assembling the Hardware  7.2Installing the Operating.
Arduino Part 1 Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion.
Chapter 8 All About SCSI.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 22 All About SCSI.
1 3-Software Design Basics in Embedded Systems. 2 Development Environment Development processor  The processor on which we write and debug our programs.
RC CAR CONTROLLER BASED ON INTEL GALILEO SOC PLATFORM Nadav Shiloach Sagi Sabag Supervisor: Idan Shmuel Spring 2014 One Semester Project PROJECT’S ENDING.
High Speed Data Converter University
The New FTC Platform (Connecting your legacy hardware)
Internet of Things with Intel Edison Compiling and running Pierre Collet Intel Software.
PRESENTATION ON MOTHERBOARD. MOTHERBOARD The motherboard is the main circuit board inside your PC. A motherboard is the central printed circuit board.
Hardware Overview Autopilot Control Board- Serves as common platform for other components and has autopilot code and flight plans Battery- Powers the.
By: Khalid Hawari Muath Nijim Thaer shaikh Ibrahim Supervisor: Dr. Jamal Kharousheh Dr. Nasser Hamad 27 December 2010.
Internet of Things with Intel Edison CylonJS Pierre Collet Intel Software
CANBus Hardware Setup. CANBus CANBus is a control system method that can be used instead of the conventional PWM system. It uses RJ12 cable, which is.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Chapter 3 System Configuration The Complete A+ Guide to PC Repair 5/e Update.
Xtreme Robot Olympiad Programming Basics Dr. Peter Laz Associate Professor Department of Engineering University of Denver.
1 4-Development Environment Development processor  The processor on which we write and debug our programs Usually a PC Target processor  The processor.
Brain Software. Things you need Administrator Rights Know how to open a folder Know how to unzip a file??? Know any special changes your IT department.
Source Controller software Ianos Schmidt The University of Iowa.
Technical Introduction April Internal usage only 1 General Features  Self contained batch solution for small, standalone applications.  All functionality.
AT91SAM7 Flash Programming Solutions. ARM-Based Products Group 2  Introduction Flash Programming Terms, Definitions and Glossary  Flash Programming.
실험 구성 (DC모터 속도제어) -Matlab xPC Target 이용
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
After Construction Name: Per #:.
By Ganesan Alagu Ganesh Feb 26, 2008
Embedded Systems Intro to the Arduino
Implementation of Embedded OS
Chapter 3 General-Purpose Processors: Software
Programming and Debugging with the Dragon and JTAG
Computer System Laboratory
By Ganesan Alagu Ganesh Feb 21, 2008
IBM PC Controlled Keypunch4b
Arduino Development for Beginners
INC 161 , CPE 100 Computer Programming
AVR32 UC3 EVK1100 Control Panel Tutorial
Roller Coaster Design Project
Serial Data Hub (Proj Dec13-13).
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Introducing the Arduino Uno
Introduction to Arduino
Lab #1: Getting Started.
Presentation transcript:

Internet of Things with Intel Edison Servo motors with Pololu Controller Pierre Collet www.Intel-Software-Academic-Program.com paul.guermonprez@intel.com Intel Software 2014-10-14

Objectives Objective Servo motors are controlled with a signal called PWM. To interact correctly with a PWM device, you need to generate a strict signal. Obvious for a basic microcontroller, not so much for a general purpose processor with a regular linux. Two solutions : Use a Real Time OS. On Edison the second processor is running a Real Time OS so we can do it on Edison itself. Use an external PWM card, connected with USB. A good example : Pololu Maestro card. Today, we’ll use the Pololu Maestro with 6 PWMs.

Setup

LibUSB LibUSB We are connected to the Pololu card with USB, using USB messages. We need libusb-1.0-dev and we’ll use a package for Yocto, the Linux by default on Edison. To install : echo "src/gz all http://repo.opkg.net/edison/repo/all" > /etc/opkg/base-feeds.conf echo "src/gz edison http://repo.opkg.net/edison/repo/edison" >> /etc/opkg/base-feeds.conf echo "src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32" >> /etc/opkg/base-feeds.conf echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf opkg update opkg install libusb-1.0-dev

Using the Master USB port Master/Client When you plug Edison to your PC with a USB cable, you see Edison as a serial-over-USB device and a mass storage device. That’s the client mode of USB. Switch But Edison is also a PC, acting as master. To use the full size USB port on the board as a master, operate the switch. Remember to switch it back after this lab.

Hardware Connecting hardware Plug and boot your board. Connect the Pololu card to Edison on USB host connector using a standard mini USB Cable. Connect a servo motor on Pololu channel #1. In the next slide we’ll see how to power the Pololu from a USB port.

Hardware – Power from USB The Pololu has 2 power requirements : Very minimal for the microcontroller. This power comes from the USB cable. High for the servos. We need to get this power from an external source and connect it to the 2 power pins of the Pololu. Two methods Usually, we would get a 6V battery with the right connector. If you have one, use it. If you don’t, it’s possible to : cut a USB cable (it’s not reversible, obviously), separate wires get the 2 power wires (red and black) connect manually the 2 wires to the Pololu power pins

Hardware Regular USB cable DATA Modified USB cable POWER ONLY Vin #0 #5

Script

Shell script to control a servo Binaries We provide you 3 binaries to control 3 parameters : The targeted position of the servo motor The speed of the servo motor (0 is max speed) The acceleration of the servo motor (0 is max acceleration) For each binary, the first argument is the channel number and the second parameter is the value. How to run this files # ./set_accel 0 0 # ./set_speed 0 0 # ./set_target 0 2000 The order is automatically sent to the Pololu card via USB. These binaries are C++ program using libusb-1.0.

Shell script to control a servo A simple bash script to control a servo motor #! /bin/bash while : # infinite loop do ./set_target 0 1000 # channel 0 targeted position is set to 1000 sleep 1s # we wait a second ./set_target 0 2000 sleep 1s Done It’s just moving the servo from 1000 to 2000 and back, with 1s pauses.

C Code

Set_target source code A C++ main function using libusb #include <iostream> #include <string> #include <libusb-1.0/libusb.h> #include <unistd.h> #include <stdlib.h> using namespace std; int main(int argc, char *argv[]){ if(argc < 3) cout << "Usage: binary servo_number target_value" << endl; int servo = atoi(argv[1]); int value = atoi(argv[2]);

Set_target source code Creating libusb structures libusb_device **devs; libusb_context *ctx = NULL; libusb_device_descriptor descr; libusb_device *pololu; string idPololu ("137"); int r; int found = 0; ssize_t cnt, i; Initializing libusb r = libusb_init(&ctx); libusb_set_debug(ctx, 3); Seeking devices cnt = libusb_get_device_list(ctx, &devs);

Set_target source code For each device found for(i = 0; i < cnt; i++) { r = libusb_get_device_descriptor(devs[i],&descr); //pololu id is 137, so let’s find it if(descr.idProduct == 137) { pololu = (devs[i]); found = 1; break; Stop looking for devices and don’t unreference the pololu } libusb_unref_device(devs[i]);

Set_target source code Sending target command if(found) { libusb_device_handle **handle; r = libusb_open(pololu,handle); r = libusb_detach_kernel_driver(*handle,0); if(r < 0 && r != LIBUSB_ERROR_NOT_FOUND) { cout<<"Error: detach kernel driver failed"<<endl; return 1; } r = libusb_claim_interface(*handle,0); r = libusb_control_transfer( *handle,0x40,//request type 0x85, //request value, //value servo, //servo number NULL,0,5000);

Set_target source code Closing USB connection r = libusb_release_interface(*handle,0); libusb_close(*handle); } libusb_free_device_list(devs, 1); libusb_exit(ctx); return 0;

Conclusion Conclusion Idea : Integrate Edison and Android ? Edison being a PC, you can expect to find a lot of great USB solutions to all your problems. Same thing for webcams. For PWM, you could do without the Pololu Maestro, both are good solutions. Idea : Integrate Edison and Android ? An IoT project which need a remote ? Use your Android smartphone to control Edison ! We’ve seen how to create a web form with NodeJS, you can also create an Android app with a native look and feel.

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. http://creativecommons.org/licenses/by/3.0/