Nov 8, 2007

Why is my robot not perfect?


I run workshops with students all the time, and one of the first activities I do, is make them get their robot to drive forward 500mm. For the younger kids it's mainly trial and error, for the older kids I get them to calculate circumference and mathematically work it out.

But I was finding that the theory wasn't quite matching up to real life. I have in the past explained that every robot is subtly different. (this also helps to stop kids running to another computer and stealing other students values)

So I sat down and worked through the math to have a look at why my students were getting what I considered fairly different numbers for the same 500mm.

(warning, basic maths ahead)

If we take the diameter of the NXT wheels as 56mm (as written on the side) we get a circumference of:

c = pi * d
c = 3.14 * 56
c = 175.84

To go 500mm, we divide 500 by the circumference
x = 500 / 175.84
x = 2.8435 rotations
x = 1024 degrees

But I was finding that some kids needed more than this. Let look and see what happens when our wheel diameter shrinks by 1mm due to either a hot days softening the rubber or a heavy robot, both conditions which will cause the rubber tyre to sag, and hence a smaller diameter. Both conditions are entirely plausable and could infact result in more than 1mm deflection.

c = pi * d
c = 3.14 * 55
c = 172.7

x = 500 / 172.7
x = 2.8952 rotations
x = 1042 degrees

So there you go, 1mm difference in the wheels results in 18 degree difference across 500mm.
The discrepancy is even more pronounced when you are trying to rotate your robot on the spot.

Just something to keep in mind :)

--
Damien Kee

*Update!!*
I may be wrong with this. Check out the comments and put in your 2 cents worth

24 comments:

Anonymous said...

I think you need to re-examine your logic here. I will accept that the circumference of the tire might change due to expansion of the tire material because of increased pressure from weight or heat making the material softer, but you can not mathmatically refigure the circumference of the tire based on diameter, when the tire is no longer a circle due to a flat spot.

Anonymous said...

With a circular tire, a decrease in diameter and thus circumference would be distributed equally. It is possible for a decrease in diameter to occur and cause a 1mm decrease in circumference. Yes, this is assuming a perfect circle and no flat spots, but the math does hold true in Damien's example. Your assuming the decrease is on a specific point on the tire (flat spot) which is not what Damien's example stated. For whatever reason, he is showing that a simple change in diameter will affect the circumference and and even a change as small as 1mm will have large effects. A nice post, Damien.

Bruce

Brian Davis said...

Additionally, it's not actually the diameter that's important in relating the distanced traveled to the number of degrees of rotation. The thing that matters there is the distance between the axle and the point of contact with the ground. The shorter that distance, the more you have to rotate to go a fixed distance. So yes, a flat tire does have an effectively smaller radius.

Notice that this points out some other issues - such as the fact that a start or stop induces forces that may not only make the wheel slip, but can compress or decompress it slightly as well, changing that effective radius. Often for accurate motion, hard tires (not compressible ones) are the best best, for exactly this reason.

--
Brian Davis

Robert Sim said...

I don't think compression of the tire is an issue- whether the tire is compressed or not there is 0.056*PI worth of rubber in a complete revolution (squishing the tire will not change its circumference- try the same thing with a loop of string 10cm long- the loop remains 10cm in length no matter what its shape).

I doubt temperature makes much of a difference, either, since the kids are all presumably working with the same ambient temperature. But, as Brian points out, slippage will indeed be a factor, which depends on the acceleration of the motors at start/stop and the surface the robot is driving on. I suspect that you would find that, for equal accelerations, heavier robots are more accurate than light ones since the static friction between the tires and the surface will be higher.

Al Gunn said...

Seems like a little experiment here would be fun. Two identical vehicles with different weight loads.

Jim Kelly said...

The nice thing about posts like this one and the added comments is that it's a great discussion-starting question for teachers as well as a hands-on activity for students to try out.

We should try to have more of these types of posts and discussions.

Jim

Anonymous said...

The difference in degrees is less than 2 percent. Depending on your task, the variance set forth in the example might be material, or it might not be.

