Arduino motion sensor

Hi, I have a school project in which I want to build a robot, put stuff on him etc... . I want my robot to know his physical location from his start ( (0, 0) is the start and every time he moves towards x - his right or left sides and y - his top and bottom sides his location would be updated).
In my school I have modules like GY-521 and GY-61, I tried to work with them and I figured out they show rotation acceleration and not motion acceleration (if I knew the motion acceleration I could calculate the location too). I need to know which modules could I possibly use for these purposes or how could I use one of the described above better.

Please share your ideas

I don't think so. A constant speed will have ZERO acceleration, but lots of movement. What will be you units of measurement for the distances moved? You will also need some type of clock so you can time the movement to calculate the distance moved.

the plan is to use the arduino internal clock - millis() returns the milliseconds from the start of the program, each millisecond I will ask the sensor to output me the 3 axis acceleration (I need only 2) and then use the following formulas

v = v0 + a * t
x = v * t

where t will be 1 millisecond and v0 will be the previous speed -> in that way the zero acceleration problem is solved, because the speed is independent on this case

except for the inevitably huge accumulation of error

Which is to say that you are in general, slightly better off to measure wheel rotation.

Ok, you have a point, but sure it can be fixed

How would the wheel rotation help me? It has a point in one axis movement, but i can't emegine 2 axis formula

The standard way, I think, is to have a left and a right wheel with their own motors and their own rotation encoders. When both encoders have the exact same step rate, the vehicle travels straight ahead and the step count tells the travelled distance. To make the vehicle turn, either step rate has to decrease. Careful counting of steps together with some geometric calculus gives you the turning radius. I'd do a lot of testing and calibration, because of wheels behaving differently on different surfaces and different turning radii. This all is actually on my todo list. The aim is to create a car drawing on a big floor with a felt tip pen.

Say that you have an uncalibrated system and you test your car with a program telling it to drive 1 m straight ahead, turn 60 degrees to right on a 50 cm radius, turn 90 degrees left on a 30 cm radius. You repeat the program starting from the same spot and direction each time, and mark the end position each time. If the end position doesn't vary, you have a car capable of travelling and turning very precisely and it is worthwhile to calibrate to make it actually perform exactly according to the given numbers. If the end point vary a lot, you can still improve the accuracy. Maybe the wheels slip when you start and stop. Add acceleration and deacceleration.

Do tell. I'm all ears.

measuring the acceleration as an average. of course there is an error but the better the sensor, the more minor it is. The error is inevitable in every measuring scheme, but the point is to make it as small as possible

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