Parts list for VR2 joystick hacking!

Power wheelchair board for REAL info!

POWERCHAIR MENU! www.wheelchairdriver.com/powerchair-stuff.htm

Parts list for VR2 joystick hacking!

Postby vr2hacker » 21 May 2013, 00:34

Last year I tried for a while to hack the VR2 and Joystick for robotics use, so I could send it serial commands... or any commands! I found out what a pain it is to do so. Eventually I built my own radio-controlled system using Xbee radios.

This thread is to document what I found out about the joystick itself, which I took out of the VR2 system and put into my own system.
It works perfectly. Getting the parts (listed below) to connect it to your own circuitry costs about $5, which is a great deal considering that you get to use a top of the line joystick!

In any case, I wanted to share what I found out in the process of hacking it. Supplier links are to Digikey, but Newark, Farnell and most other large distributors should have these if you search by manufacturer part numbers.

Joystick facts:
- it uses four hall effect (magnetic) sensors
- needs a 5V power supply to put out signal
- four signals are provided: 2 for Up/down, and two for left/right. They're doubled for reliability, so that if one fails, the other is still useful. One set has a smaller voltage swing than the other.
- a "centre" signal that never changes is provided. It is about 2.5V. With this you can do math (in an Arduino, for example) by comparing the main outputs with the reference, to see how far it has travelled.
- the part number on my joystick is D50800
- the pinout for the joystick is the same as the pinout of this one by the same manufacturer:
Penny and Giles JC2000: http://www.pennyandgiles.com/Multi-Axis ... ,3,28,.php

Flat cable for Joystick $2.50
- the flat cable is 8 conductor, 1mm ribbon cable.
- Digikey sells it as AE08A-5-ND: 5 feet for about $2.50
- http://www.digikey.ca/product-detail/en ... ND/2391672

Connector for Flat cable $1.20
- the female connector that goes on the cable is 8 pins, 2mm spacing.
- Digikey Part number: 609-3140-ND
- Manufactured by FCI, part #89361-708LF
- http://www.digikey.ca/product-detail/en ... ND/1535470

Male headers, pcb mount, to receive above connector 79 cents
- these are 2mm spacing but work fine on a standard .1" perfboard if you bend the pins out a bit!
- FCI makes it, part #90309-008LF
- Digikey Part # 609-4444-ND
- http://www.digikey.ca/product-detail/en ... ND/1537945
vr2hacker
 
Posts: 5
Joined: 18 Jun 2012, 17:07

Re: Parts list for VR2 joystick hacking!

Postby Burgerman » 21 May 2013, 01:57

I have some JC2000 ones here. From the pilot plus modules, they are used there also. Meaning the same setup will likely work with all PG stuff including the more powerful Pilot Plus and R-Net setups.

I use an APEM one though for a wider volt swing on the roboteq setup, and cheaper, which I have been working on today. When feeding signals down a 3 foot cable a 4.5v swing is preferable for noise or resolution reasons.
User avatar
Burgerman
Site Admin
 
Posts: 71090
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Parts list for VR2 joystick hacking!

Postby BaconsHeir » 29 May 2013, 21:15

Good timing! I'm just getting started on a nearly identical project... I've got (2) Xbee Pros / Arduino Shields / Arduino Unos which I'm planning to use to remotely pilot the wheelchair.

Did you leave the joystick onboard the VR2, but just send fake analog voltages from a microcontroller to control? I'd be curious what your system setup was.
BaconsHeir
 
Posts: 1
Joined: 29 May 2013, 21:08

Re: Parts list for VR2 joystick hacking!

Postby lordk » 21 Oct 2013, 19:41

.
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby lordk » 21 Oct 2013, 19:42

Well, after a few month of work I have a first version of my Arduino shield. However I´m getting a 7bar flashing code time to time.
This error occurred when changing direction to quickly or accelerating.

I think is a problem of voltage in centre pin. Datasheet said that center pin is VS/2 with an impedance of 1.1 KOhm -+ 1%

I did a voltage divider between VS and GND. I tried with 470Ohm, 680, 1 K, 1.1K 2.2K and niether seems to work.
I also connect 2 potenciometers to vary resistors values.

any help?
Attachments
Centre pin.png
Centre pin.png (6.63 KiB) Viewed 28838 times
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby Irving » 22 Oct 2013, 23:08

