What kind of sensor can be used to improve precision of movement on the floor

Hello, I am building a hobby robot project, I have a threaded robot platform with 4 threads each powered by own motor. All these motors are controlled using 2 channel l293d motor driver (each side one channel). Speed of each side is controlled using PWM.

I can easily move the robot in all directions, but my problem is, that since I want to control this robot remotely (from larger distance - there is raspberry PI mounted with cameras with internet connection) I need it to be able to execute commands like "move forward 60 cm", "turn by 90 degrees" etc.

This is where my problem is - while these motors are moving relatively well, it's really hard for robot to estimate its position in space. It doesn't know how much it traveled, it doesn't know how fast it is going, or how much it turned. Right now it's hard to even make it go straight for even short distances by its own without correcting its path manually (depending on surface, it sometimes starts leaning either too much right or left while going forward too long, pretty much like if you drive your car with eyes closed even on straight road, you eventually crash). I want to be able to make software correct this path so it keeps going precisely straight.

I think this could be easily fixed in software if there was some optical sensor, similar to what computer mouse has, basically just put this sensor under and have it scan the movement. I think my robotic vacuum cleaner has just this thing, but I couldn't find these sensor anywhere. Do they even exist?

I was even thinking maybe I could just salvage it from some old computer mouse and connect it via USB to raspberry, then I should be getting 2 axis movement data from it right? Like if you move a mouse?

How is this normally solved? What kind of sensor can be used for this?

P.S. this robot also has 3 distance ultrasound sensors. I also bought mpu6050 accelerometer, but I don't even know how to work with it, nor how its data are useful for me.

Why not try? It won't report rotation, though...

I definitely hope you are not asking us to explain that. Any common IC like that is fully documented online. Especially any that are commonly used with Arduino, in that case there will be libraries, tutorials, code, documentation, all over the internet.

I probably will, but there are two problems with mouse sensor - it seems it only works when it's VERY close to surface and the distance from surface probably has very small tolerance (it can't be too big nor too small, just try to lift your mouse few cm above your table and you will see it stops responding.

This might work for super even surfaces, but on surfaces like carpet, or ground, unlikely.

No I was just wondering if that isn't something that could help accomplish what I need. I already downloaded some arduino libs and hooked it, but it was just reporting stream of numbers that were slightly changing as I was moving it. I really think all it can do is report acceleration and deceleration, maybe turning, but I doubt it's anywhere as precise as I need. Especially - it can't tell me if I am moving too much sideways or distance I traveled.

Well, you are mainly correct about that, because converting accelleration to position depends on numerical integration, which suffers from cumulative error. In other words, positional errors continue to increase, the longer the acceleration is used for measurements (in lieu of something to correct it, like an actual position fix).

May I say, you shouldn't treat this as a new problem. It's the same challenge faced by every mobile robot design since the first one. So the research and techniques are well established. You can easily research it yourself. If you want Arduino specific projects, just include the word in your search string. Use the "search forum" feature in the top right of the site page.

So, basically my question is - are there any sensors for this? Or how is this commonly solved? I don't think I am first person on this planet that is having this kind of problem :slight_smile:

That is what I am saying, you are treating this problem as if you are the first person. You're not. You can sit here all day waiting to "catch a fish" - someone who has done it and has the time to post about it, or you can go to the "free fish market" and help yourself to whatever you need.

Money. $$$$
Research.

Yeah, but that's essentially what I am doing here - research by asking others who might have faced the same problem, hopeful that they might tell me how they have solved it. So that I don't reinvent the wheel. This must be very common problem in robotics.

This must be very common problem in robotics.

Indeed, and there are countless robotics sites with tutorials. The Arduino forum is not one of them, although your question comes up very frequently.

Search for "distance measuring with wheel encoders", SLAM "simultaneous localization and mapping", "indoor localization", "robot indoor navigation", etc.

To make a finer point, to some degree that is unavoidable as robots are all very different. Of course you don't want to re-invent something but you will usually have to re-engineer it for the specific requirements of the robot, even though it is something that has been used many times.

Yes, consulting a forum may be considered a form of research. But it's not a place where you can navigate original source information. The format is limited to fairly short question and answer. In fact, someone may pop in with a suggestion, that is fine and well. But what I am saying is, don't hold your breath for insights here. You'll find what you are looking for almost immediately if you conduct a broad internet dragnet.

Also, assuming that you wanted specific guidance, you didn't provide the specific information about your project, that is recommended in the forum guidelines. That makes it harder to answer.

Has the OP considered GPS?

Mapping the floor out in a gird and using fiducials as position update points.

Using LIDAR, which worked very well for me and a hexapod.

Using RSSI from 4 or more access points placed at distances around the course.

There might be people with advice, but do you think it would help the forum if you described the actual project a bit ?

Presumably you know what the ground surface is actually made of, how far away it is, whether its indoors, outdoors or both, etc, etc.

how do you drive a car in a straight line? you select a reference point and steer towards it.

you need something that would recognize an object and provide signals that would let a controller track towards it. something one step beyond face recognition. that is way beyond the current capability of off the shelf affordable components

Steering a vehicle to travel in a straight line can be done quite simply, for example using a magnetic compass, or encoders on right and left drive wheels.

No need to ensure that wheel motors move at the same RPM, although that tends to happen as a result of the steering algorithm.

Really ?

As long as there are no nearby metal objects in or around the vehicle that would distort the magnetic field.

Yes, really. It is usually possible to calibrate a compass to take into account those objects. If not, some people put the compass on a pole, away from the interference.

Example of a severe case, corrected with ease: https://forum.pololu.com/t/correcting-the-balboa-magnetometer/14315

Dr. Johann Borenstein et al cover the topic of robot navigation in great detail in their "Where am I?" paper available from the University of Michigan website: http://www-personal.umich.edu/~johannb/Papers/pos96rep.pdf

I have used wheel encoders to calculate my robot's position in the past via dead reckoning. I have also performed some experimentation using a 9 DoF IMU to calculate robot heading. This is a work in progress for me at the moment as the results aren't as accurate as I would like.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.