AutoParking-Small Vehicle

It's been a time since I last wrote a tutorial so, I hope I best write this new one for

the needs of those who are willing to include some more maths into there creations.

 

What I'll be showing this time is a robot that can park into some given space. The robot will seek some open space at one direction and if this space is found and it's larger (or better longer) than some of the length of the robot, then the robot will start to settle in this position. This would be very easy for a robot doing differential driving, but doing Ackerman steering things can be a little more complicated. We will talk about methods of steering later and do some analysis.

 

So why do we need a vehicle that can park itself in a given space?

Well how many of us have cars? How many of us drive everyday some long roads and then also need to find a good spot for our cars. Fortunately or not, most of us. And it still comes that many many of us have cars but we use them for driving to our jobs and parking is some times wasting our times cause of the hard maneuvers and blind corners on the car. But what if our car can park itself? It would be a lot more easy and fulfilling not only driving but also owning that car. While we don't waste our time parking we can quickly go to our work space and let the car park itself alone! Cool eh???

 

It's true that most of us use the car to go to our works everyday and have non or little will to perfect our driving skills. And it's also true that with most driving schools our skills on driving can not overcome experience gained by ours of driving. So, the more easy they give out license they easiest driving must be. And that's some of the reasons I've been building this autoparking robot.

 

So now let's move on and see about steering methods -->

 

 

Disclaimer:

I'm completely against automating driving and even against my own project idea. Why? Because I think of driving as a pleasure, and not a chore, as it should be. Using it to blow off steam but also as a form of "power" and of course freedom. Also I'm completely against authorities controlling driving. Driving is an expression of character, not to say a part of society that you can see a man's character even better. I'm also against easily given licenses (like as mine) cause of the very little experience of the driver on open roads. Drivers today learn to drive conservatively cause of the fact that most of them have very little experiences on the roads... BUT also most of them will push the pedal when they must not or when they can't so there are crashes deaths and more on... My moto can't be don't drive fast or don't speed cause I would look most foolish... but having some closed track experiences with my car, I can say that I may have some more experiences on how my car handles on a road. Driving is most of all feeling, feeling of the car, of conditions, on surroundings and of course statistics if I can call them this way... you have it or not... If don't please only use it wisely or prefer public transit. Making the road more unsafe isn't the option especially when there are motorcycles around that deserves most of respect, cause of the driving conditions, on the road.

Finally if you think that I promote speeding, no I don't, I promote having the "feeling" or driving, fast or not... you know... Prohibition is the wrong way, cause I would as well know where cameras and cops are... But also having the "feeling" is something that needs experience time and patience that also people these days have lost... resulting of losing our most loved once...

 

Peace Brothers...

 

Have respect for others and don't drive your feelings over your mind.

These ideas are mine and as well may not be come to agree with forum members or the owner of the site, there are here to promote awareness and not unrest so if you strongly think that something should be removed or altered please inform me politely and we can come to an agree point. I know that there are young readers but knowledge should be past with on with wisdom and not prohibition or discouragement. Also my point when posting tutorials as an academic student is to educate and not only pass on information, so if you think of different please don't even bother to call all the above offensive (disclaimer) or don't stop reading the rest of the tutorial.

 

Thank you, Lefteris

Thessaloniki, Greece

Aristotle University of Thessalonikh

Steering methods

In this part of the tutorial we will be talking about the two main ways sychronous vehicles use of steering:

It's Differential steering and Ackerman steering. Also omni wheels have been lately introduced to robotics but I haven't seen any big vehicle using them. If you have information please contact me at my email at the end or the tutorial if these wheels have been used lately in any vehicle so we can make the tutorial even more reliable.

 

Still before talking about steering methods we need to talk about degrees of freedom also known as DOF and 2D systems of coordinates.

 

 

Degrees Of Freedom (DOF)

The degrees of freedom describe the way a vehicle can move in a given space. We can however categorize the movements that the robot can do in this space into two major classes. The rotational degree of freedom and the lineal displacement degree.

The rotational as the name suggests is the ability of the vehicle to make a movement in it's given space around a given point in this space, while keeping the distance of itself and the point the same. With other words, it's the ability of the vehicle to make a controlled circling movement around a point. 

circling movement     OR 

 

By this time I think you will be a little like, WT#... Ok... looking at the photos we can understand that it really doesn't matter where this point is... It can be on the physical mass of the object or not, who cares. For example, an engine does has one degree of freedom (and by this time let me only say DOF) cause the shaft of the engine can rotate clockwise and opposite. Of course we can (by our hand) move the engine anywhere in a place but this movement can not be controlled by the engine. To be more correct the engine doesn't have any DOF, but it's shaft has. It can rotate around a single point which happens to be the center of the shaft. For a car if we turn the steering wheel, it can move around a single point that it is outside of the car. Still it has one rotational DOF. A tank can also drive around a single point. However this single point can be anywhere in space including the center of the tank. But this doesn't mean that it has more degrees of freedom. It also has only one degree of Freedom. It's a little bit blurry I know but should things be a little better in time we finish this part of the tutorial.

 

