Go Down

Topic: Designing a joystick controlled soccer robot (Read 515 times) previous topic - next topic

darkestz

So basically what I'm working on is a robot with 2 high power wiper motors for the wheels, a low power motor for the ball kicking, a few zigbee's and wireless shields, arduino's and whatnot.

This is the modified joystick I have: http://tagisangrobotics.ph/dlds/Modified%20Joystick.pdf
And here is the stuff I have besides the motors: http://tagisangrobotics.ph/dlds/Basic%20Remote%20Controller%20System.pdf
Motor driver connection: http://tagisangrobotics.ph/dlds/Basic%20Motor%20Driver%20Connection%20V1.pdf
http://tagisangrobotics.ph/dlds/Basic%20Motor%20Driver%20Connection%20V2.pdf

We've written down the X and Y coordinates of front,back,left,right,upper left, upper right, lower left and lower right movements using the serial read feature on the arduino software. (where the robot will move depending on how we move the joystick)

Instead of the traditional 1 motor will go reverse while the other forward to make a turn, One motor will have to go at full speed and the other will have to go slower in order to turn.

Here are the tasks I need to accomplish, i dont really know how to go about it:

Motor Movement:
--> the function should accept 6 parameters, 3 for each motor.
--> the 1st parameter is for direction: FORWARD or BACKWARD.
--> the 2nd parameter is for time it is on: ONTIME
--> the 3rd parameter is for the speed setting: FAST or MEDIUM or SLOW.
the other three is for the other motor.
so the function may look like this.

Code: [Select]
void motorControl(dirMotor1, timeMotor1, speedMotor1,dirMotor2, timeMotor2, speedMotor2) {
// do the processing here.
};


And here is my other task: data for calling the function motorControl().
--> preprocess the raw data from serial to extract and compute the following:
1. direction of the motor based on joystick data
2. speed of the motor based on the button of the joystick
3. compute the ontime of the motor depending on the XY data of joystick.

i was told i can test my work can  by just typing on the serial monitor the expected raw data from joystick and printf the dirMotor1, timeMotor1, speedMotor1,dirMotor2, timeMotor2, speedMotor2 on the serial monitor.

Your help and input is highly appreciated and is needed ASAP. Thanks.

Msquare

Harassing with "Need answer ASAP" and reasking has a tendency to get you ignored.

So, you have a half finished program on the robot-arduino that receives serial data - right/wrong?
Could you post what that serial stream look like, ie. your Serial Monitor output? (How often or fast is it updated?)

What are your motor connections? Like, what digitalWrites/analogWrites do you issue to make a motor turn?
Can you write a small test program that just (as a test example) turns one motor on 5sec, off, then the other, then a little backwards... ? - post that.

And yes, I agree totally with
Quote
i was told i can test my work can  by just typing on the serial monitor the expected raw data from joystick and printf the dirMotor1, timeMotor1, speedMotor1,dirMotor2, timeMotor2, speedMotor2 on the serial monitor.
It assumes are you receiving data (via the Xbee) on other than the tx0/1 pins so the USB/serial monitor works.

zoomkat

This seems to be a somewhat complex project for an ASAP time frame. You need to break the project into individual parts and work on the parts until you get them to work. You may want to start with controlling the motors using an H-bridge.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

Go Up