Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Help with 360 wheel encoder to UHID  (Read 2233 times)

0 Members and 1 Guest are viewing this topic.

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Help with 360 wheel encoder to UHID
« on: April 24, 2013, 12:01:38 pm »
4 hours later I am still no closer. I have a nice Ivan Iron man 4x4 which I want to convert to MAME, but cant get these darn 360's working. The uhid works fine and striking the Quad Mouse with a ground works fine. However it would seem that the encoder on the Ivan pulses 5v and the UHID just doesn't see it. Anyone have any ideas?

Thanks

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #1 on: April 24, 2013, 12:31:57 pm »
Need a lot more detail.

Are the pins you are using on the UHID configured for a quadrature mouse in the UHID software?

Is the UHID showing up as a mouse?  (optical inputs show up as a mouse, not as a gamepad)

Where are you looking for movement?  If in MAME, make sure mice are enabled, multimouse is enabled and each player is mapped to the proper mouse.
Make sure all the the wheels move the system cursor in windows before attempting to use it in MAME.

Do you have 2 or 3 wheels?  If 3, you have to use a custom MAME build to get the Z axis to behave like the other two.

« Last Edit: April 24, 2013, 12:37:00 pm by BadMouth »

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #2 on: April 24, 2013, 01:07:33 pm »
Hey BM - thanks for the reply. Here goes.


1. Configured as Quads on X axis. Touching the configures pin with a ground repeatedly, moves the mouse cursor left in windows so I assumed its working.

2. Shows up as a game device, and 2 X HID Complaint Mice in Device manager

3. I havn't gotten passed just testing it in Windows yet. Is it usual for an encoder to pulse the 5v and not the ground?

4. its a 3 wheel cabinet, but I have enough inputs on the uhid to cover all 3 so dont need z axis.

Thanks

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #3 on: April 24, 2013, 01:12:21 pm »
Is it usual for an encoder to pulse the 5v and not the ground?

Not unusual.  The optical sensors allow the voltage to pass when light hits them.
You should have two wires pulsing 5v for each axis. 
It needs both to tell which direction the wheel is turning.

EDIT: You should have four wires going to each encoder 5v, GND, Signal A & Signal B
« Last Edit: April 24, 2013, 01:15:27 pm by BadMouth »

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #4 on: April 24, 2013, 01:17:24 pm »
OK now im a bit more confused.

The Ivan encoders have 4 pins, according to the diagram - +5v, ground and 2 others which I assumed are left and right so to speak. - Page 13 here - http://ia600403.us.archive.org/1/items/ArcadeGameManualSuperoffroad/superoffroad.pdf

However when I connect it all together it just does nothing. Using the cabs power (it all still works) also does nothing and the 5v from the uHID is clean.

Could you explain a bit more about having to have both connected to 5v?

Thanks

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #5 on: April 24, 2013, 01:29:07 pm »
OK now im a bit more confused.

The Ivan encoders have 4 pins, according to the diagram - +5v, ground and 2 others which I assumed are left and right so to speak. - Page 13 here - http://ia600403.us.archive.org/1/items/ArcadeGameManualSuperoffroad/superoffroad.pdf

However when I connect it all together it just does nothing. Using the cabs power (it all still works) also does nothing and the 5v from the uHID is clean.

Could you explain a bit more about having to have both connected to 5v?

Thanks

From ultimarc website:
Quote
Windows allows one instance of each axis when defined as Mouse (ie X, Y, Z) but if you are using multiple U-HID boards, Windows can recognise each board as a different mouse, using DirectInput.

That makes me pretty sure the U-HID only shows up as one mouse.  If you have two pins in the config software labeled as x-axis and you have them going to separate wheels, that would be wrong.  Both those pins should go to the same wheel and you'd use the y axis for the next wheel.

Let's see how quickly I can explain how optical encoders work and then you'll have a better understanding of what needs to happen....