The lineal displacement degree of freedom is much easier to understand. This involves the ability of the vehicle or any moving part, to make a controlled movement in one and only direction. Example can be any vehicle moving forwards or backwards or any lineal actuator contracting or expanding.

solinoid OR1DOF lineal movement

 

 

Now before we talk about the DOF of ground vehicles let's talk about how we can position ourselves in a 2D space. Since ground vehicles on a flat terrain only have to worry about 2D the 3D analysis would be pointless and even more tiring... so we stick it there. ( I know that probably this is one of the most boring tutorials you have ever read but controlling a car in a 2D space isn't as easy as it looks cause to complete parallel displacement it must do a series of complex movements so prepare some good coffee and easy up )

There are mainly two systems of coordinates in 2D space:

 

The cartesian and most commonly used system that it's point in the 2D space is described by two distances, the distance from the X axis and the distance from the Y axis. Of course when we describe a point there is not only distance but also direction (or better if it's at the left or right side of the axis) So values grater than zero are above or at the right side of the axis and values lesser than zero are below or at the left side of the axis. Values that are equal to zero are representing points that are on that particular axis. Let's do an example here so we can better understand this. Let's say we have two points in the 2D space. One that is on the right side of the Y axis and it's distance from it is 3 and is above the X axis and the distance is 4. This is the "tricky" part. The distance is not measured on the same axis but on the other axis instead So for this point let's say P1( x = 3, y = 4). And for another point let's say P2( x = -1, y = -3). This means that this point P2 is below the X axis and it's distance from it is 3 and is on the left side of Y axis and its distance from it is 1. And all these would look like this on the paper (not toilet paper, cause they start not to be single points... :-P )

Cartesian System

The polar coordinates are a little bit more complex both on math and calculating since they involve triangular functions to measure distances from Cartesian axis but that's only for doing the transformation. So polar coordinates instead of the distances from two axis, you got the distance from a single point, which point is called a pole, and an axis from which me measure the angle that forms from the line that crosses both particular point and the pole and this fixed axis. This axis is called a polar axis. Polar coordinated are used in systems that you are more concerted about the angle at which the point is, or the distance. It also makes life easier with integrals but well, I need the readers to keep reading and not throwing stuff at me, of jumping outside their browsers. Mercy! Ok, so let us give a simple example of what these coordinates look like. First of all the distance coordinate or R is a positive number or equal to zero, distance can never be negative. Secondly the angle fi (or theta) coordinate is 0 <=  fi <= 2pi, or 0 <= fi <= 360o. The official S.I. unit is RAD, so it will be better if you get used to pi, or whatever. The transformation from rads to degrees is quite easy. x (rads) = (180/pi) * y (degrees). So for now an example on how to characterize a point in the polar coordinates. Let's say that we have two point's, P1 is at an angle of pi/3 (or 60 degrees) and it's distance from the pole is 3, and another one P2 that its angle is 7pi/6 (or 210 degrees) and it's distance from the pole is 4, what this would look like? Well, I bet something like this

polar coordinates

 

Ok, I know this is getting hell boring but it's the best I can do really, a parking algorithm is a rather complex algorithm, cause not only you got to include the geometrical body of the car, but got also know the true point of steering of the car. This is basically determined by the ackerman angle of the car steering system, but hey, I've gone too far already. Let's get down to basics. How vehicles today, steer or move around a 2D space.

 

