Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: dany151 on October 29, 2012, 01:17:43 PM

Title: how to use microcontroller as a joystick pls help
Post by: dany151 on October 29, 2012, 01:17:43 PM
kindly, i have a wheelchair joystick (superseded ch/13600 rmf 18.02.09) the manual
attached below :

http://www.societyofrobots.com/robotforum/index.php?action=dlattach;topic=7828.0;attach=3041 (http://www.societyofrobots.com/robotforum/index.php?action=dlattach;topic=7828.0;attach=3041)

i read the input signal between pin1 & pin3 by scope ..as shown below

(http://i48.tinypic.com/sfkl20.jpg)

i wanna control this wheelchair by microcontroller 8051 or another one ..no prblem

how to do that ..with regards
Title: Re: how to use microcontroller as a joystick pls help
Post by: lrmall01 on October 29, 2012, 05:41:26 PM
For reading a PWM signal like that use a input capture pin to detect the edges then determine the pulse width.  I'm assuming the pulse width changes with joystick position so you'll have to figure out how those relate, but in general if it is a PWM signal you are decoding use a port that can be configured as input capture.  It can be used to trigger a timer based on the rising or falling edge.  You don't want to use a general purpose input / output pin for this or an analog port.
Title: Re: how to use microcontroller as a joystick pls help
Post by: Soeren on October 29, 2012, 05:52:40 PM
Hi,

i read the input signal between pin1 & pin3 by scope ..as shown below
How did you measure it, attached to the chair-controller or what?
Your measurements does not ring well with the manual, as the pins you measured should be the power supply.
What 'scope did you use?


i wanna control this wheelchair by microcontroller 8051 or another one ..no prblem

how to do that ..with regards
According to the manual that you supplied, the stick outputs a voltage proportional to the stick position, with half the supply voltage being center position. This could be emulated in a controller using PWM and a Low-Pass filter - I have no idea if the chair controller needs the differential signal that the stick is capable of though, but it shouldn't bee too hard to output both if needed.
If you need better/finer control, you need to add a D/A-C.
The manual for the controller may tell some more.

You need to resolve why the supply is pulsing on/off at 100Hz. It might be a way to reduce power, but since it would only half the power used, I'm doubtful about it - 'scoping it with the stick connected to the controller may tell you more.

Don't run this with a person sitting in it, unless you know exactly what you do (which it doesn't sound quite like :))
Title: Re: how to use microcontroller as a joystick pls help
Post by: Soeren on October 29, 2012, 05:54:50 PM
Hi,

[...] I'm assuming the pulse width changes with joystick position [...]
You didn't care to actually look at the manual I guess? ;)
Title: Re: how to use microcontroller as a joystick pls help
Post by: lrmall01 on October 30, 2012, 06:00:31 AM
Quote
You didn't care to actually look at the manual I guess?

Ha, ha.  No I didn't.  I made another assumption that the original poster actually read the manual himself and was posting a relevant signal!