Go to Post Aim for the stars – you just might hit a planet. - Leo M [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2016, 16:42
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 71
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
navX 2016 Software Reset Displacement

We are looking at using the navX displacement values for automode.

We are communicating with it via SPI, and receiving yaw, pitch, roll etc. We can reset the yaw. However, I can not find a function to reset the displacement. Is there one?

Do you have any other tips for using displacement? I may have other questions moving forward.

Last edited by Jonathan L. : 16-01-2016 at 18:16.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-01-2016, 16:51
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 336
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: navX 2016 Software Reset Displacement

In C++ there is a ResetDisplacement function, so I'm surprised it's not in labview. I guess you'll have to define your own offset variables and subtract those from the values.

The only other thing I would say is not to rely on it too much. Since it works from the accelerometer it may be inaccurate, especially if your robot shakes around (eg going over the rough terrain, rock wall, etc), and it will get more and more inaccurate over time (like yaw, hence the reset functions for both in C++).
Definitely don't use it as the only metric for your position. Use rangefinders or image processing to confirm it.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-01-2016, 18:56
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 348
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: navX 2016 Software Reset Displacement

Quote:
Originally Posted by Jonathan L. View Post
We are looking at using the navX displacement values for automode.

We are communicating with it via SPI, and receiving yaw, pitch, roll etc. We can reset the yaw. However, I can not find a function to reset the displacement. Is there one?

Do you have any other tips for using displacement? I may have other questions moving forward.
On average, the displacement accuracy is ~1 meter per 15 seconds of operation. FRC teams usually want no more than 1cm of error in autonomous. Therefore the displacement data is likely not usable for tracking position in autonomous.

You should be aware that any modern IMU will have similar performance characteristics. We are several years away from technology that is inexpensive enough for FRC that can track position to 1cm of accuracy every 15 seconds.

More details can be found in the NavX-MXP FAQ: http://navX-mxp.kauailabs.com/intro/...ked-questions/

That said, the navX-MXP yaw angle is very accurate, and that's what teams typically use.

In addition to euhlmann's recommendations, you might consider using wheel encoder readings and perhaps a follower wheel with an encoder for rotation speed and an angle encoder for relative orientation. Some teams have also fused the wheel encoder data with the yaw angle from the NavX-MXP.

Last edited by slibert : 17-01-2016 at 10:43.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2016, 18:01
Caboose's Avatar
Caboose Caboose is offline
Programmer - LabVIEW, C++, C#, Java
AKA: James Parks
FRC #0900 (Zebracorns)
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Seattle, WA
Posts: 72
Caboose has a spectacular aura aboutCaboose has a spectacular aura about
Red face Re: navX 2016 Software Reset Displacement

Quote:
Originally Posted by Jonathan L. View Post
We are looking at using the navX displacement values for automode.

We are communicating with it via SPI, and receiving yaw, pitch, roll etc. We can reset the yaw. However, I can not find a function to reset the displacement. Is there one?

Do you have any other tips for using displacement? I may have other questions moving forward.
Quote:
Originally Posted by euhlmann View Post
In C++ there is a ResetDisplacement function, so I'm surprised it's not in labview. I guess you'll have to define your own offset variables and subtract those from the values.

The only other thing I would say is not to rely on it too much. Since it works from the accelerometer it may be inaccurate, especially if your robot shakes around (eg going over the rough terrain, rock wall, etc), and it will get more and more inaccurate over time (like yaw, hence the reset functions for both in C++).
Definitely don't use it as the only metric for your position. Use rangefinders or image processing to confirm it.
My bad, I missed adding those reset commands, oops . Check the Latest Release, I've just added those functions. Thanks for catching that.
__________________
navX Labview Library

"Robots are aluminum shavings, held together by zip-ties."

myManga
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2016, 22:34
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 71
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
Re: navX 2016 Software Reset Displacement

Quote:
Originally Posted by Caboose View Post
My bad, I missed adding those reset commands, oops . Check the Latest Release, I've just added those functions. Thanks for catching that.
Awesome! I have updated our code.


Quote:
Originally Posted by euhlmann View Post
In C++ there is a ResetDisplacement function, so I'm surprised it's not in labview. I guess you'll have to define your own offset variables and subtract those from the values.

The only other thing I would say is not to rely on it too much. Since it works from the accelerometer it may be inaccurate, especially if your robot shakes around (eg going over the rough terrain, rock wall, etc), and it will get more and more inaccurate over time (like yaw, hence the reset functions for both in C++).
Definitely don't use it as the only metric for your position. Use rangefinders or image processing to confirm it.
We plan to use vision to finish at the end of our automode. We just want the navX to get us close.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-01-2016, 09:19
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 71
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
Re: navX 2016 Software Reset Displacement

We did some more testing last night and I can't seem to get any reliable displacement readings. The performance seems to be far less than 1 meter/second per 15 seconds. Actually, I'm having a hard time figuring out which direction on a graph it thinks is forward. I did try running an initial gyro calibration, but it didn't seem to help. Any suggestions? I can upload the code if you like. The gyro seems to be working fine.

I also noticed using the zero velocity function seemed to reset everything until I rebooted.

Thanks.
Reply With Quote
  #7   Spotlight this post!  
Unread 19-01-2016, 11:54
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 348
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: navX 2016 Software Reset Displacement

Quote:
Originally Posted by Jonathan L. View Post
We did some more testing last night and I can't seem to get any reliable displacement readings. The performance seems to be far less than 1 meter/second per 15 seconds. Actually, I'm having a hard time figuring out which direction on a graph it thinks is forward. I did try running an initial gyro calibration, but it didn't seem to help. Any suggestions? I can upload the code if you like. The gyro seems to be working fine.

I also noticed using the zero velocity function seemed to reset everything until I rebooted.

Thanks.
If you have verified that the navX-MXP is firmly mounted to the robot (i.e., conceptually it should be part of the mass of the robot frame) as described on the RoboRIO installation page, then you've likely achieved the performance limit.

> 1 meter/second per 15 seconds

Note that units of displacement are meters, so units should be in meters rather than meters/second.

Since you mentioned zeroing the velocity, you may be attempting to integrate velocity to derive a displacement estimate. If you are indeed attempting to integrate the navX-MXP velocity estimates your results on average will be worse than if you use the displacement estimates calculated by the navX-MXP.

Here's a link to the paper describing in detail the algorithms used on the navX-MXP: http://www.nxp.com/files/sensors/doc...ote/AN3397.pdf

As you can see in the paper, this is a very complex algorithm, and is prone to a number of noise factors and other error-inducing conditions.

I highly recommend students interested in motion processing to become familiar with these algorithms, which is why they are present in the navX-MXP. As the technology advances in the upcoming years, it's expected that these same algorithms will continue to be used.

I'd be happy to review your code and look for issues - but please be aware my purpose in doing so would be for educational reasons. Since I understand your focus at the moment is positioning in autonomous, I want to reiterate this recommendation:

Bottom-line is that for autonomous our recommendation is to use some combination of navX-MXP's very accurate yaw angle with wheel encoders and/or sensors that measure distance to known pieces on the field (vision processing, ultrasonic, lidar). And as others have mentioned, due to the rough terrain encountered when crossing the defenses which can disturb encoders, using distance-measuring sensors and fusing that with navX-MXP yaw is likely the best approach.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-01-2016, 12:15
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 348
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: navX 2016 Software Reset Displacement

Quote:
Originally Posted by Jonathan L. View Post
...Actually, I'm having a hard time figuring out which direction on a graph it thinks is forward.
One of the many challenging parts of the displacement integration algorithm (referenced in my last post) is that in addition to the double-integration, sensor data filtering, trapezoidal integration, removal of gravity from the accelerometers, etc., the algorithm also has to deal with the potential rotation of the robot during the time when integration is occurring.

Therefore, the X/Y units of displacement are in "world reference" frame. This means that they the Y axis is pointing to whatever direction maps to 0 degrees on the navX-MXP yaw angle. So it's important to ensure that the navX-MXP has completed startup calibration, and that the yaw has been zeroed recently (typically, immediately before integration begins). From that point on, the displacement X/Y axis data is in alignment with that zero reference point.

Last edited by slibert : 19-01-2016 at 12:35.
Reply With Quote
  #9   Spotlight this post!  
Unread 19-01-2016, 17:37
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 71
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
Re: navX 2016 Software Reset Displacement

Quote:
Originally Posted by slibert View Post
If you have verified that the navX-MXP is firmly mounted to the robot (i.e., conceptually it should be part of the mass of the robot frame) as described on the RoboRIO installation page, then you've likely achieved the performance limit.
I'm pretty sure this is our problem. The roboRIO and navX are mounted on rubber shock absorbers and attached with Velcro.



Quote:
Originally Posted by slibert View Post
Since you mentioned zeroing the velocity, you may be attempting to integrate velocity to derive a displacement estimate. If you are indeed attempting to integrate the navX-MXP velocity estimates your results on average will be worse than if you use the displacement estimates calculated by the navX-MXP.
I am using the displacement values calculated by the navX. What I meant was, by running the "Z900_navX_Set_Zero_Velocity.vi" subsequent returned values were zero until the system was rebooted.
Reply With Quote
Reply


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 09:07.

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