Not sure why you think Vref is a problem, maybe you could explain more?

However, if I understand you right, Vref is an output from the joystick into the controller and you are trying to replicate the joystick with an Arduino? If so your problem is almost certainly noise from the supply rails getting into Vref. You might try a 100nF low-ESR capacitor from Vref to 0v and buffering your Vref with an op amp to give a low impedance output.

lordk wrote:Well, after a few month of work I have a first version of my Arduino shield. However I´m getting a 7bar flashing code time to time.
This error occurred when changing direction to quickly or accelerating.

I think is a problem of voltage in centre pin. Datasheet said that center pin is VS/2 with an impedance of 1.1 KOhm -+ 1%

I did a voltage divider between VS and GND. I tried with 470Ohm, 680, 1 K, 1.1K 2.2K and niether seems to work.
I also connect 2 potenciometers to vary resistors values.

any help?
User avatar
Irving
 
Posts: 2114
Joined: 04 Dec 2012, 11:51
Location: NW London

Re: Parts list for VR2 joystick hacking!

Postby lordk » 23 Oct 2013, 18:59

I dont know where the problem is. Is in centre pin or in X and Y pins.
As I have seen other hacks with VSI controller with DACS (no centre pin required) I assume this where ok.

I tried to investigate more about the joystick.

I tested:
VS with centre = 1.1 Kohm
GND with centre = 1.1 Khom

then I remove hall sensors and get:
VS with centre = 2.2 KOhm
GND with centre = 2.2 KOhm.

I´m trying to undestand how is the joystick schematic so I can replicated in my arduino shield.
Attachments
Untitled.jpg
Untitled.jpg (236.42 KiB) Viewed 28777 times
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby ex-Gooserider » 25 Oct 2013, 07:41

Don't know about your specific problem, but I'd agree with the other suggestions that you try adding bypass caps all over the place.... It sounds to me like you are getting a voltage fluctuation when you are changing the stick position abruptly... The safety circuitry in the controller system sees this as a failure and goes into an error state...

The other thing to look at is what you are using for a power source - make sure that it has enough reserve to keep you from getting any voltage dips (again largish filter caps on the supply output can help here). The regulator and filter setup on the stock Arduino are a bit iffy for powering much beyond the board itself - I find adding external power helps. (Note that if you have a 5V supply input it should go to the 5V line, NOT the V-in line)

I know that I had a lighting setup I was working on that was really flaky until I added a bunch of caps, and it is now very solid, so it seems like a good idea...

ex-Gooserider
User avatar
ex-Gooserider
 
Posts: 6232
Joined: 15 Feb 2011, 06:17
Location: Billerica, MA. USA

Re: Parts list for VR2 joystick hacking!

Postby lordk » 25 Oct 2013, 17:13

ex-Gooserider wrote:I know that I had a lighting setup I was working on that was really flaky until I added a bunch of caps, and it is now very solid, so it seems like a good idea...
ex-Gooserider


Do you hack a vr2 joystick pod? Can you send me schematics?

Im powering the arduino with 12V from 1 battery using the arduino power jack. the 2 DAC boards are using 5V from the Arduino. I think they already have caps to filter their Vout- http://www.adafruit.com/products/935

I also added a cap from Vs (from vr2 controller) to ground.

Same flasing code problem.
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby Irving » 26 Oct 2013, 22:31

What caps did you add? and did you add one from your Vref to ground?

Can you post a circuit diagram of what you're trying to do?


lordk wrote:
ex-Gooserider wrote:I know that I had a lighting setup I was working on that was really flaky until I added a bunch of caps, and it is now very solid, so it seems like a good idea...
ex-Gooserider


Do you hack a vr2 joystick pod? Can you send me schematics?

Im powering the arduino with 12V from 1 battery using the arduino power jack. the 2 DAC boards are using 5V from the Arduino. I think they already have caps to filter their Vout- http://www.adafruit.com/products/935

I also added a cap from Vs (from vr2 controller) to ground.

Same flasing code problem.
User avatar
Irving
 
Posts: 2114
Joined: 04 Dec 2012, 11:51
Location: NW London

Re: Parts list for VR2 joystick hacking!

Postby ex-Gooserider » 27 Oct 2013, 11:53

