Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Move Robot a set angle (http://www.chiefdelphi.com/forums/showthread.php?t=112527)

smarthimandrew 01-02-2013 14:24

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?

BigJ 01-02-2013 14:33

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.

Ether 01-02-2013 14:40

Re: Move Robot a set angle
 
Quote:

Originally Posted by smarthimandrew (Post 1225966)
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.



sloteera 01-02-2013 14:42

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.

Ether 01-02-2013 14:43

Re: Move Robot a set angle
 
Quote:

Originally Posted by sloteera (Post 1225978)
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?



sloteera 01-02-2013 14:47

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.

smarthimandrew 01-02-2013 14:52

Re: Move Robot a set angle
 
Quote:

Originally Posted by sloteera (Post 1225978)
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

sloteera 01-02-2013 14:53

Re: Move Robot a set angle
 
Please, give us an feedback if this works after you finish!!

Ether 01-02-2013 15:56

Re: Move Robot a set angle
 
Quote:

Originally Posted by sloteera (Post 1225980)
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.



theawesome1730 01-02-2013 16:09

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.

sloteera 01-02-2013 16:14

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...

Hugh Meyer 01-02-2013 16:22

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

Ether 01-02-2013 16:30

Re: Move Robot a set angle
 
Quote:

Originally Posted by sloteera (Post 1226019)
...

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.



Ether 01-02-2013 16:34

Re: Move Robot a set angle
 
Quote:

Originally Posted by Hugh Meyer (Post 1226023)
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.



virtuald 02-02-2013 00:43

Re: Move Robot a set angle
 
We had a lot of success a few years ago with a gyro, I'd recommend it.


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

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