Top Banner
Robo Car Upgrade Peter Busha 4/15/2014
21

Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

Dec 18, 2015

Download

Documents

Sharon Clark
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

Robo Car Upgrade

Peter Busha4/15/2014

Page 2: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

BackgroundOLimited Mobility

OMessy Connections

ONo Auto Power Switch

Page 3: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

ProposalModify the wired Robo car to include:

O Wireless Transceiver

O Custom circuit board

O Master Power Switch

O Three Sonic sensors

Wireless Transceiver

Motor Connections

Motor Driver Master Power Switch

Page 4: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

Wireless Transceiver

MCU

Joystick

LCD Screen

2.45mTo wall

Two way data transmission

Sonic Sensor

Wireless Transceiver

Page 5: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

Batt

ery

MotorDriver

Micro

Controller

Sonic Sensor

Wired Robo Car

Joystick Control

Page 6: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

Batt

ery

Master

Switch

WirelessTransceiv

er

Motor Driver

Micro Controller

Robo Car Upgrade

Son

ic Senso

r

Sonic SensorSonic

Sensor

Page 7: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.
Page 8: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.
Page 9: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

KL25Z MCU Robo Car

nRF24L01+Transmitter

nRF24L01+Receiver

KL25Z MCU Joystick

SPI Communication

SPI Communication

RF Communication

Page 10: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

SPI CommunicationO Serial Peripheral Interface (SPI)

O Four “Channels”

O SCLK, CSN or SS, MOSI, and MISO

O 8 bit packages

Page 11: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.
Page 12: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

nRF24L01+O 126 selectable channelsO 1.9 to 3.6V supply rangeO 26µA standby mode, 900 nA power

down mode.O Four output powers

0, -6, -12, or -18dBmO 1 to 32 bytes payload length

Page 13: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

nRF24L01+O Transmitter

O Reads result of two A to D 16 bit left justified numbers

O Breaks 16 bit numbers into bytes

O Stores bytes in an array called “payload”. Four arrays, two for vertical and two for horizontal movements.

O Transmits payload arrays

Page 14: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.
Page 15: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

/* 1 if we are the sender, 0 if we are the receiver */#define IS_SENDER 1

#define PAYLOAD_SIZE 16 /* number of payload bytes, 0 to 32 bytes */

#define CHANNEL_NO 50 /* communication channel */

Transmitter Setup

Page 16: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

30 ms to transmit payloads16 byte array. Only using first four bytes.

Pulse on MISO receive end

This is what a joystickmovement looks like

Page 17: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

//getting two results from A to D, horizontal and Vert as 16 bit left justified

Joystick_GetValue16(data); //breaking A to D to results into bytes

payload [0] = (byte)(data[0] / 256); payload [1] = (byte)(data[0] & 255);

payload [2] = (byte)(data[1] / 256); payload [3] = (byte)(data[1] & 255);

RF_TxPayload(payload, sizeof(payload)); /* send data */

Page 18: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

nRF24L01+O Receiver

O Receives the payload arrays

O Removes the contents of payload [0] as the vertical data and puts into variable Vert.

O Then removes the contents of payload [2] and puts data into variable Horz.

Page 19: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

if (status&RF_STATUS_RX_DR){ /* data received interrupt */ RF_RxPayload(payload, sizeof(payload)); /* will reset RX_DR bit */ RF_ResetStatusIRQ(RF_STATUS_RX_DR|RF_STATUS_TX_DS|RF_STATUS_MAX_RT); /* make sure we reset all flags. Need to have the pipe number too */ //Put Payload Data here Vert = payload[0]; Horz = payload[2];

Page 20: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

if(((Vert>=115)&(Vert<=140))&((Horz>=115)&(Horz <= 140))) {Move(0);}// in center zone car does not moveelse if(((Vert>=130)&(Horz >= 115))&((Horz<=140)))//To move forward Move(20);else if(((Vert<=115)&(Horz>=115))&((Horz<=140))) //To move Backwards Move(-20);else if(((Horz>=130)&(Vert>=115))&((Vert<=140))) //To move LeftTurnLeftFast(20);else if(((Horz<=115)&(Vert>= 115))&((Vert<=140)))//To move rightTurnRightFast(20);

Page 21: Robo Car Upgrade Peter Busha 4/15/2014. Background O Limited Mobility O Messy Connections O No Auto Power Switch.

Thank you!

Questions?