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)

Jcbconway 04-02-2013 21:32

Re: Move Robot a set angle
 
We came up with an algorithm to get heading based of of 2 wheels (encoders) by using an arc tangent. basically, you integrate the encoder to get your left and righ distance. subract the greater distance from the lesser distance and that is your arc length. then knwong the space between the wheels you can calculate the inverse arc tangent of your arc/wheel spacing. I however cannot confirm the acuracy of this system since it has not been fully tested and will not be fully tested as we no longer need to do this.

nighterfighter 04-02-2013 21:48

Re: Move Robot a set angle
 
Quote:

Originally Posted by Jcbconway (Post 1227624)
We came up with an algorithm to get heading based of of 2 wheels (encoders) by using an arc tangent. basically, you integrate the encoder to get your left and righ distance. subract the greater distance from the lesser distance and that is your arc length. then knwong the space between the wheels you can calculate the inverse arc tangent of your arc/wheel spacing. I however cannot confirm the acuracy of this system since it has not been fully tested and will not be fully tested as we no longer need to do this.

In theory reading the distance of the encoders can help you derive (Or in your case, integrate :p ) the angle turned.

The problem arises in the fact that one "tick" of the encoder doesn't necessarily equate to the wheel turning any distance, because the wheel will slip.

It might give you a good estimate though, and that is definitely a good exercise to have students do, it teaches programming. math, and realistic robot behaviors.

bvisness 05-02-2013 19:44

Re: Move Robot a set angle
 
Here's the screenshot of our VI:


jacob9706 05-02-2013 19:53

Re: Move Robot a set angle
 
Quote:

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

I did something similar last year but took it to a whole new level. If you can interpret my code, feel free to use it.

The heading is the angular offset relative to the starting position.

https://github.com/jacob9706/HighTek...adReckoner.cpp

Ether 05-02-2013 19:59

Re: Move Robot a set angle
 
Quote:

Originally Posted by bvisness (Post 1228363)
Here's the screenshot of our VI:


Deja Vu

http://www.chiefdelphi.com/forums/sh...21&postcount=8




bvisness 05-02-2013 20:01

Re: Move Robot a set angle
 
Quote:

Originally Posted by Ether (Post 1228373)

It's interesting that our solution is so close, but maybe that's because it's so simple. :P

I can personally guarantee that this VI was written as follows: Mentor's brain->messy whiteboard->VI. It's original!

Ether 05-02-2013 20:03

Re: Move Robot a set angle
 
Quote:

Originally Posted by bvisness (Post 1228374)
It's interesting that our solution is so close, but maybe that's because it's so simple.

It's simple once you figure it out:)



bvisness 05-02-2013 20:04

Re: Move Robot a set angle
 
Quote:

Originally Posted by Ether (Post 1228377)
It's simple once you figure it out:)



Right! My first attempt at this took over my screen so quickly that I forgot how it worked as soon as I started testing it.

jacob9706 05-02-2013 20:57

Re: Move Robot a set angle
 
Quote:

Originally Posted by Ether (Post 1228373)

I have never learned LabView. Sorry, I just saw that and thought it was jibberish :P

Now there is a solution for those who like labview and those who like a typed language!

Also it looks like your link was for a gyro. Mine was for an encoder on each drive wheel. (http://www.chiefdelphi.com/forums/sh...21&postcount=8)


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

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