There are two sensors on each encoder.   5v goes in and is only allowed to pass when light hits the sensor.
When the slotted disc is turned, it alternates between letting light pass and not, so you get a 5v pulse.
The sensors are spaced so that the direction can be determined by how the pulses are timed.

i.e.
A_B______A_B______A_B______ would be one direction
B_A______B_A______B_A______ would be the opposite direction

EDIT:^ok, example not technically 100% correct, but much easier for the layman to wrap their head around.  :P
I guess a more accurate way would be:
A_BOTH_B_NONE_A_BOTH_B_NONE_ for one direction
A_NONE_B_BOTH_A_NONE_B_BOTH_ for the opposite direction



« Last Edit: April 24, 2013, 01:59:28 pm by BadMouth »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9674
  • Last login:Today at 04:43:48 am
  • Designated spam hunter
Re: Help with 360 wheel encoder to UHID
« Reply #6 on: April 24, 2013, 01:30:38 pm »
4 connections per axis on an optical encoder:

5v
Ground
A
B

**Diagram and tables from Wikipedia link above.**

This diagram shows the output when the wheel turns clockwise.



Coding for clockwise rotation
Phase   A     B
1         0      0
2         0      1
3         1      1
4         1      0
   
Coding for counter-clockwise rotation
Phase   A     B
1         1      0
2         1      1
3         0      1
4         0      0


Scott
« Last Edit: April 24, 2013, 01:34:16 pm by PL1 »

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #7 on: April 24, 2013, 01:39:50 pm »
THanks both.

That still doesn't make this make sense though as to why when I connect up all 4 nothing is happening. Ive now taken out the wheel and encoder and playing with it on a table, Im still getting nothing. Below are some screen sots and a photo.


BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #8 on: April 24, 2013, 01:46:16 pm »
Do you have a meter?

First thing I would do is make sure both signal pins are pulsing 5v, otherwise the encoder is bad.

Also look at the traces on the back of the encoder PCB and make sure 5v and GND are going to the same pins on both sensors that the wheel passes through.
If not, you've got the pins on the encoder mixed up.


MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #9 on: April 24, 2013, 01:48:53 pm »
Encoder is fine as the cabinet still works. I have checked the wiring diagram and the wore colours are correct. Ill trace the board now and see if it is correct.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9674
  • Last login:Today at 04:43:48 am
  • Designated spam hunter
Re: Help with 360 wheel encoder to UHID
« Reply #10 on: April 24, 2013, 01:53:45 pm »
Unless I'm missing something, the problem appears to be that you only have one quadrature input (yellow) on the UHID.

One pin should be orange (5v)

One should be blue (ground)

Two should be yellow (Quadrature inputs)


Scott
Edit: D'oh! Before I zoomed in to confirm, the red outline and yellow blended to look like orange.
*cleans glasses*
« Last Edit: April 24, 2013, 02:01:16 pm by PL1 »

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #11 on: April 24, 2013, 02:08:48 pm »
Unless I'm missing something, the problem appears to be that you only have one quadrature input (yellow) on the UHID.

One pin should be orange (5v)

One should be blue (ground)

Two should be yellow (Quadrature inputs)


Scott
Edit: D'oh! Before I zoomed in to confirm, the red outline and yellow blended to look like orange.
*cleans glasses*

Bottom right of the photo? Is that not right?

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #12 on: April 24, 2013, 02:11:49 pm »
I guess my question is, when I strike the ground and a mouse x pin the mouse jumps left. When I strike a mouse x and 5v it does nothing. is that right? Can the Uhid see this output from this encoder that is pulsing 5v?

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #13 on: April 24, 2013, 02:23:29 pm »
I guess my question is, when I strike the ground and a mouse x pin the mouse jumps left. When I strike a mouse x and 5v it does nothing. is that right? Can the Uhid see this output from this encoder that is pulsing 5v?

You're not going to be able to duplicate the output of the encoder sufficiently for it to do anything.
These aren't simple left and right signals.  I'd refrain from jumping the pins.

If the UHID mouse x pin is putting out 5v, it probably isn't configured right.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9674
  • Last login:Today at 04:43:48 am
  • Designated spam hunter
