LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to represent rotation of robot with 2 wheels?

Hello,

 

My case is: I have a robot with two wheel. The objective is to find the algorithm that show when the robot actually turns. After some programming, I have 2 encoders and I can see if they are going CCW or CW. My assumption is that when the two are CCW or when the two are CW. The object keeps going forward. When one is CW and the other one is CCW the object is rotating or the other way around. This is easy in words but I need help to do that in labview.

 

Thanks.

Mechanical Engineer
0 Kudos
Message 1 of 4
(4,319 Views)

If the 2 wheels are opposite on the same axis the object will rotate if you command both motors CW or CCW and will go forward (or reverse) if you command one CW and the other CCW. The rotation direction is usually define when facing the output shaft.

 

Ben64

0 Kudos
Message 2 of 4
(4,317 Views)

From your encoders you should get the angular position of each wheel,  Sampling this vs. time and using you should calculate the angular velocity of each wheel.  From the angular velocities of each wheel you can calculate position heading and velocity of your bot using the 2-wheel kinematics model (the precision of this will be limited by the unknown slipping of the wheels vs surface but assume no slipping for now).  See the following link for the kinematics model and mathematics behind it (just simple matrix manipulation): 

 http://pgbot.googlecode.com/svn-history/r56/trunk/ressources/Motion-control.pdf

As for representing this in labview I would plot angular position of each wheel vs. time as well as calculated angular velocity of each wheel and position linearly(vector) velocity and heading of your plot vs. time (relative to an initial position and heading).  You can display your bot in  the current environment using a picture control in labView if you want to get fancy. 

 

It has been 10 years since I had to last calculate the kinematics of a 2 wheel autonomous robot so some of my info might be a little rusty.

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 4
(4,310 Views)

Marwan,

 

The wheel setup you describe is a differentail steering layout.  The velocity of the robot can be described by a forward velocity (y_dot) and a CCW angular velocity (theta_dot) about the midpoint between the wheels.  Given the known CCW angular velocities of the wheels (phi_l and phi_r), you can calculate the robot's velocity with these equations:

 

theta_dot = (1/W)*(Vr - Vl)

y_dot = 0.5*(Vr + Vl)

 

W = separation between wheels

Vr = forward velocity of right wheel = -Rr*phi_r

Vl = forward velocity of left wheel = Rl*phi_r

 

Here's how you could do this in LabVIEW:

differential steer_inverse.png

 

If you have access to the LabVIEW Robotics module, you can use the built-in Steering API to do this, which allows you to convert between wheel and robot velocity for any wheel configuration.

 

Chris M

0 Kudos
Message 4 of 4
(4,293 Views)