🎄⛄❄️🎁 It's beginning to look a lot like ADABOX-mas! The next ADABOX from Adafruit ships soon! Get yours now, or give as a gift! 🎄⛄❄️🎁
0

NXP Precision 9 DOF Huge Drifting Issue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Fri Nov 08, 2019 2:05 pm

Hey DRKrobotmaker! It does indeed sound like we’re working on similar problems: keeping a relatively slow moving robot oriented and tracking its movements. https://www.youtube.com/watch?v=wyAqbq7WxPg&t=35s is a video I made of an old version of my robot using Mecanum wheels (have subsequently changed to Omni wheels). I attempted to maintain orientation with a magnetometer mounted on top of a wooden pole to isolate it from the magnetic noise generated by the stepper motors and relays. I switched to gyroscopes when the magnetometer proved much too inaccurate. I believe I have tried all of the gyroscopes sold by AdaFruit. I have no reason to doubt the veracity of their gyroscope comparison, https://learn.adafruit.com/comparing-gy ... datasheets, and their conclusion that the FXAS21002C gives the best performance. As I mentioned above, I believe Bosch is on the right track with the BNO055 which has its own MPU programmed with its own filtering algorithm: it can better handle the integration of orientation from rotation rate and removes the processing burden from the robot’s controller. I found the BNO055 didn’t drift appreciably but didn’t register slow rotation. I wondered whether Bosch controlled drift by not changing the orientation if the accelerometers didn’t detect motion (but I am probably being unfair). I defer completely to duckman01 who appears to be more knowledgeable on the subject of gyroscopes. Following his advice, I can get my FXAS21002C drift down to an acceptable level… but not consistently.

You mention you would like to measure “…distance traveled based on acceleration data…”. So would we all, good luck with that! It all depends on how accurate you need the measurement. Although the accelerometers can be hung on the robot's processor, once again, it would be nice to have a built in MPU to rapidly measure acceleration and integrate it to velocity and displacement. I don’t believe anything like that exists currently but maybe someone is working on it.

