Go to Post Woody says that gracious professionalism is "acting how you would if you grandmother was watching you"... some people must have some really crazy grandmothers. (: - Cappeh [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

 
View Poll Results: How Do i Program The speed Of Each Wheel
you may post new threads 5 83.33%
you may post replies 5 83.33%
you may post attachments 4 66.67%
you may edit your posts 4 66.67%
Multiple Choice Poll. Voters: 6. You may not vote on this poll

Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-01-2003, 18:30
Kyle1010 Kyle1010 is offline
Registered User
#0557 (Flaming Cardinals)
 
Join Date: Jan 2003
Location: Detroit,Michigan
Posts: 2
Kyle1010 is an unknown quantity at this point
Send a message via AIM to Kyle1010
How Do I Program My RC To Spot One wheel From Going faster than the other

We Have A Tank style drive and i would like to know how do i stop our left wheel from going faster than the right by using a codde in the program. Im New so any advice would help thanx in advance
  #2   Spotlight this post!  
Unread 09-01-2003, 18:54
Noah's Avatar
Noah Noah is offline
Code Monkey
#0861 (The Gondobots)
Team Role: Programmer
 
Join Date: Apr 2002
Location: Venice, California
Posts: 139
Noah has a spectacular aura aboutNoah has a spectacular aura about
Send a message via AIM to Noah
You might try something like

if RgtMtr > 127 then LftMtr = LftMtr MAX RgtMtr
' If right motor is forward then limit left motors speed to right motors speed.
if RgtMtr < 127 then LftMtr = LftMtr MIN RgtMtr
' If right motor is reverse then limit left motors speed to right motors speed.


Note: This is PBASIC 2.5. It will not run with the 2.0 stamp programmer.

If you need help understanding this, PM me.
__________________
"It's broken? NOOAAHH!!! This is your doing, isn't it!"

"We can fix it in the software!"
"It's a BROKEN GEAR!"
  #3   Spotlight this post!  
Unread 11-01-2003, 15:37
Jeff McCune's Avatar
Jeff McCune Jeff McCune is offline
Alpha Geek
#0677 (The Wirestrippers)
Team Role: Mentor
 
Join Date: Jan 2003
Location: The Ohio State University
Posts: 67
Jeff McCune is on a distinguished road
Send a message via ICQ to Jeff McCune Send a message via AIM to Jeff McCune
Unfortunately, motors aren't perfect nor identical. I assume you're having a problem along the lines of, "I drive both motors at 254, but the left side is moving faster."

This can be solved by using some constants at the top of your code and calibrating your drive train through experimentation. Try using the USER MODE on the OI to display the value being sent to one of the motors, and then tweak it until both sides are spinning the same. Then, take that offset and incorporate it into your drive subroutine.
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu

...And all you touch and all you see
Is all your life will ever be...
  #4   Spotlight this post!  
Unread 12-01-2003, 13:45
Kai Zhao Kai Zhao is offline
Registered User
#0686 (Bovine Intervention)
 
Join Date: Nov 2001
Location: Frederick, MD
Posts: 28
Kai Zhao is on a distinguished road
Send a message via AIM to Kai Zhao
Kinda complex answer

This is a cut and paste job from our code last year. Thanks to Joe Johnson for giving us parts of the following code in New York two years ago when our drive system was horrible.

Just as a note, all of the numbers are in hexadecimal and shifting by X = dividing by 2^x. If you have no idea what I'm talking about, email me (or reply) and I'll explain. Sorry for the really obfuscated code, you'll probably want some free time to analyze it fully.

Alan's Highly Scalable/Complex Speed Balancer -- (MESSAGE FROM ALAN: I don't understand either ) If you are not him, here is my (Kai's) explanation.

First we must seperate the code into three easy to digest portions '"((abs(PWM1-$80)" gets us the distance we are trying to travel from neutral, the answer will be signed then we multiply that answer by "(13 + (3 * ((PWM1 - $80)) >> 15 )) >> 4 )". If we are going forward, we get a zero from "(3 * ((PWM1 - $80)) >> 15 )", if we are going reverse, we get a 3.

The number we get out of that (0 or 3) is added to 13 which is then multiplied to the desired speed (NOT velocity).

After multiplying by either 13 or 16, we shift by 4 which is effectively dividing by 16. Therefore, we lower (by 13/16) the speed is the motor is going forward and keep it the same if we are going in reverse.

The last step of "* (1 - ((PWM1 - $80) >> 15 << 1)) + $80) MIN $24 MAX $DE" allows us add direction into speed and make it work.

We are using this equation as the example: "PWM1 = ((abs (PWM1 - $80) * (13 + (3 * ((PWM1 - $80)) >> 15 )) >> 4 ) * (1 - ((PWM1 - $80) >> 15 << 1)) + $80) MIN $24 MAX $DE"

If we need to change the ratio, we need to find denominator which is a power of 2. Now we need the numerator and we need to find the difference between the numerator and denominator.

([numerator] + ([numerator - denominator] * ((PWM1 - $80)) >> 15 )) >> [denominator who is a integer power of 2 (ex. 2,4,8,16,32,64,etc)] )

Code:
PWM1 = (((abs (PWM1 - $80) * (13 + (3 * ((PWM1 - $80) >> 15)))) >> 4 ) * (1 - ((PWM1 - $80) >> 15 << 1)) + $80) MIN $24 MAX $DE
PWM2 = (((abs (PWM2 - $80) * (13 + (3 * ((PWM2 - $80) >> 15)))) >> 4 ) * (1 - ((PWM2 - $80) >> 15 << 1)) + $80) MIN $24 MAX $DE
-Kai Zhao

Last edited by Kai Zhao : 12-01-2003 at 19:19.
  #5   Spotlight this post!  
Unread 12-01-2003, 14:40
Mwilber Mwilber is offline
Registered User
#0957 (Mechanical Menace)
 
Join Date: Jan 2003
Location: Albany, OR
Posts: 1
Mwilber is an unknown quantity at this point
Send a message via AIM to Mwilber
Callibration

If you haven't already load up dashboard and make sure your joysticks are callibrated correctly then duct tape those dials in place. This same thing happened to us and we spent a few hours trying to program around it and found out that with the dashboard it tells you the numerical value of the location of your joystick (.i.e it would display it at 127/127 when in the middle)
  #6   Spotlight this post!  
Unread 12-01-2003, 15:30
Bduggan04's Avatar
Bduggan04 Bduggan04 is offline
I bent my wookie...
AKA: Bryan Duggan
#0027 (Team Rush)
Team Role: College Student
 
Join Date: Mar 2002
Location: Clarkston, MI
Posts: 290
Bduggan04 will become famous soon enoughBduggan04 will become famous soon enough
Re: Callibration

Quote:
Originally posted by Mwilber
If you haven't already load up dashboard and make sure your joysticks are callibrated correctly then duct tape those dials in place. This same thing happened to us and we spent a few hours trying to program around it and found out that with the dashboard it tells you the numerical value of the location of your joystick (.i.e it would display it at 127/127 when in the middle)
You can also use the indicators on the OI to show when the joysticks are zeroed (at 127). This lets you quickly adjust it while the robot is disabled.

Also, you could use the yaw rate sensor (gyro) to correct the robot's path if it isn't going straight.
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
2-week FIRST summer program @ WPI ColleenShaver General Forum 20 31-05-2009 03:02
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
Ahh! Program trick confusing! archiver 2001 9 24-06-2002 02:26
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 29-01-2002 12:32
about how Drive Train push the robot... shouldn't the force accelerate the robot? Ken Leung Technical Discussion 12 26-11-2001 09:39


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

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