Author Topic: how to use microcontroller as a joystick pls help  (Read 576 times)

0 Members and 1 Guest are viewing this topic.

Offline dany151Topic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
how to use microcontroller as a joystick pls help
« 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

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



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

how to do that ..with regards

Offline lrmall01

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 2
Re: how to use microcontroller as a joystick pls help
« Reply #1 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.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: how to use microcontroller as a joystick pls help
« Reply #2 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 :))
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: how to use microcontroller as a joystick pls help
« Reply #3 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? ;)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline lrmall01

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 2
Re: how to use microcontroller as a joystick pls help
« Reply #4 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!

 


Get Your Ad Here