For the science-minded, it certainly seems material. However, for the non-science minded among us, it is "close enough." After all, as we are constantly reminded, this is a $250 toy, not a precision instrument. So, you get 1,042 degrees instead of 1,024. My course of action is to adjust the tools to take this variable into account, so that if we have to change robots, the difference will have no effect.

This is not a real "science-y" approach, I admit, but it works. And when the FLL judges are scoring the table, I'm more concerned with what works, than trying to explain to my squirrelly little robochickens (i.e., team) why the wheels don't always work the samw.

Nice post, though. I had never considered the tire variables. Thank you for explaining this in a way that even I can understand it.

Kurt said...

While it might have been more accurate to use trigonometry rather than geometry to explain this, I think the result is still the same.

The only comment that I would take issue with is the statement that this discrepency is even more pronounced when you are trying to rotate your robot on the spot. It is unlikely that you are turning one wheel more than 500 mm to rotate the robot.

I think the bigger effect results from the tread pattern of an NXT tire. Notice how the treads alternate right and left of center. Depending on what part of your tire is in contact with the floor when you rotate your robot, the pivot point of the robot might be the center of the tire or it might be right or left of center. Depending on which it is, your turning radius might be smaller or larger than it was the last time, requiring the other wheel to move fewer or more degrees to move the robot to the same place. (Same circumference of a circle logic).

222doc said...

One thing to think about is the flat spot is always closer to the center axis it does not rotate with the tire and move away unless you have lite bot that has old flat spot tires. So if the tire is being deflected say to the max flat it can ie to the rim, the true dim. is the center of axis to the flatspot since the flat spot is always at the bottom and never moves away. This is why i did not use rubber tire in the ANxT comp the tires under 30 to 1 loads would. A: go flat and even come off the rim.B: as the weight increased the distancwas a lot more than empty much more i had to add full rotions.

Dean Hystad said...

When converting wheel rotation to travel distance a flat tire has the exact same effective radius as a fully inflated tire. When I first learned this I thought it was completely counter-intuitive. Now it makes total sense to me and I wonder how I ever held any other view.

Tire manaufacturers use the term "rolling radius" when discussing the relationship between wheel rotation and travel distance. The rolling radius is the tread length divided by 2 pi. They hold no allusions that their products are circular. They veiw a tire as a tread which is supported by the sidewalls. The shape of the tread is unimportant, the length is all that counts.

When a tire makes one full rotation the entire tread has come in contact with the ground. Unless the tire is slipping the wheel must have moved forward the same distance.
I learned this strange fact while installing an aircraft tire test machine. I was running a B-52 tire throught a simulated landing. During the landing event the distance between the wheel axle and the ground dropped to less than 25% of the measured radius of the tire, yet the ratio of wheel rotation speed to ground speed was unchanged.

I now think of tires as being more like belts than circles.

222doc said...

In a perfect world that will come out true but since a flat tire is closer to the ground it is less distance from the rim. So it is less distance around. Something must give here. In the real world if a car tire runs low it causes heat in the rubber. Why? The rubber is trying to make that full circle but the real dimension is now smaller. At some point something will give. In a low-pressure tire you end up with a blow out and extra heat the tire is not designed to handle. Do to under inflation or over loading, that forces the rubber to give or slip and bulge just ahead of the flat, in the end ether way you will end up on the rim with no tire a blow out. All Lego tires failed in the ANxT experiments that were moving up to 100pounds of weight, or from 15 to 50 to 1 weight. Everyone that got to that high in ratio went to a non-rubber tire or just road on the rims. Do to tire failure lack of control.

Dean Hystad said...

Heat is generated in a flat tire because the rubber is flexing going into and coming out of the flat area. The sidewalls are also changing shape as they deform to allow for the change in distance between the tread and the wheel. It takes a lot of force to deform a tire, and if this goes on continuously it generates a lot of heat.

Damien Kee said...

Kurt, what I meant to say was that when rotating on the spot, wheel base distance also becomes important, ie. discrepancies in distance between wheels will also contribute to variations in values.

