Go to Post To label hard work as unfair is really a bitter assessment. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-05-2005, 15:06
mattsavela mattsavela is offline
Registered User
FRC #0255
 
Join Date: May 2005
Location: Lamphere
Posts: 12
mattsavela is an unknown quantity at this point
Re: One Joystick Drive

I attached my userroutines.c file
  #2   Spotlight this post!  
Unread 11-05-2005, 16:01
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,808
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: One Joystick Drive

A couple of simple issues.
  • The code for joystick control is in the Default_Routine() a few lines below the Process_Data_From_Master_uP routine(). The 1-Joystick code starts there on line 226 (in the version I attached). (In MPLAB look under Edit -> Properties and check "line numbers" if you don't already see them.)
  • There was a ". . ." in my example above that isn't code and needs to be removed (sorry about that).
  • Set both the MOTOR_CORRECTION's to zero to begin with. You'll only need to adjust those values if the operator cannot manually correct for the robot pulling to one side or the other. I don't know how hard it will be for your operator to see the robot underwater.
  • Make sure your drive motor pwms are connected to pwm 13 (right motor) and pwm 15 (left motor).
I've attached a modified version, so you can see what I meant.
the new code is at lines 204-205 and 239-255.
What you wrote originally will actually work, but would be confusing to anyone reading the code, because it does all the joystick work in Default_Routine() then overrides it all in Process_Data_From_Master_uP().

Anyone else have comments to add?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 11-05-2005 at 16:33.
  #3   Spotlight this post!  
Unread 11-05-2005, 23:25
mattsavela mattsavela is offline
Registered User
FRC #0255
 
Join Date: May 2005
Location: Lamphere
Posts: 12
mattsavela is an unknown quantity at this point
Re: One Joystick Drive

We have cameras attached to our robot, so we can't actually see our robot, but we can see from certain perspectives.

Thank you guys so much for helping me with this.
  #4   Spotlight this post!  
Unread 12-05-2005, 08:36
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,808
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: One Joystick Drive

We'd like to see photos and hear about your progress, so don't forget about us here on the ChiefDelphi forums.

Good Luck!
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #5   Spotlight this post!  
Unread 12-05-2005, 17:37
mattsavela mattsavela is offline
Registered User
FRC #0255
 
Join Date: May 2005
Location: Lamphere
Posts: 12
mattsavela is an unknown quantity at this point
Re: One Joystick Drive

We have an online album of pictures. I'll check with our coach to make sure that I can give the link out.
  #6   Spotlight this post!  
Unread 13-05-2005, 16:20
mattsavela mattsavela is offline
Registered User
FRC #0255
 
Join Date: May 2005
Location: Lamphere
Posts: 12
mattsavela is an unknown quantity at this point
Re: One Joystick Drive

http://photobucket.com/albums/v660/lhsrobotics/
http://photobucket.com/albums/y205/lhsrobotics1/


Those are the two links to our photo albums.

Last edited by mattsavela : 13-05-2005 at 16:24.
  #7   Spotlight this post!  
Unread 13-05-2005, 23:35
N7UJJ N7UJJ is offline
Teacher
AKA: Allan Cameron
FRC #5465 (BinaryBots)
Team Role: Teacher
 
Join Date: Jan 2004
Rookie Year: 2002
Location: Phoenix, AZ
Posts: 253
N7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond repute
Re: One Joystick Drive

I assume you are going to the MATE championship in Houston.
If so be sure to look for us. We also use the FRIST controller equipment on our ROV except we put the robot controller and the battery on the ROV. It allows us to use a small diameter tether which really helps the maneuverability.

Looking forward to meeting y'all

Allan
  #8   Spotlight this post!  
Unread 13-05-2005, 23:49
mattsavela mattsavela is offline
Registered User
FRC #0255
 
Join Date: May 2005
Location: Lamphere
Posts: 12
mattsavela is an unknown quantity at this point
Re: One Joystick Drive

Yeah. We are going to the MATE competition in Houston. Our team saw some pictures of your team's robot (not sure what year), but it was in one of your past tech reports. It looked excellent.
  #9   Spotlight this post!  
Unread 18-05-2005, 19:57
mattsavela mattsavela is offline
Registered User
FRC #0255
 
Join Date: May 2005
Location: Lamphere
Posts: 12
mattsavela is an unknown quantity at this point
Re: One Joystick Drive

We finally got a chance to test our robot in the pool. The robot worked fine going forwards, and turning. However, when we pull our joystick backwards, the robot goes forward, and when we push the joystick forward, our robot goes backwards. Is there a way you guys can help me fix that? Also, our robot does not goes very fast when it is moving backwards, but moves at a good speed when it goes forwards. Is there a way to make it so that when we go backwards, it goes the same speed as it goes when going forwards?

Thanks
  #10   Spotlight this post!  
Unread 19-05-2005, 05:32
N7UJJ N7UJJ is offline
Teacher
AKA: Allan Cameron
FRC #5465 (BinaryBots)
Team Role: Teacher
 
Join Date: Jan 2004
Rookie Year: 2002
Location: Phoenix, AZ
Posts: 253
N7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond reputeN7UJJ has a reputation beyond repute
Re: One Joystick Drive

Quote:
Originally Posted by mattsavela
We finally got a chance to test our robot in the pool. The robot worked fine going forwards, and turning. However, when we pull our joystick backwards, the robot goes forward, and when we push the joystick forward, our robot goes backwards. Is there a way you guys can help me fix that? Also, our robot does not goes very fast when it is moving backwards, but moves at a good speed when it goes forwards. Is there a way to make it so that when we go backwards, it goes the same speed as it goes when going forwards?

Thanks
There are two solutions to the forward/backward problem:

1. transpose the wires from the motor speed controller that go to the motor by switching the M+ and M- wires. (I think this is the best solution)
OR
2. in the code, add pwm01 = 255 - pwm01;
pwm02 = 255 - pwm02; // put after any other assignments to pwm01. (I used PWM01 Ind 02, but of course, use the pwm## that the motors use

As for the different speeds, there can be three solutions:
1. calibrate the motor speed controllers
2. in the code,use a lookup table or a function so that the p1_y goes from 0 - 255
3, It may be the motors, They just may go faster in one direction or its the water flowing more efficiently in one direction that the other. Not much you could do about that.

Fix the direction problem first and test in the water. Maybe the speed problem will go away or not be so noticeable.

Let me know what happens

Allan
  #11   Spotlight this post!  
Unread 19-05-2005, 21:28
mattsavela mattsavela is offline
Registered User
FRC #0255
 
Join Date: May 2005
Location: Lamphere
Posts: 12
mattsavela is an unknown quantity at this point
Re: One Joystick Drive

Thanks a lot. We gonna test our robot again in the pool tomorrow. I'll try changing the cords. Also, do you think that someone could add the part Allan suggested into our user routines.c file (I uploaded it). I would really appreciate it because I am new to programming. I'm going to add everyone who helped to our acknowledgements section of our teams tech report.

Thanks a lot
Attached Files
File Type: c user_routines.c (14.4 KB, 10 views)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
If you could change one thing.... Koko Ed General Forum 48 31-03-2005 19:23
1 Joystick Drive or yaniv Programming 3 19-01-2005 14:18
Changing 1 joystick code to 2 (rookie team) Brawler006 Programming 5 20-02-2004 17:00
question about one joystick drive programing james700 Programming 13 29-01-2003 14:49
1 joystick drive Rickertsen2 Robotics Education and Curriculum 9 20-12-2002 20:00


All times are GMT -5. The time now is 04:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi