0
$\begingroup$

Rosanswers logo

Hi,

I want to buy wheel encoders to fix with the wheels of a car.

Can anyone suggest simple encoders that they have already bought and interfaced with ROS?

It would be of great help if you could share your code too?

Thanks & Regards Sriram


Originally posted by b-sriram on ROS Answers with karma: 105 on 2016-09-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The simplest setup is to use motors with wheel encoders built-in, or motors for which stock encoder modules exist. Barring that, the best setup is if you have access to the back shaft of the motor (before the gearing). You should be able to set up an optical or Hall-effect encoder on that side.

If you have an actual car and want encoders for the wheels, you could either go an optical route, with some sensor mounted on the axle looking at stripes mounted on the wheels somehow, or perhaps Hall-effect magnetic sensors. But if you have an actual car, you might find it easier to read the existing odometer cable and combine that with the amount of steering to infer the pose changes.


Originally posted by Mark Rose with karma: 1563 on 2016-09-13

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by b-sriram on 2016-09-13:
Hi Mark,

Thanks for the answer. Yes as you said reading the odometry cable is the bes choice but unfortunately that is not an option I have. I'm working with an actual electric car, so its powered my a motor with an built-in ecoder. Will reading that give me an accurate distance measurement?

Comment by b-sriram on 2016-09-13:
I'll write a program to calucate the distance using the encoder ticks. Or should I use a seperate encoder as you suggested and interface it with the backshaft?

Comment by Mark Rose on 2016-09-13:
If you have access to the motor encoders, that would be best. I have mostly worked on differential-drive systems, so there is a simple strategy for using both encoders. I presume your car has Ackerman drive. The math is different, but if you have steering, then slippage should be small.

Comment by Mark Rose on 2016-09-13:
As far as using the encoders, you'll get two bits of input, call them A and B. They will cycle through 00-->01-->11-->10-->00, or the opposite order. If you concatenate the old and new inputs into a single 4-bit value, you can do if-else or switch to determine whether to increment or decrement.

Comment by Mark Rose on 2016-09-13:
Alternatively, if you get interrupts only on changes to the A input, then code like this will suffice (or might have the wrong sense, depending on your wiring):

if (A == B) {
    ++ticks;
} else {
    --ticks;
}

There are also packages to do this, depending on your hardware.

Comment by b-sriram on 2016-09-14:
Hi, Thanks a lot again. I'll first look into to the encoders and try to code them as you suggested and get back to you when I have some results

Comment by Mark Rose on 2016-09-14:
One more thing: your motor controller may already be reading the encoder inputs, and there may be a way of reading a cumulative value from the controller. (Don't know anything about your hardware, of course.)

Comment by b-sriram on 2016-10-04:
Hi Mark,

really sry for the late reponse. I finally got to know more abt the controller. It is a Curtis 1236 motor controller and it is communicated with curtis 1314 programming software which uses VCL. Coming back to your question, yes the encoders are already connected to the controller.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.