Sign in to follow this  
brain21

3 wheel bot motion

Recommended Posts

Hi everyone, I'm trying to simulate a 3-wheeled robot, but only 2 of the wheels actually drive. So it's like a tank, but on wheels. Each wheel can go a different speeds. Right now I have an ok sim for it, but it breaks up many time. What I did is drew the two wheel speeds as vectors at the middle of each wheel and then drew a line from the end of one vector to the other. If it doesnt cross the axle that connects the two wheels, then I keep drawing till it does (and extend an imaginary line as a virtual axle). Then I use that point that this line intersected the axle as a rotation point for each wheel/axle point. I then figured out the degrees of rotation around this point by dividing the distange I have to travel with that wheel by the circonference of the circle created by that wheel and the rotation point. Then I rotate the wheel around that point. Whoa! that was alot to write!! Right now I cant get it right cause sometimes I want to forwards with one wheel and backwards with the other or both wheels forward at the same speed. This gives me divide by zero, and I find myself putting in some conditions, lots of them on everything. Is there an easier way of doing this?? Has anyone been there before? Brain21

Share this post


Link to post
Share on other sites
Why does going forward with one wheel and backwards with the other cause a divide by zero? Doesn't that just put the axis of rotation directly between the wheels?

For the case of both wheels going at the same speed in the same direction, the divide by zero is from trying to find the intersection between parallel lines. In the intersection finding code you should be checking to see if the lines are nearly parallel (divisor close to zero), and if they are that would be a special case.

Share this post


Link to post
Share on other sites
(assumption, the 3rd wheel is a frictionless castor wheel that does not affect motion whatsoever)


I would totally throw out calculating the center of rotation circle thing...

Just use a relaxation approach.
each time interval, each wheel moves forward in a straight line based on it own rotation speed and the current body orientation.
At this point they are no longer the same distance or pointed the correct angle to one another; draw a line between them as the New axle, then push each wheel along that to be the correct axle width. (correcting this wheel dist is the 'relaxation' step; it may need repetition as each wheel also needs to be adjusted for gravity and other forces)
Use the newly calculated axle and average centerpoint between the wheels to calculate the new position/orientation for the body.

This is a nice approach because it is relatively simple in terms of calculations, but can be adapted to handle non-level ground compared to the circle arc thing...



alternatly, if you really want to go with the calculated route...
there are possibly better ways to find the center of turning circle
ie- avg wheel speed determines distance traveled along circumference per timeunit
difference in wheel speed determines change in angle per timeunit
given those two values as functions of time, system of equations can be resolved to find a circle radius...

Share this post


Link to post
Share on other sites
ok, thanks. Yes, the third wheel is a caster (non friction). Which way would be more real. What would simulate a real 3-wheel vehicle better?

brain21

Share this post


Link to post
Share on other sites
Quote:
Original post by brain21
ok, thanks. Yes, the third wheel is a caster (non friction). Which way would be more real. What would simulate a real 3-wheel vehicle better?

brain21


More real?
Thats irrelevant here, they're all nearly as good/bad that you're not going to notice. If you want super realism you have to look into rigid body sims, friction models for tires, etc, lots of painful stuff.

Better?
depends, on flat ground any of the methods ought to work (except for that one that divides by 0 and crashes of course)
I did mention tho, that a greedy relaxation method would probably handle uneven ground easier than arcs/circles; dunno if that matters or not for what you're doing...

just go with what works
a div by 0 is pretty easy to fix actually... so you might just stay with your current model unless it has other glaring issues...

Share this post


Link to post
Share on other sites
The ground will always be level (as far as I know). The divide by zero was not my only problem with the arcs/circle method. Sometimes it would not rotate correctly becaus eI didn't know what way to rotate it. Sometimes the point would be to the left of the left wheel, so everything would rotate CCW and other times it was to the right of the right wheel and we would rotate CW. Sometimes it was in betweeen the two wheels and one would rotate CW and the other CCW. It was this that confused me and I just thought there should be an easier way of doing it. Like one equation instead of many steps.

I will try the method presented and see what happens. Thanks again.

I'm just making a simulation of a 3-wheeled robot before I try to build one. I'll put some sensors on it and test it out virtually instead of real life. That should give me a good idea to where to place the sensors in real life.

Thanks,
Brain21

Share this post


Link to post
Share on other sites
The ideal way to get started with wheeled mobile robot simulations is to stick to kinematic models. If you have a bounded turning radius you should look at the simple car model http://planning.cs.uiuc.edu/node658.html

Following this approach allows you to easily add constraints for maximum applied velocities, or alternatively to move to a dynamics based approach where you are applying a force (see later in the referenced book).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this