Go to Post I personally think any student should be allowed to participate, as long as he/she is helpful and active. FIRST, to me, is about inspiration, not elitism. - Aignam [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-01-2007, 00:20
mrmummert's Avatar
mrmummert mrmummert is offline
Registered User
AKA: hank
FRC #1610 (bot)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: franklin
Posts: 353
mrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to behold
Send a message via Yahoo to mrmummert
mecanum programming

Hello...

Last year someone posted a link for information on programming for mecanum wheels usage. Does anyone remember what it was. Our team
is concidering this this year. Any help will be greatly appreciated.

Thank You
  #2   Spotlight this post!  
Unread 11-01-2007, 00:22
pyr0m_1595 pyr0m_1595 is offline
CAD Wizard
FRC #1595 (I never exactly know...)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Spokane, Washington
Posts: 7
pyr0m_1595 is an unknown quantity at this point
Re: mecanum programming

We're considering it this year; I'd PM or email the main programmer. His forum name's cprogrammer.
__________________
CAD Wizards of the world unite!

Main rig down--working on a 3-year old $500 Compaq laptop.

Team website
(I'm NOT in any way affiliated with the web designers.)
  #3   Spotlight this post!  
Unread 11-01-2007, 08:46
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: mecanum programming

well....

Start here...

and then use the search tool to look for keywords like omni wheel and holonomic and kiwi There are numerous posts and good info out there

SPAM built an omni wheel 'bot for the 2004 game. It was successful, but you will trade off agility for traction and pushing power. Do you wish to run with the big dogs? Or dance around them!

Eric
__________________

Don't PANIC!
S. P. A. M.
  #4   Spotlight this post!  
Unread 11-01-2007, 11:20
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: mecanum programming

This is what we use for a simple open-loop mecanum drivebase. Default_Routine() computes internal speed, turn rate, and slide (sideways travel) values from the joystick inputs, then computes motor speeds from the internal values.

The p1 joystick is on the left, and p2 is on the right.
pwm01 is the right front motor, pwm02 is the left front, pwm03 is the right rear, and pwm04 is the left rear.
rc_dig_in01 is a "deadman" switch which sets the motors to neutral unless it is closed. This was intended to be used by people "riding" the robot.
Code:
/*******************
function:	deadband()
inputs:	inp, input value
		center, value of input that represents neutral
		band, size of deadband to consider neutral
output:	scaled and deadband-compensated output value
		inputs below center will yield negative output
		inputs above center will yield positive output
		inputs within deadband either side of center will yield 0
usage:	typically call with joystick value (0-254) as input,
		joystick neutral (127) as center, and a small number (5)
		as the size of the deadband.  The white POS joysticks
		should probably have a much larger band (10) instead.
*******************/
int deadband(int inp, int center, int band)
{
int oup;
	if (inp < center-band)
		oup = inp - center + band;
	if (center-band <= inp && inp <= center+band)
		oup = 0;
	if (center+band < inp)
		oup = inp - center - band;
	return oup;
}

/*********************
function:	pwm_limit()
inputs:	inp, input value
output:	scaled and range-limited output value
usage:	call with signed value (+/- 127) as input,
		will return a valid pwm value
*********************/
unsigned char pwm_limit (signed int inp)
{
	if(inp<-127)
		inp = -127;
	if (inp>127)
		inp = 127;
	inp = inp+127;

	return (char)inp;
}

/*******************************************************************************
* FUNCTION NAME: Default_Routine
* PURPOSE:       Performs the default mappings of inputs to outputs for the
*                Robot Controller.
* CALLED FROM:   this file, Process_Data_From_Master_uP routine
* ARGUMENTS:     none
* RETURNS:       void
*******************************************************************************/
void Default_Routine(void)
{
signed int speed, turn, slide;
signed int front_r, front_l, back_r, back_l;
long int l_y, r_y, l_x, r_x;

	l_y = deadband(p1_y,127,10);
	r_y = deadband(p2_y,127,10);
	l_x = deadband(p1_x,127,10);
	r_x = deadband(p2_x,127,10);

	l_y = l_y/2;
	r_y = r_y/2;
	l_x = l_x/2;
	r_x = r_x/2;

	speed = l_y+r_y;
	turn = l_y-r_y;
	slide = -l_x-r_x;
  
  	front_r = speed-turn+slide;
	front_l = speed+turn-slide;
	back_r = speed-turn-slide;
	back_l = speed+turn+slide;

if (rc_dig_in01 == 0)
{
	pwm01 = pwm_limit(front_r);
	pwm02 = pwm_limit(front_l);
	pwm03 = pwm_limit(back_r);
	pwm04 = pwm_limit(back_l);
}
else
{
	pwm01 = 127;
	pwm02 = 127;
	pwm03 = 127;
	pwm04 = 127;
}
  #5   Spotlight this post!  
Unread 11-01-2007, 11:37
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: mecanum programming

Quote:
Originally Posted by Alan Anderson View Post
This is what we use for a simple open-loop mecanum drivebase. Default_Routine() computes internal speed, turn rate, and slide (sideways travel) values from the joystick inputs, then computes motor speeds from the internal values.
This is pretty similar to what Team 95 has used on holonomic/omni test robots in the past (we haven't competed with one since around '97 or so, however).

It's easy for things like variations in the carpet and motor differences to cause your drive mechanism to drive slightly off. You should consider adding a gyroscope and feedback loop so your bot can drive 100% straight (and there's good code examples out there for doing this).

And, with the USB Chiklet available this year, it's really easy to use a three-axis joystick, so it's not hard to control an omni-robots three degrees of freedom direct from one joystick.
  #6   Spotlight this post!  
Unread 11-01-2007, 13:17
dtengineering's Avatar
dtengineering dtengineering is offline
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,832
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: mecanum programming

It looks like we aren't the only team who is going to be trying out mecanums this year... just a couple of tips when searching for info, so far I have found results by searching for a couple of common spellings:

meccanum
mechanum and
mecanum

All produce results.

FIRST has info at http://www.usfirst.org/uploadedFiles...heels_Hine.ppt

and the CD white papers have a great power point presentation called "strafing", I believe that runs you through the derivation of the formulas used for a variety of omni-drive systems.

Good luck, and have fun going sideways.

Jason
  #7   Spotlight this post!  
Unread 11-01-2007, 20:35
mrmummert's Avatar
mrmummert mrmummert is offline
Registered User
AKA: hank
FRC #1610 (bot)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: franklin
Posts: 353
mrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to behold
Send a message via Yahoo to mrmummert
Re: mecanum programming

Thanks guys...Hmmmm....will send this along to our programmers
  #8   Spotlight this post!  
Unread 11-01-2007, 20:57
trilogism
 
Posts: n/a
Re: mecanum programming

Our team's programmer (<--Yes singular!!) worked out all the math to use the omniwheels, and the mechanum twice, with the wheels oriented differently. Turns out, since we have no money, that we won't be using any holonomic drive this year.
  #9   Spotlight this post!  
Unread 16-01-2007, 20:51
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: mecanum programming

I am trying to use the code posted above but I am not able to make it strafe using the code. Is there as simple way of doing this. Help is appreciated.
  #10   Spotlight this post!  
Unread 16-01-2007, 21:57
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: mecanum programming

If by "strafe" you mean travel sideways, the code I posted does that when the joysticks are pushed sideways.
  #11   Spotlight this post!  
Unread 16-01-2007, 22:33
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: mecanum programming

I am using your code but when I move both joysticks to one side the wheels spin but the robot stays in place. All the wheels either spin inward or all wheels spin outward but never one side spins inward and the other spins outward.
  #12   Spotlight this post!  
Unread 17-01-2007, 06:42
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: mecanum programming

You're using terms that I don't understand. How does a wheel spin "inward" or "outward"?

This code is for a mecanum drive base, with four mecanum wheels all mounted so they spin either forward or backward. The "handedness" of the wheels is important, and it's possible to set things up in one of two ways. One way has the angled rollers contacting the floor so that the robot can very nearly spin in place without any of the wheels turning. This code assumes the other way, where the angled rollers resist spinning in place when the wheels are stationary.

The "meat" of the code is these four lines:
Code:
  	front_r = speed-turn+slide;
	front_l = speed+turn-slide;
	back_r = speed-turn-slide;
	back_l = speed+turn+slide;
All wheels drive at the same rate based on the (forward) speed. The left motors drive more and the right motors drive less based on the (right-hand) turn. The motors on one diagonal drive more in one direction, and the motors on the other diagonal drive more in the other direction, based on the sideways slide.

You might need to change the sign of some of these parts based on how your motors are wired.
  #13   Spotlight this post!  
Unread 17-01-2007, 18:42
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: mecanum programming

I got your code to work and it works great. One problem: speed controls orange light goes off or blinks about every 5 minutes and we have to recalibrate the speed controls. Is there any way to alleviate or completely fix this. Help is greatly appreciated.
  #14   Spotlight this post!  
Unread 17-01-2007, 21:21
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: mecanum programming

Quote:
Originally Posted by DustinB_3 View Post
...speed controls orange light goes off or blinks about every 5 minutes and we have to recalibrate the speed controls...
Are you using the white joysticks from the Kit of Parts? The mechanical trim adjustment on the ones I know from prior years has a habit of moving by itself when you push the joystick far from the center. If that's your problem, try taping it down or using a spot of hot melt glue to keep it in place.
  #15   Spotlight this post!  
Unread 17-01-2007, 22:01
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: mecanum programming

We'll try that. That's what I think the problem is but our drivers think it's all because of the code. We are using black joysticks from a while ago. They have a square base.
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
Mecanum Suspensions Rob2713g Technical Discussion 12 01-12-2006 08:27
Mecanum Rob2713g Technical Discussion 13 03-11-2006 14:16
Mecanum Wheels chaolin2007 Control System 1 25-02-2006 19:16
Mecanum Wheels TheFerret Technical Discussion 8 16-01-2006 09:23


All times are GMT -5. The time now is 20:46.

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