48
Knightro Kart Liz Lyons Mike Scherban Oscar Orihuela

Liz Lyons Mike Scherban Oscar Orihuela. What Is Knightro Kart? An interactive, Android controlled vehicle race system consisting of two independent cars

Embed Size (px)

Citation preview

  • Slide 1
  • Liz Lyons Mike Scherban Oscar Orihuela
  • Slide 2
  • What Is Knightro Kart? An interactive, Android controlled vehicle race system consisting of two independent cars and controllers. Vehicles are controlled by Android powered mobile devices or tablets Consists of two independent vehicles, a track utilizing infrared, and two independent remote controls
  • Slide 3
  • System Block Diagram
  • Slide 4
  • Walkthrough
  • Slide 5
  • System Specifications Bluetooth Communication Range1 hr Number of Users2
  • Slide 6
  • Remote Control Mobile device is used in landscape mode. It utilizes hardware level sensor data, and interprets it to tell the MSP430 how to direct the vehicle.
  • Slide 7
  • Why Android? Essentially free No new hardware costs, free SDK, familiar languages Open source platform, easy to learn Programming Language Devices Readily Available? FamiliarityCost to Develop AndroidJava/XMLYesHighFree iOSObjective-CNoMedium$99/year Windows Phone.NET framework/ Visual C++/XNA NoLowFree
  • Slide 8
  • Target APIs 10 (Android 2.3.3 Gingerbread and higher), approximately 94.2% of Android market Ice Cream Sandwich Jelly Bean Eclair Froyo Gingerbread Honeycomb
  • Slide 9
  • Target APIs 10 (Android 2.3.3 Gingerbread and higher), approximately 94.2% of Android market Ice Cream Sandwich Jelly Bean Eclair Froyo Gingerbread Honeycomb
  • Slide 10
  • Wireless Communication Choices Bluetooth (Class 2) Wi-Fi DirectWi-Fi (traditional) ProtocolLMP, L2CAP, SDPIEEE 802.11 a/g/nIEEE 802.11 Communication Distance Radio dependent, 10 meters min 200 meters MAX Speed3 Mbps MAX250 Mbps MAX API Requirement5 or higher14 or higher1 or higher Power2.5 mWVariesVaries, may be 40x Bluetooth ISM Band2.4 to 2.485 GHz2.4 GHz or 5 GHz DifficultyLowHigh
  • Slide 11
  • Remote Control Requirements Android device must: Have Bluetooth capability Contain accelerometer sensors Have touch screen Run Android 2.3.3 Gingerbread or newer OS
  • Slide 12
  • User Interface Home screen displays current lap, accelerometer values, and connected devices (if any) Menu allows user to control the state of the remote control application Connect A Device connect to a vehicle Start send signal to BT module signifying ready to race Reset Remote Control reset application variables, sever connections Exit close the application and disconnect any active Bluetooth connections
  • Slide 13
  • User Interface When user selects Connect a Device from the menu they are presented with a list of paired devices. User can also search for unpaired, discoverable devices in the area If connection is successful, the name of the connected device will be displayed on the main remote control screen.
  • Slide 14
  • User Interface Home screen displays current lap, accelerometer values, and connected devices (if any) Menu allows user to control the state of the remote control application Connect A Device connect to a vehicle Start send signal to BT module signifying ready to race Reset Remote Control reset application variables, sever connections Exit close the application and disconnect any active Bluetooth connections
  • Slide 15
  • Handling Accelerometers Accelerometers are seen by the devices relative to an imagined coordinate system. We use the Y (left/right) and Z (forward/back) axis values to control the cars
  • Slide 16
  • Bit Assignment 76543210 LEFTRIGHTSPEED 4SPEED3SPEED2SPEED1STOPREVERSE Special Signals WAKEUP: 0xFF RESET: 0xBB
  • Slide 17
  • Bit Assignment 76543210 LEFTRIGHTSPEED 4SPEED3SPEED2SPEED1STOPREVERSE Action (Conditions) Left (YAccel < -2) Right (YAccel > 2) Straight (-2 < YAccel < 2) Speed 1 (2 < ZAccel < 3.5) 0x840x440x04 Speed 2 (3.5 < ZAccel < 4.5) 0x880x480x08 Speed 3 (4.5 < ZAccel < 5.5) 0x900x500x10 Speed 4 (5.5 < ZAccel) 0xA00x600x20 Reverse (ZAccel < -2) 0x810x410x01 Stopped (-2 < ZAccel < 2) 0x820x420x02
  • Slide 18
  • Bluetooth Module Roving Networks RN-41 Minimal configuration Baud rate Auto slave, SPP Built in antenna Automatically pushes & pulls data via UART RX/TX pins Runs own Bluetooth stack Low power 3.3V 100m range
  • Slide 19
  • Microcontroller MSP430G2553Atmega168 w/ Arduino 3.3V5V 16KB flash C, Assembly 16MHz UART & PWM support 2.75
  • Slide 20
  • Microcontroller MSP430G2553 3.3V 16KB flash C, Assembly 16MHz UART & PWM support Same voltage as Bluetooth module No voltage level shifting More feature rich IDE Viewable registers Real time setting/variable adjustment Disassembly SW breakpoints G2553 variant HW UART support
  • Slide 21
  • Microcontroller MSP430G2553 (28 pin TSSOP) Surface mount package Function# of Pins UART2 Start Line Signal1 LEDs5 Motors4 Start Alert Signal2
  • Slide 22
  • Programming and Debugging Code Composer Studio free license JTAG used to take advantage of IDE debugging features Connect through TI USB FET device to 14 pin header
  • Slide 23
  • Motor Signals LEFT/RIGHT uses digital signals FWD/REV take advantage of hardware PWM support PWM used to add variable speed Slow Fast!
  • Slide 24
  • Microcontroller Comm. MSP430 Module: UART, 9600 baud rate, interrupts* Track Vehicle: Port interrupt*, debounced Vehicle Vehicle: Watch for port low to high change *Interrupts: To catch events when they happen, opposed to hanging code and waiting to catch them Interrupt code is ran regardless of which code is currently being executed
  • Slide 25
  • Low Power Mode Bluetooth module separate from MSP430 Allows BT pairing while MSP430 is asleep MSP430 goes to sleep at power on and when not in race mode Turns off clocks and CPU Command from phone will wake the car for use Only executes code in an interrupt
  • Slide 26
  • MSP430 Software Flowchart
  • Slide 27
  • Printed Circuit Board Most components will be on a custom printed circuit board designed in Eagle
  • Slide 28
  • Printed Circuit Board LEDs MSP430 JTAG BT Module and status LEDs Power Motors Ready signals Track signal
  • Slide 29
  • Infrared Features Each race vehicle contains IR phototransistors Biased by IR light START line consists of an array of IR LEDs Triggers phototransistors on vehicle, enables lap counter Infrared also used for vehicle to vehicle communication
  • Slide 30
  • Race Vehicle 9.6V battery pack required Potential to travel 20 mph 2 D.C. motors 1 st Motor controlling FWD and REV motion 2 nd Motor controlling turning left and right 17 inches long 7 inches wide 8 inches tall
  • Slide 31
  • Motor Options Race car requires 2 motors 1 st Motor controls FWD & REV motion D.C. motor 2 nd Motor controls Turning - D.C. or Servo D.C. MotorServo Motor Less ExpensiveMore Expensive Requires Less Voltage to function Requires Higher Voltage to function Slower Reaction TimeFaster Reaction Time
  • Slide 32
  • H-Bridge MSP430 does not have sufficient voltage to run motors H-bridge directs secondary power supply to motors High/low signals received by H-bridge cause motors to spin in a certain direction Ex: Clockwise / Counter-Clockwise / Stand Still
  • Slide 33
  • H-Bridge - Typical Typical H-Bridge configuration Motor represented by inner circle Switches represent transistors Motor is at a stand still
  • Slide 34
  • H-Bridge - Clockwise The H-bridge is causing the D.C. motor to spin clockwise
  • Slide 35
  • H-Bridge Counter Clockwise The H-bridge is causing the D.C. motor to spin counter clockwise
  • Slide 36
  • SN754410 vs. L298N SN754410L298N Max Motors2 DC motors2 DC motor Max Continuous Current 1 Amp2 Amp VCC1 Supply Voltage Range 3.3V - 5.5V4.5V 7V Max VCC2 Supply Voltage 36V46V
  • Slide 37
  • SN754410 Cost efficient : $2.16 per chip Detailed documentation Manufacturer: Texas Instruments 2Chips per car needed due to current restrictions Each motor takes up to 1 Amp
  • Slide 38
  • SN754410 Pin Out
  • Slide 39
  • Car Interior Schematic
  • Slide 40
  • Cooling SN754410 includes built in thermal shutdown Generates enough heat to trigger shutdown Aluminum heat sinks added to prevent shutdown Fans to assist in cooling
  • Slide 41
  • Power Supply Input Voltage Voltage Regulator SN7544109V5V Race Car9.6VDoes Not Require MSP4309V3.3V
  • Slide 42
  • Testing Had LEDs light up at certain events. Connection successful Byte received Once we knew communication was successful, we tested with LEDs, SW breakpoints, and the register viewer to confirm correct bytes. LEDs were used to confirm the correct motor output from PCB, using the tilt of the phone Tested that the H-bridge received the correct logic and output the correct signals using a multimeter and motors Finally tested that the car moved in accordance with the orientation of the phone
  • Slide 43
  • LED Notifications MSP430 asleep. Awaiting wake up Ready to race, waiting for other car Racing!
  • Slide 44
  • Issues Encountered UUID assignment varies based on device receiving connection, had to look for the UUID corresponding to hardware (not android devices) Surface mount devices smaller than anticipated Overheating of the H-Bridge, heat sinks required Syncing vehicles to start at the same time
  • Slide 45
  • Roadblocks App occasionally takes more than one attempt to make a connection Track LED spacing may be too large to trigger phototransistor 100% of the time Cars slow down after continuous usage Heat issue: heatsinks and fans multiplied the usage time Needs a few seconds to cool down and run at normal speed Unavoidable infrared light occasionally triggers phototransistors
  • Slide 46
  • What We Would Do Differently For a more successful project we could have combined headers on the PCB to make the wiring easier and less cluttered Use modulated infrared to prevent accidental triggers and allow outside usage Use an H-bridge that supports more current and heat
  • Slide 47
  • Expenses To Date Costs Passive Comonents $ 20.00 RC Vehicles $ 102.00 PCBs $ 45.00 Remote Control $ - MSP430s $ 6.00 Photo Transistors $ 2.00 IR Lights $ 5.00 H-Bridge Chip $ 8.00 Bluetooth Modules $ 50.00 JTAG Programmer $ 100.00 Batteries $ 10.00 Wood For Track $ 8.00 Fans $ 28.00 Aluminum Heatsinks $ 6.00 Wiring and Cabling $ 20.00 Total: $ 410.00
  • Slide 48
  • Questions?