ECE 480 Design Team 3 Technical Lecture Arduino



















- Slides: 19

ECE 480 Design Team 3 Technical Lecture Arduino Controller Design

Overview • Arduino Fio and XBee Basics • Joystick Interface • Motor Control • Interrupt Sensor

Introduction • Based on Microprocessor ATmega 328 P Ø 3. 3 V Ø 8 MHz • C/C++ Based Ø http: //arduino. cc/en/Reference/Home. Page • 14 Digital I/O Ø 6 PWM Available (8 bit) Ø analog Write() (2 bytes Duty Cycle)

Introduction Continued • 8 Analog Inputs Ø 10 bit Resolution Ø Default Reference (Vcc) Ø AREF (0 -5 V limit) Ø analog. Reference(EXTERNAL) • 32 KB Flash Memory (Sketches) Ø 2 KB for Bootloader

Connections • Wired • Data (pins, header, solder) • Power (Battery Connector) • Charging (USB) • Wireless (2. 4 GHz) • On-Board XBee Socket • XBee to USB adaptor (Explorer)

Wireless Programming • Preparation (for Explorer) Ø Short RTS and D 3 • X-CTU Configuration (Windows) 1. 2. 3. 4. 5. Connect Run X-CTU Set Computer Port (e. g. USB) Baudrate (57600, match u. C) Modem Configuration…

Parameter Programming Radio ID (PAN Hex) Fio Radio IDENTICAL BD (Microprocessor) 6 for (Atmega 328) MY (Source) (0000 to FFFF) DL (Destination) Programmer's MY value D 3 (Digital PIN 3) FFFF (ALL) My Value (Speecific) 3 (DI) IC (I/O Change Monitor) 8 (i. e. 00001000 or D 3) not set RR (Retries on Send) 3 not set IA (Serial Interrupt) FFFFFFFF (Immune) 0 x. FFFF (Modify Allow) 5 (DO HIGH)

Digital Joystick Versus Analog Joystick • Joystick types Ø Digital Joysticks Ø Analog Joysticks

Interfacing the Analog Joystick to the Arduino Fio • The diagram: 3. 3 v, VCC 10 bit input A 0 A 1 GND • The functionality X Y

Generation of PWM signal • 10 bit input /4 = (n*2^10)/(2^2)=(n*2^8)= PWM Ø Code: Analog. Read((10 bit input)/4) Analog. Write(pin#, direction) Analog. Write(pin#, PWM) ( PWM 0 -255, where 255 is 100% duty cycle) (0<=dir>=255)

Power Supply • How to choose a power supply for driving Brushless DC motor Ø AC-to-DC Power Supply Ø Supply Voltage Ø Parallel Connection of Motors Ø Rated Supply Current Mean Well 12 V 29 A Power Supply

H-Bridge • How does an H-Bridge work?

H-Bridge (Cont’d) • How do you pick an H-Bridge motor driver? Ø Voltage rating Ø Current rating Pololu 18 V 15 A Motor Driver

Brushless DC Motor Feedback • Position Ø Rotation count • Speed Ø Rotations Ø Time • Direction Ø Second sensor

Calculating Position - Simple • Rotations counting Ø Photo Interrupter Ø “Optical Chopper” • Pulses per rotation Ø Gear ratio • Single sensor Ø Direction ambiguous • Arduino Ø attach. Interrupt(pin, ISR, EDGE);

Position Calculation - Robust • Second Photo Interrupter • Sensor placement • Sensor reading • Direction 1 2 • Edge Detection • Arduino • digital. Read(pin);

Speed Calculation • Timing • Change between pulses • Angular Velocity • Two sensors • Arduino • millis() : d. Time = millis() – current. Time; • Rpm = 1/spoke. Count * 1/d. Time * 1/3600;

Summary

Questions?