Lynxmotion Tech Support

www.lynxmotion.com
It is currently Fri Sep 10, 2010 5:05 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Gyro sample code?
PostPosted: Mon Apr 06, 2009 7:27 pm 
Offline
Roboteer

Joined: Sun Nov 30, 2008 3:08 pm
Posts: 304
Location: Portland Oregon
So I have a phoenix robot and noticed that the gyro is pretty inexpensive and would be pretty cool to play around with... so emm..


Anyone have one of these and use it with an Atom Pro and ... I don't know do something neat with it?

I'd like to see some code for it and how challenging or not it is to pull values off it.


--Aaron

_________________
Is the warranty voided yet? ... and why not?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 06, 2009 8:22 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1246
Location: Mars!!!
Are you talking about the Lynxmotion gyro? I don't know if the code is any different for the Robonova gyro. I think you just have to use the ADIN command.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 06, 2009 11:22 pm 
Offline
Roboteer

Joined: Sun Nov 30, 2008 3:08 pm
Posts: 304
Location: Portland Oregon
yeah,

I was speaking about the lynxmotion gyro, although if the code is similar or the same to any gyro i guess im looking for, what exactly is the output look like?? is it like the numbers you get when you do a pulsin read on an RC reciever?

900ish-2200ish decimal?

I'd like to toss this on the Phoenix for a couple experiments! would be cool.

--Aaron

_________________
Is the warranty voided yet? ... and why not?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 8:45 am 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1246
Location: Mars!!!
You have to use the ADIN command to get the data. The data is then returned as a digital value of 0-1023 (10 bit).

The best thing to do would be to experiment with it and get familiar with the values returned.

Quote:
I'd like to see some code for it and how challenging or not it is to pull values off it.


It's actually VERY simple. It takes like 3 lines of code to return the value of the sensor to the output window.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 9:43 am 
Offline
Roboteer

Joined: Sun Nov 30, 2008 3:08 pm
Posts: 304
Location: Portland Oregon
cool, I guess what I might have expected.


are these Gyro's just 1 axis?..

I have never used them before or had an RC heli either...

is a 3 axis one available somehow? or does one have to build it?

Thanks again.

--Aaron

_________________
Is the warranty voided yet? ... and why not?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 9:51 am 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1246
Location: Mars!!!
Have you taken a look at it yet? :wink:
http://www.lynxmotion.com/Product.aspx? ... tegoryID=8

It says 2 axis. I'm guessing its x and z axis. How it works is there are 2 analog outputs on it and they connect using two data cables that connect to the Bot Boards A/D pins and you would have to actually do the ADIN command twice. One for the Z axis and one for the X axis (i assume those are the axis that it reads).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 10:46 am 
Offline
Roboteer

Joined: Sun Nov 30, 2008 3:08 pm
Posts: 304
Location: Portland Oregon
That is cool.. I had no idea it was that simple, you happen to know which one of these gyro's is better?

http://www.sparkfun.com/commerce/produc ... cts_id=698

500 degrees a second seems like overkill for this tiny pheonix of mine, although hopefully quite speedy.. but $25 isnt bad either.. cool cool

I'm going to have to pick one of these up the programming seems very very easy, supprised more people arn't using these!

Oh i see that's a Accelerometer...and not a gyro, I remember seeing a discussion about using one or another... I think probably using a gyro in my case might be a better way as what I would like to accomplish with this, and since adding this to my program wont take a ton of cpu cycles to use the adin command, vs the pulsin command how im reading all 7 channels of my T7C..

If you have coded with this, is it possible you can get the same result from either a gyro or accelerometer?

did you have any messanger service?

It might be a good 6 hours or so before i'm able to post again, but I'm pretty interested in picking one or the other up and coding with it since it seems pretty easy..so cool.

--Aaron

_________________
Is the warranty voided yet? ... and why not?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 11:29 am 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1246
Location: Mars!!!
LikWidChz wrote:
That is cool.. I had no idea it was that simple, you happen to know which one of these gyro's is better?

http://www.sparkfun.com/commerce/produc ... cts_id=698

500 degrees a second seems like overkill for this tiny pheonix of mine, although hopefully quite speedy.. but $25 isnt bad either.. cool cool

I'm going to have to pick one of these up the programming seems very very easy, supprised more people arn't using these!

I think the Lynxmotion one might be simpler IMO. And its cheaper too.
Quote:
Oh i see that's a Accelerometer...and not a gyro, I remember seeing a discussion about using one or another... I think probably using a gyro in my case might be a better way as what I would like to accomplish with this, and since adding this to my program wont take a ton of cpu cycles to use the adin command, vs the pulsin command how im reading all 7 channels of my T7C..

If you have coded with this, is it possible you can get the same result from either a gyro or accelerometer?

Um...I'm confused. I thought an Accelerometer was a gyro?
Quote:
did you have any messanger service?

It might be a good 6 hours or so before i'm able to post again, but I'm pretty interested in picking one or the other up and coding with it since it seems pretty easy..so cool.

--Aaron


Nope...sorry. I don't have one atm. I just installed a new OS and I haven't put all the software on it yet.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 2:29 pm 
Offline
Roboteer

Joined: Sun Nov 30, 2008 3:08 pm
Posts: 304
Location: Portland Oregon
Well hook it up then and get that ish installed.. if you know some coding be handy to have someone i can shoot ideas back and forth with rather then post short questions..

Yes as far as I know an accelerometer and a gyro are 2 different things..

An accelerometer would maintain the same value after its been in 2 points in 3d space for some amount of time, and the data is only gatherd in the time it takes to move..

a gyro however..."taking a guess here" once its powered on would maintain an angle refrence in the axis its oriented with power applied so the only time you would get the same value from it is if it were positioned in the same angle it was when it was powered on?...


Let me know if that makes sense... granted the gyro description was a guess... so if anyone wants to chime in here and either tell me im correct or wrong, feel free to no harm done.

-Aaron..

I would rather have something that refrences 3 axis in space vs a single axis.. all this is for test on my part along with expanding my atom pro basic skills which are expanding daily!

_________________
Is the warranty voided yet? ... and why not?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 2:38 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 28, 2006 5:47 pm
Posts: 1246
Location: Mars!!!
Okie then. I'll do that when I get a chance.

I still think you should go for the Accelerometer.

_________________
Decode this secret ASCII message:
$52 $4F $54 $46 $4C $4F $4C

*Avatar is me after I laughed out loud too much.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 17, 2009 4:01 pm 
Offline
Roboteer

Joined: Sun Apr 12, 2009 3:07 pm
Posts: 9
An accelerometer can return an angle or orientation but only when the accelerometer is at rest. That's because it uses the Earth's gravity to determine orientation. Once it's in motion, there are several vectors affecting the accelerometer other than the Earth's gravity.

Alternatively, a gyro can return an angle of orientation at rest and during motion.

Unfortunately, orientation data obtained using just a gyro can result in errors that become larger and larger over time. One solution is to combine both so that readings from a gyro are "reset" when the object is at rest (as determined by the accelerometer).

It turns out, you need at least 6 degrees of freedom to track the movement of an object in 3-Dimensions. They sell things like this on sparkfun and other sites but they're pretty expensive. Of course, you can get away with less if that's not your goal.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group