Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

PIC Chip & Analog Joystick ?

Status
Not open for further replies.

Mr.Cool

Advanced Member level 2
Joined
Jun 20, 2001
Messages
664
Helped
87
Reputation
178
Reaction score
60
Trophy points
1,308
Activity points
7,113
mixing joystick outputs

i was just wondering if anyone can point me to a web site or can provide advice for a project i am doing. i have an analog joystick. i wish to control 2 motors with this joystick. i have the motor control hardware done. simple H-Bridge circuit. now i must provide a PWM signal to the legs of the H-Bridge. i would like to use the PIC 16F877 because i get them free and cause they have ability for PWM output.

my input comes from an analog joystick. This is what i was thinking. Connect Y-Axis resistor between +Vcc ang GND. add a series resistor following this formula:
Joystick Series Resistor = (+Vcc/.02) and 10K - (Joystick R)/2

input this analog signal into 16F877 A/D input.

do the same for the X-Axis input.

now i need software to do channel mixing such that ONE joystick can control 2 motors. preferably i would like this code in Pic Basic or Assembly.

thx for any help you can provide

Mr.Cool
 

Mr.Cool

Advanced Member level 2
Joined
Jun 20, 2001
Messages
664
Helped
87
Reputation
178
Reaction score
60
Trophy points
1,308
Activity points
7,113
joystick pwm output

code examples in 16F84 or 16F84A would also be acceptable

Mr.Cool
 

petarpav

Full Member level 5
Joined
Mar 25, 2002
Messages
301
Helped
13
Reputation
26
Reaction score
5
Trophy points
1,298
Activity points
2,172
analog joystick circuit diagram

Look Application note for Siemens GMR sensors.
 

Mr.Cool

Advanced Member level 2
Joined
Jun 20, 2001
Messages
664
Helped
87
Reputation
178
Reaction score
60
Trophy points
1,308
Activity points
7,113
picbasic joystic

here i find an excellent example of taking ANY analog 2 axis joystick (single stick) and convert it to a serial ouput. not quite what i was looking for. i do not want a serial output. i need a PWM output. but contained within the serial output is the PWM signal. perhaps i can decifer this information with another 16F84 chip. time will tell. also using proteus would be a great help in this mannor.

h**p://www.seetron.com/guest/berg/berg_joyssc.htm

Mr.Cool
 

Mr.Cool

Advanced Member level 2
Joined
Jun 20, 2001
Messages
664
Helped
87
Reputation
178
Reaction score
60
Trophy points
1,308
Activity points
7,113
3 axis analog joystick

yes i have found this article. it is EXACTLY what i am looking for. except that the author does not finish the example code. the author produces the direction signal, but not the PWM speed control.

how can i modify this code to get the desired response? i need this circuit to control 2 motors


Mr.Cool
 

Mr.Cool

Advanced Member level 2
Joined
Jun 20, 2001
Messages
664
Helped
87
Reputation
178
Reaction score
60
Trophy points
1,308
Activity points
7,113
resistor joystick

i could use the code as is, minus the parts about serial communication.

then to achieve PWM i could take the values stored for X-Axis and Y-Axis and mix them. coincidentally i just read a post elsewhere on this subject.

Right Motor = X + Y - 255
Left Motor = X + Y

limit output to +/- 127

now, i need to see how i can get 2 PWM outputs using the 16F84! any tips?

Mr.Cool
 

Mr.Cool

Advanced Member level 2
Joined
Jun 20, 2001
Messages
664
Helped
87
Reputation
178
Reaction score
60
Trophy points
1,308
Activity points
7,113
2 axis joystick chip

quick question.

the schematic you posted shows the X/Y-AXIS connected through a polarized cap to ground. what would a good value be?

also, there is no power supply on this section. look the X/Y-AXIS wires simply floating free... they don't go anywhere. is this right???

Mr.Cool
 

meax98

Full Member level 3
Joined
Nov 25, 2001
Messages
180
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
1,793
analog joystick motor control

Author try to form voltage devider and on pic side is using picbasic POT command. So, X and Y axis must be connected to +5V. Used caps are 0.1 uF.
Command is like this:

POT pin,scale,variable

Measures resistance on "pin" by timing the discharge of a capacitor through the resistor (typ 5k-50k). "Scale" (1-255) is used to adjust for varying RC constants. If "scale" is set correctly, than "variable" is zero near minimum resistance and 255 near maximum resistance.

regards
meax98
 

tonykeys

Newbie level 3
Joined
Feb 2, 2006
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,306
rc joystick with pic

This is the circuit diagram. this is for half of the circuit the other half will be the same. i've shown switches for the joystick fwd & aft. Hope this helps. Many thanks
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top