Translation the shaft encoder data

Hi All ,

Have a nice day

  I am designing a robot in real world and i want to plot everything in X,Y (Cartesian) coordinates , I just want to use the encoders of wheels to determine the current position of mobile robot and its orientation depending on a specific calculation formula even if it will lead to inaccurate calculations .

Actually , I found out this formula below to compute x, y coordinates from encoder data but I still confused in some sides of this formula

XY1.jpg

XY2.jpg


cm = conversion factor that translates encoder pulses into linear wheel displacement

Dn = nominal wheel diameter (in mm)  

 

about 20 Cm

 

Ce = encoder resolution (in pulses per revolution)

 

Encoder resolution: 1000 state changes per 3 wheel rotations

 

= gear ratio of the reduction gear between the motor (where the encoder is attached) and the

drive wheel.

Gearbox ratio: 86.8:1

 

I had a Rover 5 chassis form Dagu with two normal DC motors and two encoders (incremental rotary encoder) per each wheel, how could I translate the pulses of encoders or how to work out the x.y position of the robot based on the shaft encoder data.

There are also 4 small wires with female headers. RED is +5V for the encoder , BLACK is 0V (ground) , WHITE is signal A , YELLOW is signal B . The impotent wires in each encoder are signal A and signal B ,so 

How to get values of N, N from the formula above according to signal A & signal B ?

Is the value of Nis the direct value from  wire signal A or signal B ? the same question for N. 


 Actually, also I found the post (https://www.robotshop.com/letsmakerobots/node/24031) that Mr. OddBot posted it which explain how to measures the speed and direction of a rotating shaft by using quadrature encoder, but I didn’t know how to function that post in useful way to solve my problem .

Thanks a lot

Are you asking us to do your schoolwork for you?
We answered you last time with enough information to find the algorithm or even a program to do this. Perhaps there is another answer in the “TopTips” menu. Have you tried to look for the book “The Robot Builder’s Bonanza” by Gordon McComb?

Have you talked to your teacher or fellow students?

What exactly don’t you understand? I won’t write code for you, but I may be able to answer very specific questions.

If you can’t understand doing this on a balancing robot, try the encoder part on a very basic robot (two motors and one caster). That will prevent you from having to learn it all at once. Or, if the encoder is on the wheel instead of the stick, you can just turn the wheel slowly to see what signals you get by using LEDs or sending text back to a terminal; better yet would be the use of a logic analyzer or an oscilloscope.

One quick hint: I think that formula is for a single encoder rather than a quadrature encoder like I believe you have. A quadrature encoder gives more information and you can determine which way the wheel is moving.

I wish you luck and would like to hear how this project comes out.

Dear many thanks to you
Dear many thanks to you ,

What I don’t understand exactly is what is meant by pulse increment of NL , NR , is it the direct pulse form the encoder wire ?

and which wire ? each encoder has two wire one for signal A and second for signal B ? which one should deal with ?

and if there is any written code that could help me , that will be high appreciated

thanks a lot

Typically a and b are two
Typically a and b are two square waves offset from each other. By measuring the changes of each of the signals, both low to high and high to low, you will have. Four times as much accuracy. In addition, by knowing the relationships between a and b you can determine the speeds and directions of each wheel.

Most of the sources I suggested looking up will have the complete information in it. I would especially look at hobby robotics because they are more likely to have have the information in an understandable format.

This is as far as I am willing to go on this subject. It is your school project and I’m sure that they intend for you to learn this on your own. You don’t even seen to be willing to look up ANYTHING about your own project.

PS. To those I argued with early in my tenure here, again I formally apologize. This includes OddBot and bdk6, among others.

You need the wheel circumference as exact as possible
The wheel diameter or circumference needs to be as exact as possible for the odometry equations to work correctly.

Since the number of encoder “ticks” determines how far the robot goes, and converting this into a distance depends on knowing the circumference (or diameter) of the wheel, you’ll have an error if you use 200mm when it is really 210mm.