48
Knightro Kart Liz Lyons Mike Scherban Oscar Orihuela

Knightro Kart

  • Upload
    kare

  • View
    73

  • Download
    0

Embed Size (px)

DESCRIPTION

Knightro Kart. Liz Lyons Mike Scherban Oscar Orihuela. 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 - PowerPoint PPT Presentation

Citation preview

PowerPoint Presentation

Knightro KartLiz LyonsMike ScherbanOscar Orihuela

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 tabletsConsists of two independent vehicles, a track utilizing infrared, and two independent remote controls

System Block Diagram

3Walkthrough

System SpecificationsBluetooth Communication Range1 hrNumber of Users2Remote ControlMobile device is used in landscape mode. It utilizes hardware level sensor data, and interprets it to tell the MSP430 how to direct the vehicle.

Why Android?Essentially free No new hardware costs, free SDK, familiar languagesOpen source platform, easy to learnProgramming LanguageDevices Readily Available?FamiliarityCost to DevelopAndroidJava/XMLYesHighFreeiOSObjective-CNoMedium$99/yearWindows Phone.NET framework/ Visual C++/XNANoLowFree

Target APIs 10 (Android 2.3.3 Gingerbread and higher), approximately 94.2% of Android market

Ice Cream SandwichJelly BeanEclairFroyoGingerbreadHoneycombTarget APIs 10 (Android 2.3.3 Gingerbread and higher), approximately 94.2% of Android market

Ice Cream SandwichJelly BeanEclairFroyoGingerbreadHoneycombWireless Communication ChoicesBluetooth (Class 2)Wi-Fi DirectWi-Fi (traditional)ProtocolLMP, L2CAP, SDPIEEE 802.11 a/g/nIEEE 802.11Communication DistanceRadio dependent, 10 meters min200 meters MAX200 meters MAXSpeed3 Mbps MAX250 Mbps MAX250 Mbps MAXAPI Requirement5 or higher14 or higher1 or higherPower2.5 mWVariesVaries, may be 40x BluetoothISM Band2.4 to 2.485 GHz2.4 GHz or 5 GHz

2.4 GHz or 5 GHzDifficultyLowHighHighRemote Control RequirementsAndroid device must:Have Bluetooth capabilityContain accelerometer sensorsHave touch screenRun Android 2.3.3 Gingerbread or newer OSUser Interface

Home screen displays current lap, accelerometer values, and connected devices (if any)

Menu allows user to control the state of the remote control applicationConnect A Device connect to a vehicleStart send signal to BT module signifying ready to raceReset Remote Control reset application variables, sever connectionsExit close the application and disconnect any active Bluetooth connections

User InterfaceWhen 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.

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 applicationConnect A Device connect to a vehicleStart send signal to BT module signifying ready to raceReset Remote Control reset application variables, sever connectionsExit close the application and disconnect any active Bluetooth connections

Handling AccelerometersAccelerometers 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

15Bit Assignment76543210LEFTRIGHTSPEED 4SPEED3SPEED2SPEED1STOPREVERSESpecial SignalsWAKEUP: 0xFFRESET: 0xBB

Bit Assignment76543210LEFTRIGHTSPEED 4SPEED3SPEED2SPEED1STOPREVERSEAction (Conditions)Left(YAccel < -2)Right(YAccel > 2)Straight(-2 < YAccel < 2)Speed 1(2 < ZAccel < 3.5)0x840x440x04Speed 2(3.5 < ZAccel < 4.5)0x880x480x08Speed 3(4.5 < ZAccel < 5.5)0x900x500x10Speed 4(5.5 < ZAccel)0xA00x600x20Reverse(ZAccel < -2)0x810x410x01Stopped(-2 < ZAccel < 2)0x820x420x02Bluetooth ModuleRoving Networks RN-41Minimal configurationBaud rateAuto slave, SPPBuilt in antennaAutomatically pushes & pulls data via UART RX/TX pinsRuns own Bluetooth stackLow power3.3V100m range

MicrocontrollerMSP430G2553Atmega168 w/ Arduino3.3V5V16KB flash16KB flashC, AssemblyC, Assembly16MHz16MHzUART & PWM supportUART & PWM support

2.752.75Bluetooth module runs at 3.3V as well19MicrocontrollerMSP430G25533.3V16KB flashC, Assembly16MHzUART & PWM support

Same voltage as Bluetooth moduleNo voltage level shiftingMore feature rich IDEViewable registersReal time setting/variable adjustmentDisassemblySW breakpointsG2553 variantHW UART supportBluetooth module runs at 3.3V as well20MicrocontrollerMSP430G2553 (28 pin TSSOP)Surface mount package

