A problem about turning the direction of A4WD1

I need help for the application of A4WD1,please give me some propositions, thanks!

I want to accomplish the following functions by using A4WD1:

1.mobile robot can turn the direction I assigned.
2.I can contorl mobile robot go forward / back a distance I assigned.

Now , I think that I may need two motor encoders[QME-01] to count the cycles of motor.

Besides this thought, can any solution be supplied?
And where is example code which can support my application?

There are many different types of solutions to your description, but a lot would depend on other factors such as where you are running your rover, how accurate do you need, what other things you can use, etc. You have not said what electronics such as a microcontroller that you might be using, but I will assume a Basic Atom Pro as most of the kits come with them.

You can use the motor encoders such as the QME-01. You will need a motor that is a GHM-16. You might get sufficient accuracy from this, but you will probably fight one simple problem of wheel slipage. That is if you can run your rover such that neither wheel ever slips on whatever surface you are running it on, you can get it real accurate, but in most cases you will get slippage, especially since your wheels are always pointing forward…

I used a previous version of this encoder on my Rover and hooked it up the 4 IO pins from the two encoders on IO pins 16-19 and used 2 interrupts (one for each encoder). Some of the code is described in the thread: lynxmotion.net/viewtopic.php?t=3496. One of my motors with the encoder appears to be dead :frowning: (maybe why my motor controller had problems), so I actually have two new motors and two encoders on order… My previous version appeared to be reasonably accurate, if you were carefull to start the rover up slow enough not to slip. But I also found that not all motors were exactly equal and you need to do some testing and some adjusting to make your rover go exactly straight forward.

Other options: You could use a compass, such as: acroname.com/robotics/parts/R117-COMPASS.html to help you know which direction you are going. You can use I2C or get the PWM pulse to know which direction you are going.

You could use GPS assuming you are outside and have a clear view of the sky. An example of this is: acroname.com/robotics/parts/R217-TR-GPM.html, but you can probably also use any handheld GPS if you set up to read and parse the serial stream.

You can probably also setup some IR beacons at known locations and maybe install a directional IR sensor on the rover that you can rotate until you find the beacon(s). You could use multiple of these and probably triangulate.

Depending on distances you might be able to use a distance sensor such as one of the Sharp IR sensors or Devantech distance sensors such as a SRF08 or likewise soemthing like a PING sensor lynxmotion.com/Product.aspx?productID=492&CategoryID=8 and you get the distance before you move and you get the distance as you move until the difference is the distance you want to move…

There are lots of other options.

Good Luck
Kurt

Kurt:
Very thanks your appropriate and detailed response!
I plan to use Ti MSP430 2618 or 4618 to control car, and by using Zigbee module to communicate with network.Though the control of car is just a part of my subject, I am poor in robot field.

As that you say " there are many different types of solutions to your description" , in the process I have to learn what way can be the best.

Best regards!

coken shr