I made a joystick with the NXT kit. It is designed to control a two-wheel-drive car (which I am still designing; it is going to have two wheels attached to motors with a castor wheel in the back, like the tribot). I built the joystick with only one motor so that I could use the other two motors for the car. It is inspired mostly by Phillip Hurbane's NXT joystick and the remote control for the Mindstorms RC cars on nxtprograms.com.
View these projects here:
I have attached a picture of my joystick. It will probably help you understand my question if you look at these links and this picture.
My main question is:
How do you recomend I mix the joystick X and Y values and use them to control motors on a two wheel drive car?
I have thought of ways of how to do this, but I would like to get some other ideas before I program it out. I am programming the joystick in LabVIEW 8.5. I have already made programs that callibrate the joystick, figure out the X and Y values at which it is centered, and calculate how far off the joystick axis are from their centers. I would not like to just use the Sync Unlimited vi which easily solves my problem, because I would like to have some experience with mixing joystick values.
I have thought of doing this:
Adding the Y axis directly to the both of the motors' power, then, for the X axis, deciding if the X axis is turned right or left. The program will the add the X axis value to either the right or left motor, depending on which direction the X axis is turned. In both cases (X and Y axis), the difference between the actual value and the axis center is used. Also, if the Y axis value is less than the center, I program it to still say the difference is negative. Then I can just wire it up to a motor unlimited vi, and it will tell the motor to move backwards (since negative power means to move backwards). Then I program it to add a negative value from the X axis difference to the motor power (even though the difference between the X axis and the X axis center is posotive) because I want the motor to move backwards.
I attached a program that I made that briefly shows the above example.
I belive there is a much simpler way of mixing the values because I have seen someone program it in LabVIEW. They did it in a demonstration, though, and I did not see exactly how he wired it. It seem that he just wired a bunch of oporation nodes (adding, subtrating, etc.) using the X and Y values and then just connected the results to the left and right motors, similar to how I added the X and Y results twice at the end of the program attached.
Please give me your ideas on how I should do this. Thanks!