Re: Help with 360 wheel encoder to UHID
« Reply #14 on: April 24, 2013, 02:29:54 pm »
Bottom right of the photo? Is that not right?

One pin *looked* orange at first, but it is yellow (quadrature) with a red outline (selected pin).

The selected pin settings appear to be right.

Is the other quadrature pin (6?) configured the same? (Mouse, X)

Have you tried reprogramming the board?


Scott

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #15 on: April 24, 2013, 02:30:56 pm »
Its not I've configured 2 other pins from the J4 block. one for gnd and one for 5v as per picture.

And to think I thought this was goign to be the easy part!


MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #16 on: April 24, 2013, 02:31:35 pm »
Bottom right of the photo? Is that not right?

One pin *looked* orange at first, but it is yellow (quadrature) with a red outline (selected pin).

The selected pin settings appear to be right.

Is the other quadrature pin (6?) configured the same? (Mouse, X)

Have you tried reprogramming the board?


Scott

Yes but ticked reverse.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #17 on: April 24, 2013, 02:33:37 pm »
I was just thinking along the same lines (because I've run out of other ideas)

You need to have 2 pins configured as x-axis and in mouse mode.
They must both be connected to the encoder at the same time or it isn't going to do anything.


MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #18 on: April 24, 2013, 02:40:13 pm »
As replied above. It does it automatically. Striking either pin to ground affects the mouse cursor. just doesn nothing on the encoder. bloody thing

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #19 on: April 24, 2013, 02:49:41 pm »
Just to humor us, do a screen grab with the other quadrature pin highlighted.

If nothing comes of that, time to email Andy at Ultimarc if he doesn't show up in this thread.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9674
  • Last login:Today at 04:43:48 am
  • Designated spam hunter
Re: Help with 360 wheel encoder to UHID
« Reply #20 on: April 24, 2013, 02:53:53 pm »
Two more things to consider:

1. From the UHID manual:
Note that only certain pins can be configured for quadrature devices. These can be seen in U-Config by clicking on the "Quadrature" line in the PCB image. Appropriate pins will be highlighted.


2. Are you sure the "reverse" should be clicked on the second pin? 


Scott

Edit: Double checked.  J4 and J5 pins are OK for Quadrature inputs.
« Last Edit: April 24, 2013, 03:20:04 pm by PL1 »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:10:53 am
  • ...
Re: Help with 360 wheel encoder to UHID
« Reply #21 on: April 24, 2013, 02:54:56 pm »
With the encoder powered by the UHID, do the signal wires output 5v pulses when you turn the wheel by hand?

AndyWarne

  • Trade Count: (+18)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1938
  • Last login:April 11, 2021, 03:37:09 am
    • Ultimarc
Re: Help with 360 wheel encoder to UHID
« Reply #22 on: April 25, 2013, 04:36:04 am »
With the encoder powered by the UHID, do the signal wires output 5v pulses when you turn the wheel by hand?

Yes that's the most important check.

I would think either one or both of the sensors is not working, or the sensors are wired in such a way that instead of pulling the signals to ground (the U-HID pins have pull-up resistors), they are pulling them to 5 volts which would not work. If this is the case this is fixable but might need some hacking of the sensor PCB tracks.

MartinJames

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:March 28, 2021, 10:10:33 am
Re: Help with 360 wheel encoder to UHID
« Reply #23 on: April 25, 2013, 07:11:19 am »
Hey Andy, Ive just emailed you this:-

Thanks for the quick reply.

The UHID is out putting 5.01v. When connected to the optic it drops to 4.63v measured from the power pins. When rotated both X1 & X2 pins fluctuate squarely between -0.3v to 4.63v alternating between them. I am 100% sure everything is connected correctly and the UHID is programmed correctly. I am on Firmware 1.3. Please see below.


I am happy to replace the optic boards with recommended ones if you have any. I notice the happ ones seem to work well but cant find any in the UK.

M