Translating velocity and angle into wheel speed (for a two wheel robot)

In summary, the conversation discusses the process of coding a controller for a two-wheeled robot and the need for converting speed and angle measurements into the velocity of the robot's wheels. The specifics of how to calculate the wheel velocities are discussed, taking into account the distance between the wheels and the desired speed and angle of the robot. The conversation ends with a thank you for the clarification.
  • #1
Marcos_84
3
0
Hello.

I'm coding a controller for a two wheeled robot whos speed and angle is determined by the velocity of it's two wheels.

The problem is, my code does calculations using speed (mm/s) and angle (radians).

So I need someway of converting that speed and angle into the velocity of the two wheels of the robot.

It sounds really simple but I just can't work out what the exact forumla is.

Any clues?

Thanks!
 
Physics news on Phys.org
  • #2
Speed I am guessing, is the speed of the robot. But what is the angle? Is that rotation angle of the wheel or direction of travel?

You need to be very specific about the smallest details if you want help. We cannot see your robot or read your mind, you have to tell us.
 
  • #3
Yes, the angle is the direction of travel of the robot relative to it's current position. The wheels are unable to 'steer' as such. Rather, the robot turns by altering the velocity of each of it's two wheels.

For example, if I passed a function two values, speed=20mm/s and angle = +0.4radians I need that function to convert to the speed of each wheels which should end up something like left_wheel=18mm/s, right_wheel= 21mm/s. So that the robot will then travel at a speed of 20mm/s at an angular velocity of 0.4 radians.

Hope that makes sense.
 
  • #4
It's still not clear what you mean by passing the angle. What you can control is, rather, the rate of change of that angle, just as you control the speed or rate of change of position.

If you want the robot to go a 20 mm/s, then the circumference of the wheels has to move 20 mm/s. Since the circumference is [itex]2\pi R[/itex], where R is the radius of the wheels in mm, that would mean that you want the wheel to rotate a fraction [itex]20/(2\pi R)= 10/(\pi R)[/itex] of its circumference and so that same fraction of a whole rotation, [itex]2\pi[/itex]radians: you want both wheels to turn at [itex]10/(\pi R)(2\pi)= 20/R[/itex] radians per second. In general, to move x mm/s in a straight line, the wheels will have to turn at x/R radians/s.

In order to turn, one wheel will have to turn faster than the other and to have ONLY a turn, one wheel will have not turn at all. To turn and move, add the "turning" speed to the "moving" speed of one wheel. In order to turn an angle an angle of 0.4 radiansper second, you will have to take the distance between the wheels into account. If the distance between the wheels (axle length) is L mm, a 0.4 radian turn will cover a distance of 0.4L mm. In order to have moved that in one second, the wheel will have had to turn, as above, 0.4L/R. More generally, in order to turn at y radians per second, the "outside" wheel will have had to turn at yL/R radians per second.

In order to move forward at x mm/s and turn at y radian/s, the inside wheel will have to turn at x/R radians per second while outside wheel turns at x/R+ yL/R= (x+ yL)/R radians per second. Again, R and L are in mm since x is in mm/s and y is in radians/s.
 
  • #5
OK. That definitely clears things up for me.

Thanks a lot for the help.
 

FAQ: Translating velocity and angle into wheel speed (for a two wheel robot)

What is the purpose of translating velocity and angle into wheel speed for a two wheel robot?

The purpose of translating velocity and angle into wheel speed for a two wheel robot is to control the movement and direction of the robot. By determining the desired velocity and angle, the robot can calculate the appropriate wheel speeds to achieve the desired movement.

How is velocity and angle translated into wheel speed?

Velocity and angle can be translated into wheel speed using trigonometric calculations. The velocity and angle are used to determine the linear and angular velocities, which are then converted into individual wheel speeds based on the robot's dimensions and wheel placement.

What factors can affect the accuracy of translating velocity and angle into wheel speed?

Some factors that can affect the accuracy of translating velocity and angle into wheel speed include variations in wheel size, uneven terrain, and wheel slippage. These factors can cause the actual wheel speeds to differ from the calculated speeds, resulting in a discrepancy in the robot's movement.

Can the same method be used for all types of two wheel robots?

The method of translating velocity and angle into wheel speed can be applied to most types of two wheel robots. However, the specific calculations and adjustments may vary depending on the robot's design and capabilities. It is important to carefully consider the dimensions and capabilities of the robot when translating velocity and angle into wheel speed.

Are there any limitations to translating velocity and angle into wheel speed for a two wheel robot?

One limitation of translating velocity and angle into wheel speed is that it assumes the wheels have equal grip and can move independently. This may not always be the case, especially on uneven or slippery terrain. Additionally, this method does not take into account external forces such as wind or friction, which may affect the robot's movement.

Similar threads

Back
Top