Dean, I understand what you are saying about rolling radius, but I was wondering, given the shape of the NXT tyres, in that they are balloon shaped and not flat contact witht he ground like the old RCX tyres, would it be possible the compression of the rubber (in the direction of travel) would allow the effective radius to be shortened.

Brian, Robert and others, Am I just seeing wheel slippage? We run on a very low power and can't observer any slippage between the tyre and the ground. Could there be slippage between the tyre and the hub?

damo

Damien Kee said...

-rant-

Anonymous, I agree with the fact that it is just a just a toy, but when working with students, I like to have an answer when asked "why is mine different to theirs?"

It's unfortunate but the education system these days seems to condition kids to believe there is only one correct answer. They are constantly preoccupied with getting the 'right' answer, and if the group before them needed 1024 to get it 'right', then why when they put in 1024 is it not right?

-/rant-

damo

Damien Kee said...

al gunn,

experiment on it's way :)

damo

Brian Davis said...

Dean, after thinking about it not only does your reasoning make sense, but leaves me with exactly the same conclusion you state, i.e., "why the heck didn't I see this earlier?". Oh well, it's more fun to eat crow in front of a large internet audience :) . I think the problem was I was actually thinking about the tire tread as *not* rigidly connected to the axle... but of course it is (by the sidewall), and must share the same angular velocity.

Dang. And I call myself a physicist :|

Damien, I'm not sure exactly what you're seeing - slippage, flattening of the tire resulting in a different point of contact (which could indeed explain why it would effect turning perhaps more than straight line travel), etc. Sounds like some detailed experimentation is in order. I also understand your rant - but there is a good lesson here as well. There is almost always, *always*, something that you can't account for... yet if you want your robot to work, you need to try. You need to constantly watch for the unexpected, and when you see it, dig into it, investigate it... don't just sweep it under the rug and ignore it as an "irrelevant detail" (something that happens far too often in many intro science classes).

--
Brian Davis

Dean Hystad said...

One other thing to remember is that in the example given the error is less than 2%. I'd be REALLY happy with a 2% error on a half meter move.

Fay Rhodes said...

This is a great post---especially helpful for teachers. Why don't you solicit teachers to carry out your tests in class and report results?

Jim Kelly said...

I like Fay's idea and I'll add something to it:

Teachers, if you have a question or an experiment or puzzle you need some help with, post a question on our forum or email me details and I'll see about getting some of our contribs to help out.

Jim

David Levy said...

"In theory, there is no difference between theory and practice, but in practice there is."

Eric D. Burdo said...

David - Nice quote. :)

And Dean - Thanx for that explanation. I'm with Brian on this. Now that you explain it that it, it does make sense.

I think I have my topic for todays class. I'll see what my kids think :)

Dean Hystad said...

When it comes to slippage you have to remember that any time you accelerate, even a tiny bit, the wheels will slip. The amount of slippage may be small, but it is always there. The big problem is that the slippage is not consistant or predictable. About all you can hope to do is keep it within a managable amount and use additional sensor information to zero out the error.

Slippage is a killer in odometry, and is the reason that when accurate odometry information is needed it is not taken from the driven wheels. Idler wheels attached directly to encoders are used instead. The idler wheels are usually metal disks with a thin layer of rubber. This design is used because it is very difficult to manufacture balloon tires to the desired degree of accuracy.

Dean Hystad said...

One last bit here. I just re-read the original post and saw that temperature was mentioned. This is true, but not for the reasons given. Temperature and humidity can cause significant changes in friction coefficients, resulting in a noticeable change in odometry error.

I remember an FLL team from a few years ago that used the light sensor to calibrate their rotation sensor. They drove the robot between two lines on the table and calculated the rolling radius of the tire. This value was then used to convert travel distances into rotation sensor counts. The team could change wheels, run their calibration program, and then run all their existing programs without having to use the programming software.

I thought that was pretty cool.

Anonymous said...

I like your math view on the subject.My 8th grade teammates think its trial and error.I want to bring math to the FLL.

Related Posts Plugin for WordPress, Blogger...