I am doing a robotics project. The goal is to make an autonomous car start from one point and stop at another point around 10 +-1 meters away. I need to make a steering mechanism. I want to be as close as 3 cm away from the point, so GPS probably won't work.

My ideas:

  1. I cannot have a physical line taped to the floor, so I can't use line following robotics code. But, could I take some sort of electronic device and hover it above the point then remove the electronic device and have the car go straight to where the electronic device was? How would I do this and what would I use?

  2. I have already thought of rotary encoders, but I still need a way to keep the car dead straight for 10-ish meters. My current RC car veers about 20 cm either way. Could I used a gyroscope/accelerometer/imu to help keep the car on a straight line? How would I do this/are the gyro/accel sensors sensitive to notice super fine changes in angle? How will I line the car up perfectly straight?

Please let me know your thoughts!

  • $\begingroup$ Are you given the coordinates for the end location? Without some means for closed-loop control, you're forced to rely on open-loop control. Even if you could put encoders on the wheels and get PID steering, you need some reference with which to feed the PID controller. If you can't localize yourself relative to the objective then there isn't anything you can do. As you said yourself, "How will I line the car up perfectly straight?" The answer is - you won't. Closed loop control or bust - there's nothing else you can do. Can you ID the target with a camera and do visual tracking? $\endgroup$
    – Chuck
    Aug 15, 2016 at 20:06
  • $\begingroup$ If you use stepper motors you won't need rotary encoders $\endgroup$
    – CL22
    Aug 16, 2016 at 6:49
  • $\begingroup$ Well, I could ID the target prior to the run, but once the run starts, everything has to be cleared from the floor. So maybe camera is possible. Is there some other type of ID system? It would have to be able to know it's position without constant updates from the target (it has to get removed before the run). $\endgroup$ Aug 16, 2016 at 17:52

1 Answer 1


Another possible solution is to use a Magnetometer. This will help you keep a Autonomous steer the vehicle with reference to magnetic north.

Also you can use IR sensor to look obstacles in the front or rear to navigate.

Also look at Robot Car Controller. You will find some good ides to get started

As you have imagined you can use a gyroscope/accelerometer/imu. The youtube video TIVA - ADXL345 Accelerometer Demo Using I2C shows demo accelerometer use case. You can find link to the complete source code.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.