encoder help

hey, im tryin to program the e4p motor encoder sensors to control the wheels so that they wont slip. Im programming in labview so anh help wud be greatly appreciated…

We’d be happy to help you.

But what exactly are you having trouble with? Reading in encoder data? Algorithms for controlling the wheel slip? What sort of physical setup do you have to work with (do you have non-powered wheels with feedback as well, or something else? Do you have an encoder on each wheel? What sort of drivetrain do you have?)

Please give us a better idea of the details of your situation and we’ll try to help you.

i have arcade drive. Each side has a gearbox and each gearbox has an encoder. I want to program them for Algorithms to control wheel slippage. Can u write me a simple code for me to accomplish this please? Thanks…

We can’t just give you a code to do it. I think you need to think carefully about the situation, decided on a programming strategy, and see if it accomplishes what you want. The reason I say this is that it is not necessarily straightforward to write wheel slip control code, especially with the sensor arrangement you have.

To help you get started, let’s go through a hypothetical code design process.

1.) What do you want to accomplish?
–We came up with the idea to control the wheel slip in software, in order to help reduce the amount of wheel slip we have during matches so we can control the robot better.

Okay, great. That’s where we are now, right?

2.) Brainstorming solutions.
–In a physical system like a robot that we have to program, we have to closely consider the physical behavior of the system and what information we have about it before just diving in to programming–we wouldn’t know what to do! Unfortunately, Labview, C, C++, etc. don’t really have “traction control” blocks or libraries and even if they were available we would want to know what they did for sure before using them on our machines.
–So in order to come up with a solution, lets think about what is happening when the wheels are slipping. We have a wheel, on the ground. How do we get the robot to drive forward? We have a motor, which turns some gears in a gearbox, which turns the output shaft a bit slower based on our gear ratio, which may go through some sprockets and chain to go slower (or faster) which turn our wheel. Our encoder is measuring the speed somewhere in the gearbox, so we’ll have to adjust for the gear ratio…but we can effectively find the wheel speed using the encoder, just by multiplying. So let’s say we know the wheel speed. But if I know the wheel speed, do I know if the wheel is slipping or not?
–The answer is…no, not really. We need more information. If the robot is rolling really fast on the ground without slipping, the wheel speed can still be high. So an encoder on the gearbox isn’t strictly enough to let you do wheel slip control.
–A hint–you can still (and certainly should) use the information from those gearbox encoders to control your slipping, but you need other information in addition to that to accomplish the task. For example, there are many teams who use un-driven wheels (that aren’t powered by the drivetrain, so they won’t slip as much, they just roll on the ground) and have encoders on those, and so they try to match the speeds, so that the driven wheels don’t slip as much. There are other methods you could use, like using an accelerometer to estimate your actual speed and comparing that to the wheel speed so that you could make those match. That way you wouldn’t have to add more wheels. But it might not work as well and may be more difficult to do, because you’d have to learn how to use an additional kind of sensor.

I hope this helps–but don’t be alarmed if this raises more questions than it answers–that was the point.

What Nikhil said.

The first step in writing a program is to know what you want it to do. Then you have to figure out how to do it. Forget about software for a moment and think about how a human driver would control wheel slip. Once you have a good idea of what the driver needs to do, you can try to translate that into something the computer can do.