Go to Post I thought we agreed to just put up a teaser, not a picture of the robot! - IBdrummer [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 23-01-2002, 17:14
punarhero's Avatar
Happy Birthday! punarhero punarhero is offline
Registered User
#0696 (Clark Magnet Robotics)
Team Role: Programmer
 
Join Date: Jan 2002
Location: la crescenta
Posts: 67
punarhero is an unknown quantity at this point
Send a message via AIM to punarhero Send a message via Yahoo to punarhero
speed control

Hi,
I am so happy that because of this forum, i've got my robot controller running. I still have a question though:

Last year whoever programmed our robot didn't leave the code, so I don't have it. Anyway, last year, our joysticks worked like this:
If u just move the right joystick forward, the robot moved in an arc towards left, and If u just move the left joystick forward, the robot moved in an arc towards right. That means moving left joystick alone moved the left motor faster than the right motor, but the right motor still moved. When we moved both joysticks forward or backword, the robot moved in a straight line forward or backward.

I just want to know what I should do to the default code, so that if I move one joystick forward alone, it moves that side motor faster than the other side motor, and also how can I control the speed of both motor

Sorry for boring u with my long story, but I need this info to work with my motors
Thanx
  #2   Spotlight this post!  
Unread 23-01-2002, 17:50
thedillybar thedillybar is offline
Registered User
#0894 (Chargers)
 
Join Date: Jan 2002
Location: Flint, MI
Posts: 56
thedillybar is an unknown quantity at this point
Send a message via AIM to thedillybar
Many teams use the "tank drive" control system for their robot. I believe the default code is pretty much already set up for this. Set PWM1 equal to the y-axis of the left joystick and PWM2 equal to the y-axis of the right joystick. Put PWM1 on the motor driving the left side and PWM2 on the motor driving the right side.

When you want to turn left gradually, push the left joystick farther forward than the right. If you want to spin around with an almost 0 degree turning radius, push the left stick all the way forward and the right stick all the way backward.

The programming isn't very difficult, if you need help with the exact code let me know and I (or someone else) can help you. Driver practice is the key. It takes a while to get used to it.
  #3   Spotlight this post!  
Unread 23-01-2002, 20:15
Kit Gerhart's Avatar
Kit Gerhart Kit Gerhart is offline
Mentor, coach, whatever--
FRC #0233 ("The Pink Team")
Team Role: Mentor
 
Join Date: Nov 2001
Rookie Year: 1996
Location: Cape Canaveral, FL USA
Posts: 559
Kit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond reputeKit Gerhart has a reputation beyond repute
Send a message via AIM to Kit Gerhart
Unless something has changed this year, The default has the two sticks completely independant of each other. If you move the right stick forward, the right motor(s) run forward and the left motor(s) do nothing, etc.
__________________
Team 45, TechnoKats, 1996-2002
Team 1062, The Storm, 2003
Team 233, "The Pink Team," 2004-present

The views I express here are mine, and mine alone, not those of my team, FIRST, or my previous teams.
  #4   Spotlight this post!  
Unread 23-01-2002, 20:51
Jnadke Jnadke is offline
Go Badgers!
#0093
Team Role: Alumni
 
Join Date: Jan 2002
Location: Appleton, WI
Posts: 775
Jnadke is on a distinguished road
Send a message via ICQ to Jnadke Send a message via AIM to Jnadke Send a message via Yahoo to Jnadke
Quote:
Originally posted by Kit Gerhart
Unless something has changed this year, The default has the two sticks completely independant of each other. If you move the right stick forward, the right motor(s) run forward and the left motor(s) do nothing, etc.

Other than the fact that the speed controllers have a built in dead zone apparently (says in the team update).
  #5   Spotlight this post!  
Unread 23-01-2002, 22:23
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
The victors have always (and still do) have a zone (from 117 to 137) where no output to the motors is made. This allows the somewhat imprecise joystick to go to neutral position, where they may or may not put out 127, and still let the motor go off and not draw current.

You are probably confusing the 883 victors which were used in the past and which you got this year, too, with the very new 884, which you didn't get in the kit, but may have seen on the Ifirst website.

The 884's only difference with what has gone before is that the response to 138 is now a near zero output, whereas with the 883, the response is 10% output. For 883 and 884 alike 136 gives zero output. Same for going from 118 to 116.
  #6   Spotlight this post!  
Unread 23-01-2002, 23:24
iscrc2 iscrc2 is offline
Registered User
#0568 (Nerds of the North)
 
Join Date: Jan 2002
Location: Anchorage, Alaska
Posts: 28
iscrc2 is an unknown quantity at this point
The innovationfirst web site has a sample 'tank drive' code thats great to start with its at

tank drive

Its a good idea to look around their site at http://www.innovationfirst.com
  #7   Spotlight this post!  
Unread 24-01-2002, 00:35
punarhero's Avatar
Happy Birthday! punarhero punarhero is offline
Registered User
#0696 (Clark Magnet Robotics)
Team Role: Programmer
 
Join Date: Jan 2002
Location: la crescenta
Posts: 67
punarhero is an unknown quantity at this point
Send a message via AIM to punarhero Send a message via Yahoo to punarhero
BUT WAIT...

last year on our robot, if we moved left joystick forward alone, the robot moved in an arc towards the right, but u say that each joystick is independent of each other. How is that?

I AM A LITTLE confused
  #8   Spotlight this post!  
Unread 24-01-2002, 00:58
Jordan A.'s Avatar
Jordan A. Jordan A. is offline
Registered User
#0781 (Kinetic Knights)
 
Join Date: Dec 2001
Location: Kincardine, Ontario
Posts: 145
Jordan A. is an unknown quantity at this point
Send a message via ICQ to Jordan A.
Umm its hard to explain I guess.

By only moving your left joystick you only rotate your left motor.

So since the right isnt moving it becomes the pivot.

The more you move the left the quicker it goes around that pivot.

Now if you were to move the right joystick forward you would plac the pivot farther and farther from the robot until you are going straight.

Ever had a fast trax RC car?
  #9   Spotlight this post!  
Unread 24-01-2002, 08:12
MattB703 MattB703 is offline
Registered User
AKA: Matt
None #0703 (Team Pheonix)
Team Role: Engineer
 
Join Date: Oct 2001
Rookie Year: 1998
Location: Saginaw, MI
Posts: 233
MattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud ofMattB703 has much to be proud of
Cool Let me take a shot at this

Let's see

I read your post a couple times and I don't think all of the people who responded understand the question. Or maybe I don't.

I think what you are saying is that when you moved the right joystick to full it made the left motor go full forward but ALSO made the right motor move at a lesser level. Thi should not be that hard to code.

Set the left motor value to the value of the right joystick plus the value of the right joystick multiplied by some gain (maybe 1/2). Since you can't use 1/2 you will probably need to get tricky like multiply by 100 amd divide by 200.

Don't forget to add "MIN 254" to the end of the line that you are defining the motor output variable. This will keep the value from wrapping around to 0.

Alot of you guys out there know a lot more about this stuff than e. Did I miss much?

Matt B.
  #10   Spotlight this post!  
Unread 24-01-2002, 15:59
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Crossed wires...

Punarhero,

Are you satisfied or do you need more info?

Joe J.

P.S. I think that your robot was just plain wired wrong last year. The more natural way for robots to drive tank style is for the right joystick to give gas to the right motor and the left to give gas to the left. It seems to me that your robot last year had it wired right to left and left to right. It is a testament to the human brain that your drivers could drive it at all. By the way, all you have to do to fix it is switch the PWM cables around -- no coding needed. JJ
  #11   Spotlight this post!  
Unread 24-01-2002, 16:12
punarhero's Avatar
Happy Birthday! punarhero punarhero is offline
Registered User
#0696 (Clark Magnet Robotics)
Team Role: Programmer
 
Join Date: Jan 2002
Location: la crescenta
Posts: 67
punarhero is an unknown quantity at this point
Send a message via AIM to punarhero Send a message via Yahoo to punarhero
i want to change speed

But how can I change the rate at which the motor accelerates. For example, I need to move the joystick almost all the way forward to make the motor run at its max. speed. What if I want the motor to get to its max speed only half-way on the joystick.

I tried writing a loop for it like so:

FOR pi_y=127 TO 254
p1_y=P1_y*2

I was hoping to make the motor go accelerate at double rate than before, but when I run it, the motor started running at full speed aytomatically, I couldn't control it from the joystick anymore.

So, what modifications or additions should I make to my program to control the acceleration of the motor
  #12   Spotlight this post!  
Unread 24-01-2002, 18:03
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
SQR can help you...

You can use the following to scale up or scale down your joysticks

Value = Sqr (Value) << 4

and

Value = Value* Value >> 8

Both transformations give you 0=>0 and 256=>256 but what happens in between is either concave or convex.

Try it out.

You will have to modify code I gave already to put the squaring or squareroot in the right place.

It should not be to hard to noodle out.

Basically it only works on positive values (just like the scaling only works on positive values) so you have to make sure whatever you are scaling is positive before you apply the operation.

Good luck.

Joe J.

P.S. This method of shifting was first introduced to me by Sister Mary Katherine at my highschool. Sister was a wonderful woman but not a wiz when it came to math. Her method of curving an exam was to either take the square root of a raw test score and then multiply it by 10 if the exam was too hard or to take the score, square it and then divide by 100 if it was too easy. She had no idea why it worked and didn't care. I puzzled about it for quite a while. Now I share it with you, generalized for base 16. JJ
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
switch speed control wayne 05 Programming 6 01-10-2003 09:35
Need a FIRST Robotics control system kershawrobotics General Forum 3 07-07-2003 09:49
Power, speed, and torque... AGH Gui Cavalcanti Technical Discussion 5 10-11-2002 19:02
more control options smokescreen Technical Discussion 17 05-03-2002 15:41
Prgm4 2 joystics control 1 speed cntrl??? punarhero Programming 7 21-02-2002 09:57


All times are GMT -5. The time now is 00:14.

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