1
Tilt Controlled Vehicle Hardware In this project, I utilized two CY3209-ExpressEVK kits and one CY3214 PSoCEval USB kit. Software The source code for the project was programmed in C using the PSoC Designer software, aided by PSoC Programmer (which was used to program the microprocessor) by Cypress. Abstract Robots are becoming a key part of our everyday lives. Whether for convenience, or for saving a life, robots serve purposes every single day. We have created a prototype for a new type of robot control mechanism that simplifies the task of maneuvering a robot through possibly dangerous locations. Conventional remote control systems are hard to use because they require using various knobs, joysticks and sliders. This system uses an accelerometer based controller that responds to tilts and hand movements. The two servos are wirelessly controlled to operate the movement of a small car. The wireless signals from an accelerometer are passed to a CY3209-ExpressEVK board and then are passed on by I2C to a CY3214 PSoCEval USB board. This board in turn transmits the signal to the servos, allowing the car to go forward, backward, left, or right, all controlled by a slight tilt. This project implements the technical aspects of the hardware and software, detail instructions for re-creating the remote control device, results of testing the new remote control device, and future implications of this Statement of Purpose To create a remote control car controlled by the tilt of an accelerometer. QuickTime™ and a decompressor are needed to see this picture. QuickTime™ and a decompressor are needed to see this picture. Q u i c k T i m e a n d a d e c o m p r e s s o r a r e n e e d e d t o s e e t h i s p i c t u r e . void drive(int motor, int velocity) { if (motor == 0) { positiveRangeL = params.maxL - params.medL; negativeRangeL = params.minL - params.medL; positiveStepL = positiveRangeL/10; negativeStepL = negativeRangeL/10; if (velocity < 0 ) { velocity *=-1; pulseWidth= params.medL + (negativeStepL * velocity); } else { pulseWidth= params.medL + (positiveStepL * velocity); } } else if (motor == 1) { positiveRangeR = params.maxR - params.medR; negativeRangeR = params.minR - params.medR; positiveStepR = positiveRangeR/10; negativeStepR = negativeRangeR/10; if (velocity < 0 ) { velocity *=-1; pulseWidth= params.medR + (positiveStepR * velocity); } else { pulseWidth= params.medR + (positiveStepR * velocity); } } } void main() { while (1) { x = flatten(i2cData.accelX); y = flatten (i2cData.accelY); if (x < 0){ leftPower = mag(y,x); rightPower = mag(y,-x); } else { leftPower = mag(y,-x); rightPower = mag(y,x); } } } Code Snippet CY3209-ExpressEVK CY3214-PSoCEval USB Procedures 1. Install PSoC Development Software (PSoC Designer, PSoC Programmer). 2. Create new system-level project named AccSlave. 3. Program Slave kit CY3209-ExpressEVK graphically to wirelessly send the X and Y outputs of its accelerometer to a Master board. 4. Create a new system-level project named AccMaster. 5. Program Master kit CY3209-ExpressEVK to receive X and Y input from Slave and to output X and Y values via I2C (be sure to set the sub addresses in the slave controller properties equal to the offset of the buffer values in which you want to write). 6. Create new chip-level project named Car. 7. Program CY3214 PSoCEval USB kit to write the received X and Y values from I2C into the variables of the buffer and to output 2 frequencies to the servo pins that are directly proportional to the X and Y values. 8. Attach 2 servos with wheels to the CY3214 PSoCEval USB. 9. Attach the signal operator wires to the frequency pins of the chip. 10. Attach the Vcc and Ground pins of the servos to power lines connected to a battery. 11. Connect Car with AccMaster with the I2C Project Goals & Guidelines The goal of this project is to incorporate and combine the skills we have attainted at COSMOS UCSD 2008 with our creative problem solving skills to create remote controlled vehicle controlled by the tilt of an accelerometer. Main vehicle (left), remote (right) Isaac Gutekunst Harry Levine Alex Mandel Isaac Gutekunst

Tilt Controlled Vehicle Hardware In this project, I utilized two CY3209-ExpressEVK kits and one CY3214 PSoCEval USB kit. Software The source code for the

Embed Size (px)

Citation preview

Page 1: Tilt Controlled Vehicle Hardware In this project, I utilized two CY3209-ExpressEVK kits and one CY3214 PSoCEval USB kit. Software The source code for the

Tilt Controlled VehicleHardware

In this project, I utilized two CY3209-ExpressEVK kits and one CY3214 PSoCEval USB kit.

SoftwareThe source code for the project was programmed in C using the PSoC Designer software, aided by PSoC Programmer (which was used to program the microprocessor) by Cypress.

AbstractRobots are becoming a key part of our everyday lives. Whether for convenience, or for saving a life, robots serve purposes every single day. We have created a prototype for a new type of robot control mechanism that simplifies the task of maneuvering a robot through possibly dangerous locations. Conventional remote control systems are hard to use because they require using various knobs, joysticks and sliders. This system uses an accelerometer based controller that responds to tilts and hand movements. The two servos are wirelessly controlled to operate the movement of a small car.  The wireless signals from an accelerometer are passed to a CY3209-ExpressEVK board and then are passed on by I2C to a CY3214 PSoCEval USB board.  This board in turn transmits the signal to the servos, allowing the car to go forward, backward, left, or right, all controlled by a slight tilt.  This project implements the technical aspects of the hardware and software, detail instructions for re-creating the remote control device, results of testing the new remote control device, and future implications of this technology.  With this new technology, wiggling a single finger can control the movement of a robot just as well as a conventional joystick, however it requires less concentration and skill than a conventional joystick, allowing the operator to concentrate on other aspects of controlling the robot.

Statement of PurposeTo create a remote control car controlled by the tilt of an accelerometer.

QuickTime™ and a decompressor

are needed to see this picture.

Qu

ickTim

e™

an

d a

de

com

pre

ssor

are

nee

de

d t

o s

ee t

his

pic

ture

.

Qu

ickTim

e™

an

d a

de

com

pre

ssor

are

need

ed

to s

ee

th

is p

ictu

re.

void drive(int motor, int velocity) {

if (motor == 0) {

positiveRangeL = params.maxL - params.medL;

negativeRangeL = params.minL - params.medL;

positiveStepL = positiveRangeL/10;

negativeStepL = negativeRangeL/10;

if (velocity < 0 ) {

velocity *=-1;

pulseWidth= params.medL + (negativeStepL * velocity);

} else {

pulseWidth= params.medL + (positiveStepL * velocity);

}

} else if (motor == 1) {

positiveRangeR = params.maxR - params.medR;

negativeRangeR = params.minR - params.medR;

positiveStepR = positiveRangeR/10;

negativeStepR = negativeRangeR/10;

if (velocity < 0 ) {

velocity *=-1;

pulseWidth= params.medR + (positiveStepR * velocity);

} else {

pulseWidth= params.medR + (positiveStepR * velocity);

}

}

}

void main() {

while (1) {

x = flatten(i2cData.accelX);

y = flatten (i2cData.accelY);

if (x < 0){

leftPower = mag(y,x);

rightPower = mag(y,-x);

} else {

leftPower = mag(y,-x);

rightPower = mag(y,x);

}}

}

Code Snippet

CY3209-ExpressEVK

CY3214-PSoCEval USB

Procedures1. Install PSoC Development Software (PSoC Designer, PSoC Programmer).2. Create new system-level project named AccSlave.3. Program Slave kit CY3209-ExpressEVK graphically to wirelessly send the X and Y outputs of its accelerometer to a Master board.4. Create a new system-level project named AccMaster.5. Program Master kit CY3209-ExpressEVK to receive X and Y input from Slave and to output X and Y values via I2C (be sure to set the sub addresses in the slave controller properties equal to the offset of the buffer values in which you want to write).6. Create new chip-level project named Car.7. Program CY3214 PSoCEval USB kit to write the received X and Y values from I2C into the variables of the buffer and to output 2 frequencies to the servo pins that are directly proportional to the X and Y values.8. Attach 2 servos with wheels to the CY3214 PSoCEval USB.9. Attach the signal operator wires to the frequency pins of the chip.10. Attach the Vcc and Ground pins of the servos to power lines connected to a battery.11. Connect Car with AccMaster with the I2C wires.12. Connect the voltage pin and the ground pin on the LCD port of the CY3209 board to the power and ground pins on the CY3214 board.13. Connect the battery to the holder of the CY3209 (feed through a switch if desired).

Project Goals & GuidelinesThe goal of this project is to incorporate and combine the skills we have attainted at COSMOS UCSD 2008 with our creative problem solving skills to create remote controlled vehicle controlled by the tilt of an accelerometer.

Main vehicle (left), remote (right)

Isaac Gutekunst

Harry LevineAlex Mandel

Isaac Gutekunst