Function# of PinsUART2Start Line Signal1LEDs5Motors 4Start Alert Signal2Programming and DebuggingCode Composer Studio free licenseJTAG used to take advantage of IDE debugging featuresConnect through TI USB FET device to 14 pin header

Motor SignalsLEFT/RIGHT uses digital signalsFWD/REV take advantage of hardware PWM supportPWM used to add variable speed

Slow

Fast!Microcontroller Comm.MSP430Module: UART, 9600 baud rate, interrupts*TrackVehicle: Port interrupt*, debouncedVehicleVehicle: Watch for port low to high change

*Interrupts: To catch events when they happen, opposed to hanging code and waiting to catch themInterrupt code is ran regardless of which code is currently being executedLow Power ModeBluetooth module separate from MSP430Allows BT pairing while MSP430 is asleepMSP430 goes to sleep at power on and when not in race modeTurns off clocks and CPUCommand from phone will wake the car for useOnly executes code in an interruptExplain how sleep works!25MSP430 Software Flowchart

26Printed Circuit BoardMost components will be on a custom printed circuit board designed in Eagle

Printed Circuit Board

LEDsMSP430JTAGBT Module and status LEDsPowerMotorsReady signalsTrack signalInfrared FeaturesEach race vehicle contains IR phototransistorsBiased by IR lightSTART line consists of an array of IR LEDsTriggers phototransistors on vehicle, enables lap counterInfrared also used for vehicle to vehicle communication

Race Vehicle 9.6V battery packrequiredPotential to travel20 mph 2 D.C. motors1st Motor controlling FWD and REV motion2nd Motor controlling turning left and right 17 inches long7 inches wide8 inches tall

Motor OptionsRace car requires 2 motors1st Motor controls FWD & REV motion D.C. motor2nd Motor controls Turning - D.C. or Servo

D.C. MotorServo MotorLess ExpensiveMore ExpensiveRequires Less Voltage to functionRequires Higher Voltage to functionSlower Reaction TimeFaster Reaction TimeH-BridgeMSP430 does not have sufficient voltage to run motorsH-bridge directs secondary power supply to motorsHigh/low signals received by H-bridge cause motors to spin in a certain directionEx: Clockwise / Counter-Clockwise / Stand Still

H-Bridge - TypicalTypical H-Bridge configurationMotor represented by inner circleSwitches represent transistorsMotor is at a stand still

H-Bridge - ClockwiseThe H-bridgeis causing the D.C. motor to spinclockwise

H-Bridge Counter ClockwiseThe H-bridgeis causing the D.C. motor to spincounter clockwise

SN754410 vs. L298NSN754410L298NMax Motors2 DC motors2 DC motorMax Continuous Current1 Amp2 AmpVCC1 Supply Voltage Range3.3V - 5.5V4.5V 7VMax VCC2 Supply Voltage36V46V

Change LMD18200 for L298n!36SN754410Cost efficient : $2.16 per chipDetailed documentationManufacturer: Texas Instruments2Chips per car needed due to current restrictionsEach motor takes up to 1 Amp

SN754410 Pin Out

Car Interior Schematic

CoolingSN754410 includes built in thermal shutdownGenerates enough heat to trigger shutdownAluminum heat sinks added to prevent shutdownFans to assist in cooling

Add picture of heat sinks & vector board HERE!!!!!40Power SupplyInput VoltageVoltage RegulatorSN7544109V5VRace Car9.6VDoes Not Require MSP4309V3.3V

TestingHad LEDs light up at certain events.Connection successfulByte receivedOnce 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 phoneTested that the H-bridge received the correct logic and output the correct signals using a multimeter and motorsFinally tested that the car moved in accordance with the orientation of the phoneLED NotificationsMSP430 asleep.Awaiting wake upReady to race, waiting for other carRacing!Issues EncounteredUUID assignment varies based on device receiving connection, had to look for the UUID corresponding to hardware (not android devices)Surface mount devices smaller than anticipatedOverheating of the H-Bridge, heat sinks requiredSyncing vehicles to start at the same timeRoadblocksApp occasionally takes more than one attempt to make a connectionTrack LED spacing may be too large to trigger phototransistor 100% of the timeCars slow down after continuous usageHeat issue: heatsinks and fans multiplied the usage timeNeeds a few seconds to cool down and run at normal speedUnavoidable infrared light occasionally triggers phototransistors

What We Would Do DifferentlyFor a more successful project we could have combined headers on the PCB to make the wiring easier and less clutteredUse modulated infrared to prevent accidental triggers and allow outside usageUse an H-bridge that supports more current and heatExpenses To Date CostsPassive 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 Include Total47Questions?