The most know type of steering today is the ackerman steering, used in every modern car today, or at least it's basic principles cause today's car steering system use to be far more complex, and ignore some of the dynamics of ackerman steering, but by know I really hate to elaborate on these things ( camber angle, toe angle etc etc etc ). So in this type of steering, we have the two wheels (the front wheels usually) of a four or three wheeled vehicle that they can change their angle or direction to the desired one, forcing the car ( that force is called friction, and is produced by the tires being with contact to the ground ) to change direction. Change in direction means that this force is ideally vertical to the main axis of the car, on which the car goes forward or backwards. But we don't leave in an ideal world so, the force isn't only vertical so, in real cars when steering we are also breaking the car ( I don't mean hitting the breaks, I mean reducing speed of the car). But if this breaking becomes to great for the cars inertia we start to lose grip and our car is out of control, so in FWD and mostly 4WD vehicles it's better, if not best to break before the corner and accelerate through it, something that most drivers ignore and have their cars tipped over. But don't do this with RWD cars, especially if they don't have ESP, cause you gonna look like a merry-go-round unless you know how to truly drive. But enough with driving lessons. We are here to learn car geometry, yup, correct...

Now, we need to elaborate what toe angle is. And how it affects ackerman steering, in order to fully understand the whole concept. By this time I gotta say, that I think the picture on the wikipedia about ackerman streering is wrong, but I gotta talk with a engineer about that and correct it. In ackerman steering the two, usually front wheels, connect to the main body with one rotating joint, so we can say that the steering wheels have one degree of freedom. Then each wheel have its own steering arm, which arm connects to a rail that can move freely. So we have two arms connected to a rail, so the two arms can't move independently. The rail is connected with a simple gear system, that today is hydraulically or electronically assisted, to the steering wheel, so the rail goes where ever you want and wee!!! the car is steering. And nice things can happen, xexexe... But now comes the toe angle, what is the toe angle, well, we talked about the arms that wheels have, but these arms don't necessarily are parallel to each other. If they aren't parallel they form an angle with the main axis of the vehicle which is called toe angle. The toe angle changes the geometry of the steering of the vehicle. So basically there are three conditions you may meet when dealing with toe angles.

 

Zero Toe Angle, True Ackerman Steering, and parallel arms.

That is when the two arms are parallel to each other, or for better explanation when the axis that forms from the joint of the arm with the main body and the joint with the steering rail is parallel to the axis of the main body. When this set up is selected, the two wheels always form the same angle with the main body. This is the first set up ever used in cars. Up to some certain speeds this set up can be used without serious problems, but in higher speeds the loss of grip of the outer wheel and the tire wear can not be neglected so for high steering performance and less braking friction. Toe angle in changed. This is how the car steering system should look like when the arms are parallel to the main body axis.

 

parallel steering arms

 

And when the car steers the cycles that car wheels follow will look like this:

True ackerman wheel cycles

 

 

Now there are two occasions that can occur when changing the toe angle,toe out (or more ackerman steering) and toe in (or less ackerman steering). For example a car set for more ackerman steering will look like this:

 

More Ackerman steering

 

And it look like this when steering:

 

More ackerman set up steering example

 

Now, when we have more ackerman steering set up or toe out, the inner corner wheel is set up to follow a closer inner angle ( or tries to follow a circle with less diameter ) resulting into harder cornering ( the vehicle cornering force vertical to the main body axis is greater ), but you can also expect increased tire wear and in some occasions oversteer ( the car steers more than it's inertia allows it ). This set up is increases steering performance when tight cornering so it's the most common set up you can meet in cars today. When the car steers the cycles that car wheels follow will look like this:

 

More ackerman Steering Wheel cycles

 

The final set up is the toe in, less ackerman steering. In this set up, the inner wheel tends to follow the outer cycle that the outer wheel follows. This of course decreases the capabilities of the vehicle in low speed cornering but also decreases sensitivity to the steering wheel. So such configurations are often seen at NASCARs and/or dragsters where high speed cornering and wheel needing to enter only small corrections is crucial.

 

Less ackerman steering wheel cycles

 

Finally for conclusion we gotta say that ackerman steering has 2DOF or Degrees of freedom, one rotational degree of freedom and on lineal degree of freedom, the fact that parallel displacement does require complex maneuvers doesn't degrease the degrees of freedom.

 

Of course there are other methods of steering except from ackerman steering. The secondly most know and used in almost every heavy armored vehicle a.k.a tanks and/or some personnel carriers, is differential drive. Differential drive consists of two independent wheels of tracks that move freely (on the will of the user but without interfering each other ). The major difference from ackerman steering is that the vehicle can rotate on its center of rotation which is near or the same as the center of mass of the vehicle enabling a turn without any forward speed, then again, some may consider that it has more DOF than ackerman steering but this is wrong. It also has only one lineal degree of freedom, cause it can forward/backward move only in one axis, and one rotational axis. Vehicle examples of differential drive are the tanks and the segways. (Segway is a registered mark or its company and mentioned only as an example etc etc etc)

Leopard 2HEL OR The segway

 

 

Finally, there is also the kinda newly introduced omniwheel drive, or kiwi drive or whatever. It uses some specially designed wheels that produce less to none friction when turned vertically to their drive axis. This enables with the use of three or four wheels on the vehicle but most importantly this set up gains an additional DOF. With this set up lineal displacement is possible on  both axis, and still the rotational degree of freedom exists. So we have 3 DOF, and it's the easiest way to move in the 2D space, but the algorithm does require some trig factions to have a nice head locking ( or direction locking ). Still the purpose of this tutorial isn't omni drive so, I'm not gonna elaborate. And this is the look of an omni drive robot (there are some experimental clarks but nothing big sized really, this type of steering or driving is used for the extra DOF in tight situations and not high speed cornering):

 

3 wheel omni driveOR 4 Wheel omni drive

 

So these are the basic steering methods used today, the most efficient one is of course the ackerman steering, with 2DOF, thus so commonly used today, in almost every car, or at least some of its principles. Secondly and most used due to its maneuverability comes the differential drive also with 2DOF. Omni drive is the most maneuverable but also the one that cost the most to materialize, it's fairly new to the market and hasn't seen almost any heavy duty action, despite the most useful 3DOF, so we can only hope for the future.

 

In the next chapter we are going to see the most simple control algorithm we can easily all use named the P.I.D. and what these letters mean. That probably means more mathematics, but hey you are trying out some fuzzy logic here not a coffee machine...

 

 

Disclaimer: The photos are taken from:

http://www.rctek.com/technical/handling/ackerman_steering_principle.html

http://en.wikipedia.org/wiki/Main_Page

And some from this own forum. I do not own these photos and I mean no copy of someone else work.

My task is to make a tutorial for everyone, if anyone is disturbed by the photos being used here, please

leave a comment and an email and we can talk this over.

Again no infriction is meant and this is for educational

purposes only. Please let me know if there is anything wrong.

Also have a look at some of the rest of the member pages and of course the forum tutorials:

http://www.societyofrobots.com/robot_omni_wheel.shtml

This one should help if you want to know about omni drive better.

 

Best Regards

What is PID control and how to use control methods over AVR microcontrollers

PID is an simple control mechanism that it's been widely used as a control system in many industrial applications. But before getting on the main details let's talk about some basics on control theory. Why we need such control theories???

 

Well, as we know robots are mere slaves that follow our orders but how can a slave without eyes see? Well robots have sensors for feeling the environment and a series of very nice goodies for interfering with the environment. But the robot must also know how much to interfere. Imagine a robot controlling some rockets over Iran sensing world criticism on nuclear weapons. Make it too sensitive and it would be too late for the world. Make it too senseless it would be too late for Iran or itself. I know it's a most far fetched example but such nice examples usually remain on mind. That why we need a control system that isn't based on mere switches ( changes better ). The first principle about this system is that we need some kinda of feedback on what we are doing. This means that if we start to do something we must have sensors to see how wrong we are doing this. If are doing it wrong and not correct then we need to correct ourselves. How much we correct we are gonna see later with PID control. This is called a close loop system or a system with feedback or with a mostly know term "servo". This means basically that the output of the system is monitored by a sensor, compared to an open loop system that the output is never monitored. Then the sensor determines the current state of the machine (or the output). After that the error to the set point is determined ( the difference of the wanted state to the current state and changes are made accordingly ).

 

PID is such a closed loop system that calculates the output of the system based on 3 quantities that are calculated based on the error.

 

 

The P factor (propositional)

 

This is the most basic factor that you are going to meet in a control environment. Many systems are greatly served by this factor only without the need of other factors, but in this tutorial we are seeing all possible out comes. As it's name suggests the output of this factor is proportional to the error.
The is just like this: P = GP(Set_Point - Sensor_Reading)
This factor is calculated later to drive the output to the wanted state. As you can see there is a quantity that I haven't talked before. The GP. This is the proportional gain or simply the gain of the proportional factor. This gain or number better is simply a number, that is calculated based on the system characteristic, but also on the magnitude of the factor on the calculation of the output. Still this is getting too theoretical so we better explain these later with some live fire examples... xexexe

 

 

The I factor (Integral)

 

Before talking about this factor we must talk about timing in systems. Time for microcontrollers is like Mentos. You may see a package as a whole thing but the microcontroller only sees the pills, one by one. We may count time in seconds but what we feel is age. Microcontroller doesn't. The only thing that knows is pills. Each pill may last for x number of time but doesn't matter for the microcontroller, since if power is on, it would be working for an eternity. So what is this all introduction for??? Well, in each pill the microcontroller measures different error, or better it gets a new reading. By now pills are magically transformed into time slots... ;-P It sounds better for a microcontroller. So instead of rejecting the previous error, the microcontroller accumulates the errors. Since the error also accepts negative values this factor would grow infinite don't worry. This factor is useful when dealing with fast changes in the system to the Set_Point and/or the Sensor_Reading but behaves very badly near the Set_Point, and usually if not always in real time conditions in oscillates badly, so it best fits systems that need a quick response but usually the use of another factor is more than a necessity

This tutorial isn't finished....
The user drinks coffee and talk to hotties... see ya later