joystick and dc motor?
mikeyhz
Posts: 16
hey there,is it possible to control a dc motor through an h-bridge with an analog joystick using a bs2e and pwmpal?.if it is,how do ya do it?.i have had my motors running using push buttons,bs2e and pwmpal(slowly making progress) but really want to use a joystick.any help would be great,cheers.
Comments
Basically, you could read the joystick pots with RCTIME then send the proper signals to the h-bridges.
I've only used PWMPAL a couple of times with only mediocre results. Anyway, basically you tell the PWMPAL what output you want then it does its thing until you change the settings.
If you're have trouble getting the whole thing to work together, I'd suggest doing it in three parts:
Step 1: Set up a program to read the joysticks properly. Write a program to read two sticks (or both directions of a single stick, if thats what you're going to use). Just put the number on the DEBUG screen. Make a note of the numbers generated when the stick is neutral, full left, full right.
Step two, get the Stamp to use its own PWM command to talk directly to the motor controller. This will be a short program that does not need the PWMPAL chip. See the Stamp Helpfile under PWM. Just a short loop that repeatedly puts out some level of PWM. Try a couple of settings, maybe slow, stop, fast.
Step 3: Combine the two program pieces so when you move the joystick the motor does what you expect. Likely you'll have to multiply or divide the joystick number to get it to a range that the PWM command can send to the motor controller.
Now that you know all parts are working try the PWMPAL chip. At this point the subroutines in the program you attached may be useful.