Two novice questions

I have started to build an obstacle avoiding buggy but I have found two issues.

  1. The buggy doesn't seem drive perfectly straight when powered. Could this be due to the servos having a slight variation in the way they are attached? Its a very gentle, gradual turn.

  2. I am using an ultrasonic sensor to detect obstacles but the version I have has four connectors but the unit on the model I have based it on only has three. How to I attach it? Where do the Trig, Echo wires go?

Start here

If you provide some detail of your buggy and the components you're using (preferably links to datasheets/specifications) and the code you're using it will be easier to help. E.g. what servos? Are these driving the thing or just steering it? Which sensor?

Steve

Thanks for the replies.

I'm completely to all of this so I think questions will just lead to more questions. :slight_smile:

At this moment all it does is move, the code just powers the servos. Learning on the go. :slight_smile:

The sensor is a HC-SR04 Ultrasonic range finder. I have no code for it yet, it's just sitting at the front of the 'buggy' waiting to be attached.

After you get around to reading and following up on replies #1 and #2, be sure to update your post!

I am using an ultrasonic sensor to detect obstacles but the version I have has four connectors but the unit on the model I have based it on only has three.

The sensor is a HC-SR04 Ultrasonic range finder.

The HC-SR04 has four pins.

You have something else.
Post pictures

Every component in your servos are built to some tolerance. In consequence, no two servos are ever likely to be exactly the same. Your buggy will never drive straight without some help. Wheel slip will be an issue too.

  1. The buggy doesn't seem drive perfectly straight when powered. Could this be due to the servos having a slight variation in the way they are attached? Its a very gentle, gradual turn.

Perfectly normal! Even an expensive high-precision engineered buggy/robot will not move in a straight line. It needs to be guided in a straight line with sensors of some kind and the motor speeds constantly adjusted.

TheMemberFormerlyKnownAsAWOL:
The HC-SR04 has four pins.

You have something else.
Post pictures

Yes, that's the component have but I am just unsure of where all the connections go as the project I am basing this on is using a mkpx5 sensor, which has three pins. It's in the book, Make: Arduino Bots and Gadgets, the insect Bot project.

wildbill:
Every component in your servos are built to some tolerance. In consequence, no two servos are ever likely to be exactly the same. Your buggy will never drive straight without some help. Wheel slip will be an issue too.

PaulRB:
Perfectly normal! Even an expensive high-precision engineered buggy/robot will not move in a straight line. It needs to be guided in a straight line with sensors of some kind and the motor speeds constantly adjusted.

Thanks for the replies.
Well, there's some lessons learnt right there! Appreciated!

colstar:
Yes, that's the component have but I am just unsure of where all the connections go as the project I am basing this on is using a mkpx5 sensor, which has three pins. It's in the book, Make: Arduino Bots and Gadgets, the insect Bot project.

mkpx5 is a Ping))) sensor, I think.
Plenty of source examples for that.

Sorry, never heard of the book, don't have it.

Have you tried a simple Google on "arduino HC-SR04"? That will find you hundreds (at least) of tutorials for connected and using the device.

Steve

if I had two servos running at different speeds I would fine tune the PWM width for the individual sides to get them running at the same speed.

Thanks yeah I might have to mess around with their settings in order to straighten the units path a little. :slight_smile:

You can probably make it run straighter, but not actually straight over any distance. Think about driving a car and taking your hands off the wheel. It won't be long before you're heading off the road.

You can probably make it run straighter, but not actually straight over any distance. Think about driving a car and taking your hands off the wheel. It won't be long before you're heading off the road.

sounds like you live in New Mexico. if you get a wheel alignment here, it won't last until you get home.

wildbill:
You can probably make it run straighter, but not actually straight over any distance. Think about driving a car and taking your hands off the wheel. It won't be long before you're heading off the road.

:slight_smile: True. Thanks.

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