I am currently trying to measure orientation and distance traveled with the mechanisms from optical mouses (mice?): a PMW3360 (https://www.tindie.com/products/jkickli ... on-sensor/) and an ADNS3050 (https://www.tindie.com/products/tom1012 ... sor-board/). I’ve made some progress with it. Two optical sensors, both measuring displacement in the same two orthogonal directions should enable very accurate determination of orientation and displacement if the robot is moving on a smooth surface. It would be nice if AdaFruit would develop a board with an optical mouse sensor because then it would be thoroughly tested, have known characteristics, and good programming guidance. I think we could both use such a board.

Good luck, I’ll be interested in hearing your thoughts.

nashdb
 
Posts: 14
Joined: Wed Nov 14, 2018 10:03 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by adafruit_support_bill on Fri Nov 08, 2019 2:11 pm

@nashdb - thanks for the suggestion re: optical mouse sensors. I will forward that suggestion to the product design team.

adafruit_support_bill
 
Posts: 75036
Joined: Sat Feb 07, 2009 10:11 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by adafruit2 on Fri Nov 08, 2019 2:28 pm

yeah this is a classic hard problem - and most of these sensors are discontinued. we're looking at the APDS9600, we'll see if its any good!

adafruit2
Site Admin
 
Posts: 18790
Joined: Fri Mar 11, 2005 7:36 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Fri Nov 08, 2019 4:03 pm

Hey adafruit_support_bill and adafruit2, that’d be great if you would develop such a sensor; I’m quite sure it would be popular with mobile robot makers. I’ve found the ADNS-3050 easier to work with than the PMW3360 but only because the PCB on which it is mounted is a little better thought out (the software available for both is nearly identical). As I suspect you know, the sensor is actual a camera (16x16? 32x32?) and the displacement of the image is how movement is detected. Both are affected by acceleration (i.e., moving a fixed distance quickly gives a different value than moving over it slowly). I believe this is desirable in a mouse but not in something measuring distance. I suspect that the sensor needs to be a bit more “deconstructed”, the mouse enhancements removed, and stripping down to the point that it determining the distance the image has moved.

If this distance-traveled sensor would be developed, it could be a game changer for multiple applications. A colleague of mine is looking for a sensor for use with the tracking mechanism of his telescope. It could also have laboratory applications.

jkicklighter made boards for both of the sensors and offered them on Tindie (https://www.tindie.com/stores/jkicklighter/). He did a superb job offering help. The problem is the sensor needs to isolated and developed. Tobias Antonsson at https://www.bitcraze.io/ also developed and offers a “flow meter” based on the PMW3901 (https://www.bitcraze.io/flow-breakout/) but he informed me that it has the same acceleration problem. I do hope you will pursue this!

nashdb
 
Posts: 14
Joined: Wed Nov 14, 2018 10:03 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by DRKrobotmaker on Sat Nov 09, 2019 10:45 am

@ nashbd

Hmmm seems we are traveling very similar paths indeed. Different robots but similar goals. Yours being much more sophisticated. My first robot April 2019 is based on kids spider kits. https://youtu.be/in3kAW490Ns I've enhanced this to https://youtu.be/a2CsyD81NeE This was for end of summer school demo for one of my daughter's 6-8 yo special needs summer classroom. They loved it. Uses the MPU6050 Gyro

I've worked on trying to use older PS/2 mouse to track a robots movements. I started this back in April. Have done a lot of testing. I used older Ps/2 mice. The concept was to have two wheels, one on the left and one on the right spread out as much as possible. This link shows the basic housing used. https://photos.app.goo.gl/SE3bqc2bKRFdcxhx7 This shows a test bench finally used to test accuracy. https://youtu.be/96gbM2ncREE

In April I had tested the device using a 48 inch straight edge to guide it using hand motion. It seemed to repeat well enough. The mouse count was off by 50/20000 ticks. After 5 repeated runs it was off less than 100/100000 ticks leading to an assumption this just may work. Optical Mouse and wheel https://photos.app.goo.gl/SE3bqc2bKRFdcxhx7

I then redesigned my robot as in this omni view video with enhancements to motor driver technology. https://youtu.be/CdhQen3ur-Q this is it in motion.... https://youtu.be/amV3h9pmAjI But the error ended up being to great so I built the test bench mention above to check repeatability. The test bench driving motor was not consistently controlled. So another test bench was built using an encoder to get precision and a wheel was printed. This had similar results, not good enough for tracking and guidance.

There were issue that may have caused the mouse tracking errors. The most obvious is the wheel wobbled (axel hole was not perpendicular when printed). If I had the tech to make a perfect wheel and drive axel then definitive tests would be possible. Using an encoder to compare results makes for definitive results.

Although are robots are very different in nature the general underlying goals are similar.

DRKrobotmaker
 
Posts: 11
Joined: Fri Nov 08, 2019 9:43 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by DRKrobotmaker on Sat Nov 09, 2019 11:11 am

adafruit2 wrote:yeah this is a classic hard problem - and most of these sensors are discontinued. we're looking at the APDS9600, we'll see if its any good!



What are the general thoughts to implementation? I've found articles where people have tried to use encoders on drive wheels and slippage was significant and unsurmountable, an engineer at I robot was involved in this research. Others have built test devices that were precise to see just how repeatable modern mice are. They displayed the XY drift moving the mouse in circular patterns, worth finding. Some laser mice had greater drift. I felt it was good enough for my goals to attempt building what was mentioned in my previous post using cheap older mice. The attempt I made was to have wheels track progress and be followers only, see above post. The drive mechanism would be separate. It may be possible given modern devices to accomplish low speed tracking using a mouse sensor tracking the side of a wheel.

Actually if this were to be done it would make far more sense to design an optical encoder device with below one degree accuracy.

DRKrobotmaker
 
Posts: 11
Joined: Fri Nov 08, 2019 9:43 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by adafruit_support_bill on Sat Nov 09, 2019 12:09 pm

Any kind of incremental type measurement is going to be subject to drift. Partly due to measurement accuracy and partly due to cumulative math errors. A common strategy is to augment incremental readings from inertial sensors with absolute measurements where possible to correct for the drift. For wide-ranging outdoor robots, GPS is a good solution. But the relatively low resolution and need for a clear view of the sky makes it unsuitable for smaller-scale and indoor robots.

Indoors, you can use things like ultrasonic or infrared rangefinders to gauge distance to walls or other obstacles. Down-facing light or color sensors can detect transitions in flooring or even line-follow grout-lines on a tile floor. Simple things like a microswitch 'bump' sensor can be used to reset your position on contact with a wall.

There are some GPS-like positioning systems for indoor use. But the cost is still pretty high.

adafruit_support_bill
 
Posts: 75036
Joined: Sat Feb 07, 2009 10:11 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by DRKrobotmaker on Sun Nov 10, 2019 8:56 am

nashdb wrote:[b]jkicklighter made boards for both of the sensors and offered them on Tindie (https://www.tindie.com/stores/jkicklighter/). He did a superb job offering help. The problem is the sensor needs to isolated and developed. Tobias Antonsson at https://www.bitcraze.io/ also developed and offers a “flow meter” based on the PMW3901 (https://www.bitcraze.io/flow-breakout/) but he informed me that it has the same acceleration problem. I do hope you will pursue this!


So.... have you tried using https://www.tindie.com/stores/jkicklighter/ ?

How were you going to use flow meter type tech... focus it on a wheel, surface, ????

Is there a way to get at the raw pixel data at sufficient speeds?

DRKrobotmaker
 
Posts: 11
Joined: Fri Nov 08, 2019 9:43 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by DRKrobotmaker on Mon Nov 11, 2019 8:35 am

adafruit_support_bill wrote:Any kind of incremental type measurement is going to be subject to drift. Partly due to measurement accuracy and partly due to cumulative math errors. A common strategy is to augment incremental readings from inertial sensors with absolute measurements where possible to correct for the drift. For wide-ranging outdoor robots, GPS is a good solution. But the relatively low resolution and need for a clear view of the sky makes it unsuitable for smaller-scale and indoor robots.

Indoors, you can use things like ultrasonic or infrared rangefinders to gauge distance to walls or other obstacles. Down-facing light or color sensors can detect transitions in flooring or even line-follow grout-lines on a tile floor. Simple things like a microswitch 'bump' sensor can be used to reset your position on contact with a wall.

There are some GPS-like positioning systems for indoor use. But the cost is still pretty high.


------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I've looked at many indoor solutions and none so far are within a frugal hobbyist price range. The ultimate goal is have a robot know where it is from starting point at all times in an environment where other things like cats, dogs, people move around at the same time. A difficult problem indeed. IRobot has developed such a device using three different frequency lasers pointing up and light the ceiling or whatever is above it and magically it does track movements precise enough to get back to the charging station, proprietary tech.

DRKrobotmaker
 
Posts: 11
Joined: Fri Nov 08, 2019 9:43 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by adafruit_support_bill on Mon Nov 11, 2019 8:46 am

A nice article on iRobot's mapping technology here: https://spectrum.ieee.org/automaton/rob ... roomba-980

adafruit_support_bill
 
Posts: 75036
Joined: Sat Feb 07, 2009 10:11 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by DRKrobotmaker on Mon Nov 11, 2019 9:53 am

adafruit_support_bill wrote:A nice article on iRobot's mapping technology here: https://spectrum.ieee.org/automaton/rob ... roomba-980


That is pretty cool.... now for AdaFruit to come up with a real affordable version! Someday, years away I suspect, the tech will be available and easily used by novice robot makers.

DRKrobotmaker
 
Posts: 11
Joined: Fri Nov 08, 2019 9:43 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Mon Nov 11, 2019 6:14 pm

Sorry for the delayed response DRKrobotmaker, I’ve been “on the road” for the last couple of days. Yes, I have purchased two of the ADNS-9800 mounted on the round PVC and one PMW-3360 from Jack Enterprises’ Tindie store. I’ve “successfully” run both on an Arduino Nano using code I modified from their https://github.com/mrjohnk/ADNS-9800 site. As I mentioned previously, the code for both is nearly identical and the measured distance moved is dependent on velocity. Both of the devices come with a lens (I believe it’s the same lens) which focuses immediately in front of the lens (i.e., a mouse lens). The depth of focus is very thin and, if the lens is lifted slightly off the surface, the “lift-alarm” is triggered and measurement isn’t made. It appears that Tobias Antonsson’s https://www.bitcraze.io/ board is designed for measurement of distance traveled by an aerial drone and uses a mini camera lens similar to a pi-cam (which would have a much higher depth of focus). This is a video in which the image captured by an ADNS-9800 is displayed (contrary to my earlier guess, it appears to have a resolution of 64x64 or maybe even 128x128: https://www.youtube.com/watch?v=37Fg5_77J24&t=45s.

You have a good idea that hadn’t occurred to me: focusing on the wheel. That might work but a high-resolution, optical, radial, encoder would probably work better. Mounting of either the ADNS-9800 or PMW-3360 is tricky because the lens must be against the surface but not pressing down hard enough to cause appreciable drag (at least in my application). I built a spring-loaded mount that works fairly well. If I had access to a 3D printer, I reckon I could design a better one. I have mounted it on a radial arm connected to a stepper motor and sweep it back in forth in a semicircle. Once calibrated it yields accurate, reproducible results but “lift offs” occur frequently. Of course the velocity of the sensor is constant in this setup. I was in the process of mounting it on my robot several months ago but got distracted by another project. I’ll get back to it sooner or later.

The article adafruit_support_bill cited is interesting. Self-driving cars have similar LiDAR systems and, because they’re mass produced, they’re fairly cheap (<$100 on eBay). Drone Bot Workshop (great site) has a nice video https://www.youtube.com/watch?v=VhbFbxyOI1k&t=825s on the TF Mini and RPLIDAR A1M8 (both available from DFRobot https://www.dfrobot.com and elsewhere). I’ve purchased the TF Mini and it works well but the resolution is ±1cm which doesn’t help my application much. I’m thinking about buying a RPLIDAR A1M8 but it has been superseded by a better model and is still a little out of my budget.

If Jack Enterprises can sell the ADNS-9800 unmounted sensor and mouse lens for <$14, I would think that with AdaFruit’s engineering expertise, fabbing capabilities, and software designing know-how, they could design a distance-traveled sensor built on the ADNS-9800 with an appropriate mounting for ~$50… I’d certainly buy a couple!

nashdb
 
Posts: 14
Joined: Wed Nov 14, 2018 10:03 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by adafruit2 on Mon Nov 11, 2019 6:30 pm

https://www.mouser.com/ProductDetail/Br ... /ADNS-9800
it is not available, please contact jack's store - they're your best bet!

adafruit2
Site Admin
 
Posts: 18790
Joined: Fri Mar 11, 2005 7:36 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by DRKrobotmaker on Mon Nov 11, 2019 9:24 pm

nashdb wrote:You have a good idea that hadn’t occurred to me: focusing on the wheel. That might work but a high-resolution, optical, radial, encoder would probably work better. Mounting of either the ADNS-9800 or PMW-3360 is tricky because the lens must be against the surface but not pressing down hard enough to cause appreciable drag (at least in my application).

I built a spring-loaded mount that works fairly well. If I had access to a 3D printer, I reckon I could design a better one. I have mounted it on a radial arm connected to a stepper motor and sweep it back in forth in a semicircle. Once calibrated it yields accurate, reproducible results but “lift offs” occur frequently. Of course the velocity of the sensor is constant in this setup. I was in the process of mounting it on my robot several months ago but got distracted by another project. I’ll get back to it sooner or later.

Dana response--- The lens focal point is 2.4 mm off the surface, measured from the lens bottom surface (closets to floor) to the floor. Plenty of room to be off the side of a tire. My older tech does not like white surfaces. Registered no movement at all. Using an encoder. The more affordable ones only have 40 ticks per revolution, 9 degrees per tick and are mechanical switches. There is denounce issues to solve, easily handled combining RC circuit and code. The more affordable 400 tick encoders and greater are optical. The cost is significant, china knock offs begin around $50 or so. They are fairly bulky and heavy. Not a good fit for my application at the moment. A better solution would be an encoder wheel driven by the tire. I haven't yet thought of how to mechanically design it. I think it will require a wheel touching the ground somehow coupled to the encoder disc/ optical sensor parts above/ away from dust and such. Searching for the right parts have yet to yield results.


nashdb wrote: The article adafruit_support_bill cited is interesting. Self-driving cars have similar LiDAR systems and, because they’re mass produced, they’re fairly cheap (<$100 on eBay). Drone Bot Workshop (great site) has a nice video https://www.youtube.com/watch?v=VhbFbxyOI1k&t=825s on the TF Mini and RPLIDAR A1M8 (both available from DFRobot https://www.dfrobot.com and elsewhere). I’ve purchased the TF Mini and it works well but the resolution is ±1cm which doesn’t help my application much. I’m thinking about buying a RPLIDAR A1M8 but it has been superseded by a better model and is still a little out of my budget.

If Jack Enterprises can sell the ADNS-9800 unmounted sensor and mouse lens for <$14, I would think that with AdaFruit’s engineering expertise, fabbing capabilities, and software designing know-how, they could design a distance-traveled sensor built on the ADNS-9800 with an appropriate mounting for ~$50… I’d certainly buy a couple!


If the 9800 does not have issue with velocity change it just may work.

I took another look at my mouse wheel carrier and measured the distance between wheel and lens bottom in the 3d CAD design. As best I can tell the wheel to lens is too close. It looks to be .083" off the surface, not the 0.094". Plus it is warped. I think I'll have a wheel machined at a local makers space and use a better axel. I'll print a measuring spacing stick .094" thick to verify the offset. I'll then take a look at the ADNS-9800 and build a test bench for it. It seems your influence as breathed life back into this approach...

DRKrobotmaker
 
Posts: 11
Joined: Fri Nov 08, 2019 9:43 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Tue Nov 12, 2019 12:02 pm

DRKrobotmaker wrote:If the 9800 does not have issue with velocity change it just may work.


Well... I think the 9800 does have a problem with velocity. Below are exchanges I've had with jkicklighter of Tindie (January 18, 2019) and Tobias Antonsson of bitcraze.io. It would appear that optical mouses (mice?), because they're designed to sense relative movement, have a problem with absolute distance measurement. Given the "photo image" algorithm used to determine movement, it's unclear to me why this problem is fundamental to the sensor.

Jan 18, 2019

Me: …does the integer incrementing of the x or y reading have a physical, dimensional length increment? I’ve modified your polling program to cumulate the x and y increments and have run the sensor along a line of known length to try to calibrate it. I find when I run the ADNS 9800 forward and then back along the same line, it doesn’t return to 0. I suspect I’ve either made a mistake in my program modification or I am misunderstanding the dynamics of the sensor (e.g., perhaps acceleration affects the value). I’m attempting to include a copy of the modification I made to your program.

Jkicklighter: …you are correct about acceleration being a “feature” that will affect results as you have observed. I first learned about that while searching for gaming mice that use this sensor. It is apparently not a preferred trait of some mouse sensors like this one

Me: Does the PMW3360DM-T2QU have the same acceleration characteristic?

Jkicklighter: It does, but as I understand it, the effect is much less. I only get that second hand from perusing the gaming groups I found on Google searches.

Feb 24, 2019

Me: I’m writing in the hopes that you would provide me with a bit more information about your Flow breakout board.... As you note on your website, orientation sensors (e.g., BNO055) are not sufficiently accurate for precise movement measurement. I have purchased both a board based on the ADNS-9800 and the PMW3360 and, although precise, neither are accurate (I believe measurement is affected by physical acceleration). I test both boards by having my robot move +10cm then -10cm horizontally and seeing whether it returns to the original value it read prior to movement. It does not.

Do you think your sensor board would work for this application? I just need the x, y readings, not the z. Can the board work 1mm or so above the surface? Is it affected by acceleration?

Tobias Antonsson (bitcraze.io): … I'm afraid all the optical flow sensors will suffer from the problem you are describing. As they work with relative movement and not absolute movement, errors will build up over time. So adding to the optical flow sensor you need something that can "calibrate" the position often enough so that errors don't build up and become to big.

nashdb
 
Posts: 14
Joined: Wed Nov 14, 2018 10:03 am

Please be positive and constructive with your questions and comments.