Go to Post Al's Murphy's law corollary...If it can go wrong, it will on Einstein - Al Skierkiewicz [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 01-02-2013, 14:24
smarthimandrew's Avatar
smarthimandrew smarthimandrew is offline
Programmer, and (sigh) Electrical
AKA: Andrew Dickinson
FRC #3546 (Buc 'n' Gears)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Grand Haven, Western Michigan, US
Posts: 22
smarthimandrew is an unknown quantity at this point
Move Robot a set angle

Hi,

In order to align my team's robot to the target, we need to move the robot a certain number of degrees.
We have 4 Motor Drive with encoders on a cimple gearbox. We have already written the code to figure out how many degrees to move, but we cannot figure out how that corresponds to wheel movement. I would assume that it is dependent on wheel size and robot size.

Wheels:

8" Diameter, 25.1327412" circumference
http://www.andymark.com/product-p/am-0569.htm

Robot:

I am unsure as to how wide the robot is, because I don't have it in front of me right now, but an explanation of how to use the width (If necessary) would be helpful.



My question is, How do I figure out how much to move the wheels?
  #2   Spotlight this post!  
Unread 01-02-2013, 14:33
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 943
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Move Robot a set angle

You'd need to know the behavior of the wheels while your robot turns, then use that model to determine the amount of turns, then use that to count the number of ticks while driving in a turning motion.

It might be easier to use a gyro sensor.
  #3   Spotlight this post!  
Unread 01-02-2013, 14:40
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,004
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Move Robot a set angle

Quote:
Originally Posted by smarthimandrew View Post
Wheels:

8" Diameter, 25.1327412" circumference
http://www.andymark.com/product-p/am-0569.htm

My question is, How do I figure out how much to move the wheels?
It's a skid-steer vehicle, so it depends on the phase of the moon and yesterday's lottery numbers.

But seriously, you could use a gyro (as the previous poster suggested), or you could do some simple experiments and measure how much vehicle rotation you get vs how much the wheels turned. Do that under various conditions (like turning speed) and either fit a model to the data or prepare a lookup table. Make sure you use the same carpet as competition when running these tests, and with the competition weight.


  #4   Spotlight this post!  
Unread 01-02-2013, 14:42
sloteera's Avatar
sloteera sloteera is offline
Registered User
AKA: Rafa
FRC #1860 (Cephatron)
Team Role: Coach
 
Join Date: Mar 2007
Rookie Year: 2004
Location: Brazil
Posts: 190
sloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud of
Re: Move Robot a set angle

Man,

If you turn your robot using just one side of your drive train, you can calculate the arc of the circle by counting the enconder pulses.

The radius will be the distance between both side of drive train.
  #5   Spotlight this post!  
Unread 01-02-2013, 14:43
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,004
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Move Robot a set angle

Quote:
Originally Posted by sloteera View Post
Man,

If you turn your robot using just one side of your drive train, you can calculate the arc of the circle by counting the enconder pulses.

The radius will be the distance between both side of drive train.
Ya think? Have you actually tried this?


  #6   Spotlight this post!  
Unread 01-02-2013, 14:47
sloteera's Avatar
sloteera sloteera is offline
Registered User
AKA: Rafa
FRC #1860 (Cephatron)
Team Role: Coach
 
Join Date: Mar 2007
Rookie Year: 2004
Location: Brazil
Posts: 190
sloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud of
Re: Move Robot a set angle

Never lol.

But I guess that could be an solution.

The arc perimeter is 2*3,1415*R / angle
You can measure your linear distance (perimeter circle) with an encoder.
  #7   Spotlight this post!  
Unread 01-02-2013, 14:52
smarthimandrew's Avatar
smarthimandrew smarthimandrew is offline
Programmer, and (sigh) Electrical
AKA: Andrew Dickinson
FRC #3546 (Buc 'n' Gears)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Grand Haven, Western Michigan, US
Posts: 22
smarthimandrew is an unknown quantity at this point
Re: Move Robot a set angle

Quote:
Originally Posted by sloteera View Post
Man,

If you turn your robot using just one side of your drive train, you can calculate the arc of the circle by counting the enconder pulses.

The radius will be the distance between both side of drive train.
Thanks, I'll try this
  #8   Spotlight this post!  
Unread 01-02-2013, 14:53
sloteera's Avatar
sloteera sloteera is offline
Registered User
AKA: Rafa
FRC #1860 (Cephatron)
Team Role: Coach
 
Join Date: Mar 2007
Rookie Year: 2004
Location: Brazil
Posts: 190
sloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud of
Re: Move Robot a set angle

Please, give us an feedback if this works after you finish!!
  #9   Spotlight this post!  
Unread 01-02-2013, 15:56
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,004
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Move Robot a set angle

Quote:
Originally Posted by sloteera View Post
The arc perimeter is 2*3,1415*R / angle
No, it's angle*R ... (where "angle" is in radians)

Code:
You can measure your linear distance (perimeter circle) with an encoder.
It's a skid-steer vehicle, so the wheel is slipping when turning. It's also not perpendicular to the direction of travel. Thus my semi-humorous remark in my earlier post.


  #10   Spotlight this post!  
Unread 01-02-2013, 16:09
theawesome1730's Avatar
theawesome1730 theawesome1730 is offline
Registered User
FRC #1730 (Team Driven)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Lee's Summit, MO
Posts: 316
theawesome1730 will become famous soon enough
Re: Move Robot a set angle

Like many others have said, a gyro would be the best bet. You can use them for more than just positioning too. We use them to keep us driving in straight lines since doing that based on encoders alone is near impossible. You also may consider a range finder in addition to help your robot know where it is in relation to the field for greater accuracy. Just remember to have your gyro automatically recalibrate itself at the begging of autonomous for best results as they tend to wander over a course of time.
__________________



2015 GKC Engineering Inspiration
2015 Colorado Winners
  #11   Spotlight this post!  
Unread 01-02-2013, 16:14
sloteera's Avatar
sloteera sloteera is offline
Registered User
AKA: Rafa
FRC #1860 (Cephatron)
Team Role: Coach
 
Join Date: Mar 2007
Rookie Year: 2004
Location: Brazil
Posts: 190
sloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud ofsloteera has much to be proud of
Re: Move Robot a set angle

2*3,1415 = 2*PI = 360 radians = angle ( in radians )

So

360 radians * R = angle (entire circle)*R

360 radians = Full Perimeter
x radians = arc Perimeter

So

Arc Perimeter= 2*Pi*R / angle wished ( in radians )

And, When I say "arc perimeter" I mean about the linear distance of This segment, so the encoder could return this measurement

I guess...
  #12   Spotlight this post!  
Unread 01-02-2013, 16:22
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: Move Robot a set angle

http://www-personal.umich.edu/~johan...s/pos96rep.pdf

This link points to a document that explains how to do localization. The PDF pages 19 & 20 show the formula to convert wheel movement into position. For this to work your robot would need to pivot about the center wheels. If they are dropped some this often happens.

This isn't the total solution you are looking for but I think it will get you moving in the right direction.

If you have a gyro there is some default code that does all of this for you. Look in the targeting example code.

-Hugh
  #13   Spotlight this post!  
Unread 01-02-2013, 16:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,004
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Move Robot a set angle

Quote:
Originally Posted by sloteera View Post
...
Two things:

1) There are not 360 radians in a full perimeter.

2) Look at your formula. It says that as the angle_wished gets larger, the arc_perimeter gets smaller.


  #14   Spotlight this post!  
Unread 01-02-2013, 16:34
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,004
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Move Robot a set angle

Quote:
Originally Posted by Hugh Meyer View Post
For this to work your robot would need to pivot about the center wheels. If they are dropped some this often happens.
Yeah, if it's a dropped-center 6WD with sufficient drop and with most of the weight over the center wheels it might work. The OP didn't mention 6WD though.


  #15   Spotlight this post!  
Unread 02-02-2013, 00:43
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,033
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Move Robot a set angle

We had a lot of success a few years ago with a gyro, I'd recommend it.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
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


All times are GMT -5. The time now is 03:55.

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