I wasn't hacking a joystick - I'm working on a set of blinking LED lights that will go on the fenders of my Redman project chair in place of the Redman badges - mostly just because I can, and also as a first project to teach myself KiCAD...

To do this I'm going to be spinning some custom boards through OSHPark, so I'm not doing a stock Arduino (though I am using one for development) The biggest thing I've been doing is filtering the power input like mad - remember that a chair is a very electrically noisy environment - and the DAC's and Arduino are very sensitive to noise

My original plan had been to power everything off the lights output of the Redman's ALM module - but it looks like I might not be using that, and I'd also like my design to be a bit more universal, so I'm going to be redoing part of it to use a DC-DC off the chair batteries.

That said, my current design uses the PWM'd 12V out of the ALM. After filtering, it feeds the + side of the LED strips Ilm using and a 7805 regulator - which powers the Arduino and the TLC5940 LED driver chips.

The power from the chair goes through a PI filter of two 200uF electrolytics and a ferrite bead, then a 10uF and 470pF ceramics, at which point I feed it to the LED strips and the 7805. The 7805 has a 0.33uf betweein the input and ground, and a 0.1uF on the output.

At the Atmega chip, I have 5V Vcc going to the Vcc and AVcc pins, with a 0.1uF cap to ground on each, and a 10uH inductor between them. There is also a 0.1uF cap on AREF. (which isn't used otherwise). I also have a 0.1uF cap between power and ground on each of the TLC5940's

Three thoughts on LordK's powering the Arduino from one of the batteries...

1. It is NEVER a good thing to take 12V from one battery - even the relatively tiny draw of the Arduino is enough to unbalance your batteries over time... It is much better to pull across both batteries and use a DC-DC or even a regulator to produce your supply voltage.

2. All the stuff I've read on the Arduino is that it's a bit dicey to feed it's on-board regulator w/ 12VDC - The regulaor chip is rated for it, but doesn't really have enough heat-sinking to be happy with more than about a 9V transistor radio battery.

3. The on-board regulator is also very low output, and really isn't up to powering much beyond the Arduino itself. I'm wondering if part of your problem is that the DAC's are pulling enough extra power when making sudden moves to pull the regulator down, and cause fluctuations in the reference, or elsewhere.

I would be strongly inclined to get / make a DC-DC circuit with at least a 1A potential output at 5V and use that to power both the Arduino and the DAC's directly, after some significant filtering. I'd also be inclined to throw some extra filtering on the Vcc lines to the DAC boards - the picture appears to have one cap on it, but adding more won't do any harm...

ex-Gooserider
User avatar
ex-Gooserider
 
Posts: 6232
Joined: 15 Feb 2011, 06:17
Location: Billerica, MA. USA

Re: Parts list for VR2 joystick hacking!

Postby lordk » 30 Oct 2013, 21:24

Do you know what tests VR2 controller do to joystick pod?

* X/Y voltage between 1.11V and 3.89V [checked]
* Center pin voltage = Vs/2 [checked]
* X=Y=center at start up [checked]

And maybe ¿?
* continous values of X/Y
* overcurrent on X, Y or center?
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby ex-Gooserider » 31 Oct 2013, 05:40

lordk wrote:Do you know what tests VR2 controller do to joystick pod?

* X/Y voltage between 1.11V and 3.89V [checked]
* Center pin voltage = Vs/2 [checked]
* X=Y=center at start up [checked]

And maybe ¿?
* continous values of X/Y
* overcurrent on X, Y or center?


Not certain, but there are a few other things that do get checked...

1. The voltage swing in the joystick output will NOT go to the voltage rails (i.e. 0 & 5V) but will end somewhat shy of them - A failure such as a broken wire will cause the output to go to one rail, causing an error. This is the first item you mentioned, the exact values depend on the particular controller model / brand.

2. Many controllers will have two outputs that are the inverse of each other on each axis, and the values are summed and should always be a constant. If you have more than 5 or 6 wires between the joystick can and the controller board, this is probably being done.

ex-Gooserider
User avatar
ex-Gooserider
 
Posts: 6232
Joined: 15 Feb 2011, 06:17
Location: Billerica, MA. USA

Re: Parts list for VR2 joystick hacking!

Postby lordk » 31 Oct 2013, 11:22

ex-Gooserider wrote:2. Many controllers will have two outputs that are the inverse of each other on each axis, and the values are summed and should always be a constant. If you have more than 5 or 6 wires between the joystick can and the controller board, this is probably being done.
ex-Gooserider


WOOOW! that´s a new one!. I never understand that part on datasheet (image attached). Maybe is that what Im doing wrong!!
Now I have DAC voltage connected to X axis so channel 1 and channel 2 have the same voltage and not the inverse!!!

ps: I cant figure out the drawing on datasheet. What do you think?
Attachments
outputs.png
outputs.png (12.96 KiB) Viewed 28659 times
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby Irving » 31 Oct 2013, 19:54

lordk wrote:
ex-Gooserider wrote:2. Many controllers will have two outputs that are the inverse of each other on each axis, and the values are summed and should always be a constant. If you have more than 5 or 6 wires between the joystick can and the controller board, this is probably being done.
ex-Gooserider


WOOOW! that´s a new one!. I never understand that part on datasheet (image attached). Maybe is that what Im doing wrong!!
Now I have DAC voltage connected to X axis so channel 1 and channel 2 have the same voltage and not the inverse!!!

ps: I cant figure out the drawing on datasheet. What do you think?
This is common on most 'fly-by-wire' systems, such as the accelerator pedal and the butterfly throttle position feedback sensor in most modern cars, to provide redundancy and safe degradation in the event of failure... you certainly don't want an unintended 'wide open throttle' failure mode.
User avatar
Irving
 
Posts: 2114
Joined: 04 Dec 2012, 11:51
Location: NW London

Re: Parts list for VR2 joystick hacking!

Postby lordk » 01 Nov 2013, 01:21

Thanks Irving for your replay.
Do you understand that picture?
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby woodygb » 01 Nov 2013, 13:00

Lordk,

Are you using an Arduino? ... if so care to post the code?
User avatar
woodygb
 
Posts: 7128
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Parts list for VR2 joystick hacking!

Postby lordk » 01 Nov 2013, 16:59

Code is too large to post.
I post joystick functions.

Code: Select all
// I get this values after testing and reading datasheet from D50800
#define DAC_CENTER_VALUE 2045
#define DAC_MAX_VALUE 3200
#define DAC_MIN_VALUE 920


Code: Select all
// this function read analog values from a thumb joystick and maps X and Y axis on
// corrects VR2 joystick values.

void JoystickControl(){
  int xValue = map(readXaxis(), 0, 1023, DAC_MIN_VALUE,DAC_MAX_VALUE );
  int yValue = map(readYaxis(), 0, 1023, DAC_MIN_VALUE,DAC_MAX_VALUE);
  dacXaxis.setVoltage(xValue, false);
  dacYaxis.setVoltage(yValue, false);
  delay(80);
}
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby LROBBINS » 02 Nov 2013, 00:49

I recently hooked an old, beat up (by Continental Airlines) inductive joystick from a DX-ACU to my CAN bus and found it to be very, very far off from the "book" values. I therefore wrote a little program to let me store calibration values in EEPROM. In case it's of use to anyone, I've attached it. It's past midnight now so I'll not do it now, but tomorrow I'll post the calibrated values so you can see just how far off one can be from the 100mV to 4900mV spec-sheet values. An undamaged joystick should be better than this, but don't expect it to exactly match spec nor for mechanical zero and voltage midpoint to exactly coincide. If your VR2 had been calibrated to an actual joystick, your mimic that matches the spec sheet may come up as "fault".
Ciao,
Lenny
P.S. The attached file is actually an Arduino *.ino file (which is really just plain text anyway) relabeled as *.txt so that the forum will accept it.
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Parts list for VR2 joystick hacking!

Postby woodygb » 02 Nov 2013, 02:13

Lenny ...I'm sure that you will attach the file in the morning ...night night ZZZZzzzzz
User avatar
woodygb
 
Posts: 7128
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Parts list for VR2 joystick hacking!

Postby ex-Gooserider » 02 Nov 2013, 04:56

lordk wrote:
ex-Gooserider wrote:2. Many controllers will have two outputs that are the inverse of each other on each axis, and the values are summed and should always be a constant. If you have more than 5 or 6 wires between the joystick can and the controller board, this is probably being done.
ex-Gooserider


WOOOW! that´s a new one!. I never understand that part on datasheet (image attached). Maybe is that what Im doing wrong!!
Now I have DAC voltage connected to X axis so channel 1 and channel 2 have the same voltage and not the inverse!!!

ps: I cant figure out the drawing on datasheet. What do you think?


My take is that it is showing the two output pins having a voltage differential of 100mv as you go any distance from center - however that does not really fit the model of a Hall-effect or potentiometer joystick which should have some sort of linear change in values. This looks more like what I'd expect from a switch type joystick, essentially a square wave....

However for any given displacement away from the 2.5V at center, you will have one output going positive and the other negative by the same amount, with the two signals reversing polarity as they cross the center.

Is there any possibility that the datasheet you have is for multiple parts? I often see them where one sheet will cover several parts in the same "family" and you need to match which diagrams go with which individual part.... (i.e. they use the same mechanical parts of the joystick and just change the sensors on the bottom...) You can ignore any pictures that don't include the part you are actually interested in.

ex-Gooserider
User avatar
ex-Gooserider
 
Posts: 6232
Joined: 15 Feb 2011, 06:17
Location: Billerica, MA. USA

Re: Parts list for VR2 joystick hacking!

Postby LROBBINS » 02 Nov 2013, 09:12

OK, I'll try again and make sure to see if there's some message about it not working. Ah, hah. "The extension txt is not allowed." It now says *.zip - it really isn't though, it's *.ino. Rename to that if you have Arduino installed, rename to txt or whatever if not, and open with any text editor.
Ciao,
Lenny
Attachments
Joystick_Calibration.zip
(9.88 KiB) Downloaded 748 times
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Parts list for VR2 joystick hacking!

Postby LROBBINS » 02 Nov 2013, 12:07

Here are the results of calibrating that old joystick pot, but first some notes for reading these numbers.

(1) Output was mapped so that GND = 0, Vcc (nominally 5V) = 5000

(2) The "book" values for this 1V to 4V output pot using this scale would be:
Throttle0 = 2500 Steering0 = 2500
ThrottleFwd = 4000 SteeringLft = 4000
ThrottleRev = 1000 SteeringRt = 1000

(3) this pot also has mirror outputs, and they were completely out of spec after Continental had bounced the chair onto its side, dragged it across the tarmac, and tried to squeeze it under the railing of the outside stairway of a jetway. They were in too much of a rush to get the proper equipment for getting the chair out of the Airbus cargo hold, and paid about E1000 for the replacement. Poor economy for them, and a real PITA for us - the only way to drive the chair until I could make a temporary fix was using Rachi's head switches.

(4) this was from a DX-ACU (Attendant Control Unit)- The Dynamic Wizard has a calibration routine for normal user joysticks, but not for the ACU. Hence, for a normal hand control the values tested to ensure that the joystick is OK are not the book values, but the calibrated values. They will probably not be as far off as the following, but they are unlikely to be exactly what's in the spec sheet for the pot.
Calibration starts in EEPROM address: 70
Previously stored calibration values:
Throttle0 = 2507
ThrottleFwd = 3846
ThrottleRev = 904
Steering0 = 2531
SteeringLft = 4095
SteeringRt = 957
SpeedPotMin = 200
SpeedPotMax = 4794

Leave Joystick in neutral and press Mode to start calibration
Press Forward switch to skip this calibration step
Calibration of neutral point started: Throttle0 = 2502 Steering0 = 2526
Calibration of neutral completed: stored Throttle0 = 2502 stored Steering0 = 2526

Hold joystick in full forward and press Mode switch to start ThrottleFwd calibration
Press Forward switch to skip this calibration step
Calibration of ThrottleFwd started
Stored ThrottleFwd was 3846 new ThrottleFwd is 3831

Hold joystick in full reverse and press Mode switch to start ThrottleRev calibration
Press Forward switch to skip this calibration step
Calibration of ThrottleRev started
Stored ThrottleRev was 904 new ThrottleRev is 918

Hold joystick full left and press Mode switch to start SteeringLft calibration
Press Forward switch to skip this calibration step
Calibration of SteeringLft started
Stored SteeringLft was 4095 new SteeringLft is 4090

Hold joystick full right and press Mode switch to start SteeringRt calibration
Press Forward switch to skip this calibration step
Calibration of SteeringRt started
Stored SteeringRt was 957 new SteeringRt is 967

Set speed pot fully counterclockwise and press Mode switch to start SpeedPotMin calibration
Press Forward switch to skip this calibration step

Set speed pot fully clockwise and press Mode switch to start SpeedPotMax calibration
Press Forward switch to skip this calibration step

*********************
CALIBRATION COMPLETED
*********************

These numbers are not terribly far off spec, but they are far enough off that without programming a deadband with hands off the chair would be in a constant slight turn and without adjusting the out-of-range testpoints it would show as joystick fault.

Ciao,
Lenny
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Parts list for VR2 joystick hacking!

Postby woodygb » 03 Nov 2013, 16:28

lordk wrote:
ex-Gooserider wrote:2. Many controllers will have two outputs that are the inverse of each other on each axis, and the values are summed and should always be a constant. If you have more than 5 or 6 wires between the joystick can and the controller board, this is probably being done.
ex-Gooserider


WOOOW! that´s a new one!. I never understand that part on datasheet (image attached). Maybe is that what Im doing wrong!!
Now I have DAC voltage connected to X axis so channel 1 and channel 2 have the same voltage and not the inverse!!!

ps: I cant figure out the drawing on datasheet. What do you think?


Data sheet.
http://www.societyofrobots.com/robotfor ... ttach=3041
User avatar
woodygb
 
Posts: 7128
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Parts list for VR2 joystick hacking!

Postby LROBBINS » 03 Nov 2013, 20:05

I too find that graph hard to interpret and the data sheet doesn't give any explanation of what it's trying to show. My guess is that what it "says" is that there can be a difference of up to 100 mV between the two outputs for a given channel except right near the center point where the two outputs should not differ by more than 50 mV. A difference of > 100mV (or > 50mV near center) would indicate a fault.

The joystick pot I recently pulled from a damaged DX-ACU has two outputs/channel, but they are mirrors of each other - one is forward = low, the other is forward = high (or left = low, left = high). In this case, the test for a fault is that the sum the two outputs (rather than the difference between them) should be within "tot" - after Continental airlines buggered this one, that is certainly not the case.

Ciao,
Lenny
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Parts list for VR2 joystick hacking!

Postby woodygb » 04 Nov 2013, 10:33

lordk wrote:Code is too large to post.
I post joystick functions.

Code: Select all
// I get this values after testing and reading datasheet from D50800
#define DAC_CENTER_VALUE 2045
#define DAC_MAX_VALUE 3200
#define DAC_MIN_VALUE 920




OK ... I'm assuming that you actually want/need an equal swing each way from center? ..if so you appear to have a math hiccup.

MAX_VALUE 3200
3200-2045= 1155
CENTER_VALUE 2045
2045-920= 1125
MIN_VALUE 920
User avatar
woodygb
 
Posts: 7128
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Parts list for VR2 joystick hacking!

Postby LROBBINS » 04 Nov 2013, 13:30

Woody,

Those are the actual, "raw" measured voltages (on a 0 - 5000 scale) and they are NOT exactly equal; the center point is not at 2500, 2500 and the swings are not equal. They are out of spec, but I suspect that most joysticks are at least a little out off. (The P&G spec sheet you posted the other day showed a 100 mV tolerance as being within spec.) That's why P&G and Dynamic programming tools, as well as mine, let you re-calibrate the joystick.

In the CAN node program "raw" readings are averaged a user-settable number of times for tremor. The above calibration values, which have been stored in EEPROM, are then used to re-scale everything so that throws are full-scale, centered, and equal. The program then applies a deadband, exponential curving if desired, different forward, reverse and turn scales, re-scaling to speed pot setting etc. (all of these are user settings and can be adjusted or eliminated as desired).

Ciao,
Lenny
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Parts list for VR2 joystick hacking!

Postby ex-Gooserider » 07 Nov 2013, 10:45

Looking at the datasheet, which I would say is a pretty poor sheet, I'd agree with Lenny's interpretation that the differential graph shows a spec on how much difference between the two channels is acceptable. Makes more sense than what I had guessed earlier.

The other thing that does seem a bit odd looking at the voltage output graphs is that the two channels actually both have the same output for a given displacement according to the labels... I.e. the For1 and For2 channels are both on the high voltage side - so presumably the idea is that both should have the same values at any given displacement, within that 50-100mv acceptable differential range... A fault in one channel would presumably result in that differential going out of range and triggering a fault.

ex-Gooserider
User avatar
ex-Gooserider
 
Posts: 6232
Joined: 15 Feb 2011, 06:17
Location: Billerica, MA. USA

Re: Parts list for VR2 joystick hacking!

Postby lordk » 08 Nov 2013, 20:30

Hi, I started this project all over again. I made a small board to easily test voltage of VR2 controller. This board connects VR2 joystick pod to VR2 controller.
I connected (see picture) all ribbon cables and started testing the outputs.

First I disconnect centre pin and put my own voltage. I made a voltage divider with 1K resistors using VSS and GND supplied from VR2 controller. Works fine even with load.

I continued my testing.
I use a 1K precision potenciometer to supply voltage on X axis (both channels). Works fine.
I use a power supply on Y axis (both channels). Works fine.

So I suppose that my problem is not in centre pin and is on DAC voltages or in my Arduino program.

Question.
Voltage using GND joystick pod reference are:
VSS: 1.83 V
Center: 0.87 V
forward: 1.41V
backwards: 0.36V


If I use GND from PCB of VR2 controller values change.
VSS: 4.95 V
GND: 3.12V
Center: 4.00 V
forward: 4.4V
backwards: 3.6V

I know that values are different because of the reference I use, but when I connect my arduino should I wire arduino ground to what ground: pcb or joystick pod?
Attachments
voltage.jpg
voltage.jpg (202.03 KiB) Viewed 24957 times
lordk
 
Posts: 92
Joined: 28 Oct 2010, 12:02

Re: Parts list for VR2 joystick hacking!

Postby LROBBINS » 09 Nov 2013, 00:15

First, to make sure we're talking about the same things, when we say Controller what we usually mean is the Power Module, while the Joystick Pod is the whole black case that contains joystick, switches, lights, circuitry and so on. I tend to call the joystick mechanism itself the joystick "pot", but I don't know what others call it.

In general, all ground connections should be, somewhere, connected together and on a 5V system there shouldn't be more than a millivolt-level difference from one ground pin to another- Because of impedance/resistance of the wires, there might be some slight difference between two ground pins, but one tries to engineer that out as it can cause no end of problems. The only situation in which one is likely to have different, not-connected-to-each-other, ground lines is if two circuits are isolated by something like an optocoupler.

I can not tell from your photo how the wires from the pod's circuit board and the wires from the pot are connected to each other, or how you could possibly have such a large difference measuring voltages respect to one ground line versus the other. Can you post a picture that shows the connections on that board, and another that shows what the connections were like in the original hookup between pot and circuit board? Or a schematic of both situations, or both the photo and schematic?

When you hook up the Arduino, you should be following the same rules: all grounds MUST be connected together unless you use optoisolaters, AREF of the Arduino should be connected to Vcc of the joystick, and you have to put a line in your program so that the Arduino uses that AREF for its measurements, if you are measuring the joystick position with the Arduino.

I get the impression, however, that you want to use the Arduino to supply voltages that mimic what the joystick would produce. Please think carefully about this. The Arduino does not have a digital-to-analog converter. The AnalogWrite function produces a PWM signal; a square wave with varying on and off times to (on average) approximate a steady intermediate voltage. That kind of signal might not be usable by the P&G electronics. You might be able to use an RC network to massively smooth that PWM signal, but you would probably want to program the Arduino to produce its PWM at a much higher switching frequency than its default. Better yet, you could feed the Arduino output to a real analog-to-digital converter chip, or if you want just a few values, use the digital output pins of the arduino to select among different voltage dividers.

I really think that before you start cutting and attaching wires in the joystick, you need to study what the P&G needs and do some programming get those signals. John has done this for his radio control, without a microcomputer, and it might be simpler to just study what he's done, then use the Arduino to mimic what his radio control receiver puts out.

Ciao,
Lenny
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Next

Return to Everything Powerchair

Who is online

Users browsing this forum: Bing [Bot], Bubbernator, robertnew16, rollingcowboy and 349 guests

 

  eXTReMe Tracker