04-08-2012 05:54 AM
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.
04-08-2012 07:04 AM
04-08-2012 09:54 AM
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.
04-08-2012
04:41 PM
- last edited on
06-03-2024
03:36 PM
by
Content Cleaner
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:
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