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: Steering wheel potentiometer less than 270 range  (Read 10356 times)

0 Members and 1 Guest are viewing this topic.

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Steering wheel potentiometer less than 270 range
« on: December 28, 2016, 06:09:58 am »
Hi guys,
I have on old cheap steering wheel (Logic3 Topdrive Gt4 PC247) that I'm thinking of putting into a cabinet. It has a single pot for wheel control and 2 pots for acceleration/brake.
The pedals are OK and trigger the full range of motion on the Y axis.
The wheel can turn 270ish degrees left to right (measured by eye), but turning it 45 degrees on each side (a total of 90), has produced the full range of motion on the X axis!
I opened up the case thinking it had to be a mechanical problem that didn't allow the pot to turn fully. However, I turned the pot by hand while calibrating and only 1/3 of its rotation has any effect.
Does that sound like a typical pot failure? If that's the case, i can either replace the pot or try to install a multi-turn pot. The problem is i don't know if one can calibrate a multi-turn pot to produce a full range on the X axis, without physically turning the pot more than 270 degrees.
Any ideas?

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:Today at 02:40:48 pm
Re: Steering wheel potentiometer less than 270 range
« Reply #1 on: December 29, 2016, 03:38:34 am »
Sounds like the encoder firmware stops sending the values out of the limited pot range.
The pot is ok for me.

Try to calibrate the axis on windows, or within the wheel software, if present: should be enought.

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #2 on: December 29, 2016, 10:01:03 am »
baritonomarchetto thanks.

The wheel doesn't have a driver or a setup utility.
It is recognized in Windows as "USB Joystick" and I've tried numerous time to calibrate it in Windows but it's always the same

shaolindrunkard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 570
  • Last login:August 19, 2021, 11:13:43 am
Re: Steering wheel potentiometer less than 270 range
« Reply #3 on: December 29, 2016, 10:24:20 am »
Sounds to me like the wheel probably has some sort of internal range control. There's probably a button or combination of buttons on the wheel that let you adjust the deadzone/Range. If you don't have the manual it might be difficult to find. The other thing is since this wheel works for PS2 its full range is probably only 180 degrees. I find that any wheel designed for console will have this range because that is the range of the analog sticks. This is not necessarily a problem. My wheel set up is a 270 degree wheel hooked up to an xbox 360 controller once I turn the wheel 90 degree in either direction that's the full extent of the x-axis. I find that it works perfectly fine for 270 degree games with the rest of the travel (about an inch and a half) being an outer deadzone that I don't notice at all.

If your really worried about it I wouldn't waste too much time messing with a cheap wheel and work on getting something else. Doesn't have to be the fanciest but that is definitely an old wheel.

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Steering wheel potentiometer less than 270 range
« Reply #4 on: December 29, 2016, 12:32:46 pm »
I opened up the case thinking it had to be a mechanical problem that didn't allow the pot to turn fully. However, I turned the pot by hand while calibrating and only 1/3 of its rotation has any effect.
Does that sound like a typical pot failure?

No, it sounds like the pot is a "limited deflection" specially made pot which was designed to cover its entire range of resistance over a shorter amount of rotation.
These usually turn up in analog joysticks which don't have as much range of motion as a steering wheel.


If that's the case, i can either replace the pot or try to install a multi-turn pot. The problem is i don't know if one can calibrate a multi-turn pot to produce a full range on the X axis, without physically turning the pot more than 270 degrees.
Any ideas?

It depends on how the wheel was designed, but most likely you could install a standard linear pot (IIRC, they usually cover their range around 280 degrees).

The best course of action would be to take a multimeter and figure out:
1. the maximum resistance of the pot (probably 10k).
2. the actual amount of rotation required to go from 0-10k resistance.

If that information confirms that the pot is covering its full range over 90 degrees, then you probably can just swap in a pot that covers the same range over 270.  I wouldn't go with a multi-turn pot, assuming the pot is just attached to the end of the steering shaft and not geared.
Some of these gamepad devices don't have any way to calibrate and like to see 5k as center, so you'd have to come up with a way to adjust the pot so that it shows 5k when the wheel is centered.

This is making a lot of assumptions, but being that it's a cheap PS2 controller I don't think the PCB in the thing would vary much from a generic PS2 controller.
« Last Edit: December 29, 2016, 12:34:20 pm by BadMouth »

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #5 on: December 29, 2016, 02:00:40 pm »
Thanks again for the help guys.
I just measured the pot and it reads Right:6.8 - Middle:4.0 - Left:0.2 (I didn't know 6.8 pots existed??)
Indeed it seems like a limited deflection pot, as you said BadMouth. It's only about 1/3 of it's rotation that has any effect while measuring it.

I have some nice CTS guitar pots but they are 500k. Is it possible those will work or I should just get a 10k?

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Steering wheel potentiometer less than 270 range
« Reply #6 on: December 29, 2016, 02:11:33 pm »
I have some nice CTS guitar pots but they are 500k. Is it possible those will work or I should just get a 10k?

It depends on whether the controller works off resistance or voltage.
The ones that work off resistance usually only have 2 tabs on the pot wired.
The ones that work off voltage have all 3 wired. 

Google voltage division potentiometer.  A 500k pot will divide voltage into the same way a 6.8k one would.

It won't hurt to try it.  Just make sure they are linear pots or else your car might turn one direction a lot faster than the other.  :lol




immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #7 on: December 30, 2016, 03:55:23 am »
Once again BadMouth you were spot on.
The original pot had all 3 lugs wired.
I had a spare 25K linear pot which was much closer to the original than the CTS. Measured it before wiring it and it had a much greater useful range before reaching its mechanical stops. Removed the old one, soldered the new one and... same effect as the original. 45 degrees on each side is all i got  :cry: But at least I learned something useful, so thank you all for the help!

It won't hurt to try it.  Just make sure they are linear pots or else your car might turn one direction a lot faster than the other.  :lol

And call it "advanced controller tuning"  :lol

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Steering wheel potentiometer less than 270 range
« Reply #8 on: December 30, 2016, 09:28:45 am »
Anyone have an app to view the raw data from the controller to rule out a windows calibration issue?

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Steering wheel potentiometer less than 270 range
« Reply #9 on: December 30, 2016, 09:30:58 am »
Oh...and you could just give up buy a used Logitech for $30 and have force feedback.

shaolindrunkard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 570
  • Last login:August 19, 2021, 11:13:43 am
Re: Steering wheel potentiometer less than 270 range
« Reply #10 on: December 30, 2016, 09:36:30 am »
Here is the manual. Look under Sensitivity adjustment...

https://drive.google.com/file/d/0B3uV03q9g42MblJnM1EzZVlFUTkxdnBLVG5qVG1DRzVUTWpJ/view

Have you tried this?

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Steering wheel potentiometer less than 270 range
« Reply #11 on: December 30, 2016, 10:55:24 am »
Have you tried finding a windows driver for it?  My Logitech momo shows up as a generic joystick until the actual driver is manually installed.  If there is a real driver out there, it probably allows for calibration.
« Last Edit: December 31, 2016, 07:45:36 am by BadMouth »

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #12 on: December 31, 2016, 02:32:58 am »
Thanks again for the help folks.

@shaolindrunkard Unfortunately my wheel is not the one in the manual you posted. It's an older model (probably 10 years old) without FFB, but has the same project description. I already installed this driver and it has no difference. This driver has no GUI app for calibration, the process described in the manual is using the default windows calibration tool.

@BadMouth I think I'll just give up on this cheap thing and either get a proper one, or try a homebrew approach with an arduino and encoder wheels  ;D

shaolindrunkard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 570
  • Last login:August 19, 2021, 11:13:43 am
Re: Steering wheel potentiometer less than 270 range
« Reply #13 on: December 31, 2016, 09:13:21 am »
Not to beat a dead horse but I wasn't talking about the calibration, there is a part in the manual where you hold physical buttons on the wheel in a certain order to change the sensitivity from high, medium and low.

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #14 on: December 31, 2016, 10:20:24 am »
Thanks again shaolindrunkard, I now understand what you mean.
There are no select and start buttons on my wheel and neither is there a green led. There's a 3 position switch though (Hi-Med-Low) to adjust the sensitivity but it doesn't seem to have any effect either  ???
If it was a good piece of gear I would put some more effort, but I guess there's no need in such a cheap wheel.

shaolindrunkard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 570
  • Last login:August 19, 2021, 11:13:43 am
Re: Steering wheel potentiometer less than 270 range
« Reply #15 on: December 31, 2016, 05:18:05 pm »
Gotcha, good luck!

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:Today at 02:40:48 pm
Re: Steering wheel potentiometer less than 270 range
« Reply #16 on: January 01, 2017, 05:09:18 am »
If you are open to the arduino solution, that's the cheapest and more effective way to solve the problem.
Just get an arduino leonardo or micro/pro micro and give new life to your old wheel

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #17 on: January 01, 2017, 10:14:03 am »
If you are open to the arduino solution, that's the cheapest and more effective way to solve the problem.
Just get an arduino leonardo or micro/pro micro and give new life to your old wheel
I just got a leonardo and as of now i opened 2 old mice (one optical, one with a ball) and trying to interface them with arduino. The problem is that every tutorial is about interfacing the whole mouse pcb and I can't seem to find any info about connecting directly to the sensors.
I'm still very newb at this so I'll continue reading

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 02:12:01 pm
  • Designated spam hunter
Re: Steering wheel potentiometer less than 270 range
« Reply #18 on: January 01, 2017, 11:08:18 am »
I just got a leonardo and as of now i opened 2 old mice (one optical, one with a ball) and trying to interface them with arduino.
If you intend to use the Leonardo board as your optical (quadrature waveform) encoder, why do you need a mouse?

The reason to do a mouse hack is to connect 5v/ground/Data A/Data B from your 360 degree steering wheel (or trackball or spinner) to the quadrature encoder in the mouse that translates logic high/logic low changes on the Data A and Data B lines into mouse cursor movement commands.

The problem is that every tutorial is about interfacing the whole mouse pcb and I can't seem to find any info about connecting directly to the sensors.
I'm still very newb at this so I'll continue reading
Search for my posts containing the word "quadrature" -- they have theory of operation, diagrams, troubleshooting tips, etc.


Scott
EDIT: Glancing back at your earlier posts in this thread, are you looking for an optical encoder (360 degree wheel using a slotted disc) or an analog encoder? (potentiometer)
« Last Edit: January 01, 2017, 11:17:00 am by PL1 »

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:Today at 02:40:48 pm
Re: Steering wheel potentiometer less than 270 range
« Reply #19 on: January 01, 2017, 11:45:01 am »
Google "arduino potentiometer" and "arduino joystick library" and you will be ready to go

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #20 on: January 01, 2017, 12:10:50 pm »
If you intend to use the Leonardo board as your optical (quadrature waveform) encoder, why do you need a mouse?

The reason to do a mouse hack is to connect 5v/ground/Data A/Data B from your 360 degree steering wheel (or trackball or spinner) to the quadrature encoder in the mouse that translates logic high/logic low changes on the Data A and Data B lines into mouse cursor movement commands.
As a newb (and also not a native speaker) i might have the terms wrong! What i want to do, is salvage an optical encoder (slotted disc, rotating between emitter-detector) from a mouse, find a way to fix it on the steering axis and housing, connect it to arduino as input, and use the whole thing as a HID device. The particular arduino board i have has this feature. I'll keep the pedalboard as it is with its pots. Those should be easier to connect as sensors on the arduino (i guess!). Programming is another story though  :-\

Search for my posts containing the word "quadrature" -- they have theory of operation, diagrams, troubleshooting tips, etc.

Thank you very much for the help, I'm going to read as much as I can!

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #21 on: January 01, 2017, 12:17:04 pm »
Google "arduino potentiometer" and "arduino joystick library" and you will be ready to go

Thanks again man, that will be useful as i also want to interface with the pots as i said in my previous post.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 02:12:01 pm
  • Designated spam hunter
Re: Steering wheel potentiometer less than 270 range
« Reply #22 on: January 01, 2017, 11:48:48 pm »
What i want to do, is salvage an optical encoder (slotted disc, rotating between emitter-detector) from a mouse, find a way to fix it on the steering axis and housing, connect it to arduino as input, and use the whole thing as a HID device.
Using the disc and optos from a ball mouse is going to be extremely difficult to align and likely to break if it ends up out of alignment.

Instead of that, you might want to use a pre-fab rotary encoder similar to this one or this one.



It is much more rugged and easier to align.  ;D

Depending on how sensitive you want the wheel to be, you can choose from encoders that register 100, 400, or 600 Pulses per Rotation. (100P/R, 400P/R, 600P/R)

The thing to watch out for is if you get a very sensitive rotary encoder, you are more likely to encounter "backspin".

Backspin is caused when the data transitions are faster than the Arduino's sample rate.

When you spin the wheel hard, the Windows cursor should go smoothly to the side and remain steady (no backspin) -- if the cursor wobbles back and forth, you have backspin.


Scott

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #23 on: January 03, 2017, 12:08:54 am »
wow that looks huge compared to the tiny mouse sensors!
Am I right thinking that 100P/R is a bit on the low side and 400P/R is more than enough for a 270 wheel?
I don't want ultra high precision, just something that works better than a pot and have the full 270 range.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 02:12:01 pm
  • Designated spam hunter
Re: Steering wheel potentiometer less than 270 range
« Reply #24 on: January 03, 2017, 05:27:17 am »
Am I right thinking that 100P/R is a bit on the low side and 400P/R is more than enough for a 270 wheel?
I don't want ultra high precision, just something that works better than a pot and have the full 270 range.
Which are you trying to build?

A 360 (optical) wheel or a 270 (potentiometer) wheel?

Generally speaking, neither one "works better" than the other.

Some games are designed for a 360 wheel, other games are designed for a 270 wheel.

360 wheel games use a relative wheel position -- like a mouse, there is no center position only moving right/left from your current position.

270 wheel games use an absolute wheel position -- like a volume potentiometer, the volume of the audio depends on the exact position of the potentiometer.
-------------------------------------------------
Let's go back to your original post.

If you're trying to make your current 270 wheel work over a wider range of motion than 90 degrees, forget about optical sensors and focus on the potentiometer and analog encoder.

Set your multimeter to Volts DC and connect the leads to the center tab and one of the outer tabs (either one will work for this test) on the steering potentiomer.

When the wheel is centered, you should get a reading of about 2.5v.

When you turn the wheel, that voltage should change.

1. What are the lowest and highest voltage readings you get? (0v-5v?  1.4-3.6v?)

2. How many degrees do you have to turn the wheel to go from the lowest voltage to the highest? (90?  270?)

These two answers will determine if the limited-range-of-motion problem is with the potentiometer or the analog encoder.


Scott

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #25 on: January 05, 2017, 02:53:33 am »

Which are you trying to build?

A 360 (optical) wheel or a 270 (potentiometer) wheel?

I want to keep the current wheel (which is able to physically rotate only 270 degrees), but switch the pot for the rotary encoder you suggested. I will then get rid of the current PCB and use an arduino leonardo instead. The arduino will get readings from both the encoder and the pedalboard pots (plus a couple of buttons) and will be used as a HID game controller. (That's the plan anyways!)

If I understand right, you suggest to measure the pot while it is connected (as a voltage divider, right?). I will do that, but I already measured it for resistance while it was unsoldered, and I got 0 to 6.8k by rotating it no more than 90 degrees. But i will measure it again as you suggested, if that makes a difference, and report back. Thank you again for the valuable help!

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Steering wheel potentiometer less than 270 range
« Reply #26 on: January 05, 2017, 07:06:32 am »
Do you really like this wheel that much?

Again, if you keep an eye out, you can pick up a used Logitech momo(get the black one) or driving force (blue one) for around $30.  And then you'd have full force feedback and the Logitech profiler software which changes wheel settings on the fly based on game or emulator.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 02:12:01 pm
  • Designated spam hunter
Re: Steering wheel potentiometer less than 270 range
« Reply #27 on: January 05, 2017, 08:06:42 am »
I want to keep the current wheel (which is able to physically rotate only 270 degrees), but switch the pot for the rotary encoder you suggested.
The absolute position (potentiometer) vs. relative position (mouse) is going to be a problem because the wheel can only turn 270 degrees.

If you connect a 360P/R optical encoder to your wheel and play a game that has 100 possible wheel positions, you'll be fine if you stay +/- 50 degrees from center. (100 pulses)

If you crank the wheel 135 degrees left (135 pulses), the game will move left for the first 50 pulses and ignore the next 85 pulses because the game is already as far left as it can go.

When you return the wheel to center (135 pulses to the right), the game will move right for the first 100 pulses and ignore the next 35 pulses because the game is already as far right as it can go.

To get the physical center position of the wheel to match with the game's center position you would then need to turn the wheel exactly 50 degrees right (50 ignored pulses) and stay +/- 50 degrees of center.

The specific angles and number of positions will vary from game to game, but this is why physically restricted optical wheels are almost non-existant.

The only one that comes to mind is the RoadBlasters yoke -- specific hardware for one specific game.

If I understand right, you suggest to measure the pot while it is connected (as a voltage divider, right?). I will do that, but I already measured it for resistance while it was unsoldered, and I got 0 to 6.8k by rotating it no more than 90 degrees. But i will measure it again as you suggested, if that makes a difference, and report back.
No need to check it as a voltage divider since you've already verified that there is only a change of resistance over 90 degrees of rotation.

I'd recommend looking for a long-life potentiometer (not an el-cheapo Radio Shack model) similar to this one from the Honeywell RV4 series that has 312 degrees of physical rotation.

Related replacement potentiometer threads here and here.


Scott

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #28 on: January 05, 2017, 04:11:17 pm »
Do you really like this wheel that much?

Again, if you keep an eye out, you can pick up a used Logitech momo(get the black one) or driving force (blue one) for around $30.  And then you'd have full force feedback and the Logitech profiler software which changes wheel settings on the fly based on game or emulator.
Hehe, I really don't like this wheel at all and i don't mind spending 30€ or twice as much, what I really like is to learn about stuff I wasn't supposed to know! You know better than me what i mean!

@PL1, first of all thanks again for the help. Regarding the rotary encoder: Before ordering the encoder you suggested I did a little test. I ripped a small encoder out of a cd player which was originally used for volume. Its the kind that rotates "infinitely" and has 24 indents.
I found a sketch for arduino and with the help of my son modified it a bit, and we were able to control how much each indent moved the axis to the left or right, so as not to exceed a total of 270 degrees. If I were to put this encoder on the wheel, the physical stops of the wheel wouldn't let it move beyond that.
Now, this is a "low res" encoder, so if I get the one you pointed me to, I will modify the values in the sketch so that each pulse=desired rotation.
I hope I'm not missing something and thank you again!

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #29 on: February 08, 2017, 03:50:34 am »
I'm bumping this because i want to thank you all for introducing me to the wonderful world of arduino and encoders.
I went as far as making a wheel from scratch (for couch playing), out of parts lying around. I only ordered the encoder which was 12$ shipped.
It's crude and ugly but it works beyond my expectations! On to the pics (Vintage look warning  ;D):








The construction is simple: 2 pulleys(from real car water pump and camshaft) with a 2:1 ratio, a timing belt and a tensioner. With this setup the wheel can rotate720 degrees. On one end of the big pulley there's an anchor point where 2 springs are attached. There's a metal rod welded on the frame (hard to see in pics) that prevents the big pulley from rotating more than 180 degrees on each side (that translates to 360 degrees on each side for the wheel axis pulley). A 400 PPR encoder is coupled on the steering axis. The arduino sketch is setup for quadrature output, which is able to produce 1600 distinct values.
The sequential shifter was also made from scrap parts. I carved a matching wood knob which still has to be lacquered.
Finally, I kept the old wheel pedalboard which, surprisingly, works better than before!

And here's a video of it in action

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:Today at 02:40:48 pm
Re: Steering wheel potentiometer less than 270 range
« Reply #30 on: February 08, 2017, 07:23:14 am »
Code sharing never hurts

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #31 on: February 08, 2017, 08:32:23 am »
Code sharing never hurts

Oops sorry man, I forgot!
Code: [Select]
// ENCODER WIRING
// Red : VCC = 5V
// Black: 0V = GND
// White: OUTA = Pin 3
// Green: OUTB = Pin 2
//////////////////////
//SHIFT WIRING
//Black: GND
//Red: Pin 8
//White: Pin 9
//////////////////////
//PEDALBOARD WIRING
//Yellow (throttle): GND
//Orange (throttle): 5V
//Black (throttle): pin A0
//Green (brake): GND
//White (brake): 5v
//Brown (brake): pin A1
//////////////////////
//BUTTON WIRING
//

#include <Joystick.h>
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,JOYSTICK_TYPE_MULTI_AXIS,
  4, 0,                  // Button Count, Hat Switch Count
  true, true, true,     // X and Y, but no Z Axis
  false, false, false,   // No Rx, Ry, or Rz
  false, false,          // No rudder or throttle
  true, true, false);  // No accelerator, brake, or steering

const int outA = 2;
const int outB = 3;
volatile long encoder = 0; // declare volatile since modified by interrupt routines
long encoder_save = 0;


void setup() {
  Joystick.begin();
  Joystick.setXAxisRange(-1600, 1600);
  Joystick.setYAxisRange(0, 1023);
  Joystick.setZAxisRange(0, 1023);
  pinMode(8, INPUT_PULLUP); //Shift pin
  pinMode(9, INPUT_PULLUP); //Shift pin
  pinMode(outA, INPUT_PULLUP); //Encoder pin
  pinMode(outB, INPUT_PULLUP); //Encoder pin
  // attach interrupts to pins
  // call digitalPinToInterrupt(pin) to be compatible with different Arduino boards
  attachInterrupt(digitalPinToInterrupt(outA), outAChange, CHANGE);
  attachInterrupt(digitalPinToInterrupt(outB), outBChange, CHANGE);
}


void loop() {
  if (encoder_save != encoder) { // only print if new value
    encoder_save = encoder;
    Joystick.setXAxis(encoder);
  }
  delay(10);

  int BrakePot = analogRead(A0);
  int ThrottlePot = analogRead(A1);
  Joystick.setYAxis(ThrottlePot);
  Joystick.setZAxis(BrakePot);

  //Shift Up
  if(digitalRead(8) == LOW){
    Joystick.setButton(0, 1);
    } else {
     Joystick.setButton(0, 0);
    }

  //Shift Down
  if(digitalRead(9) == LOW){
    Joystick.setButton(1, 1);
    } else {
     Joystick.setButton(1, 0);
    }

  delay(10);        // delay in between reads for stability
}


// interrupt routines
void outAChange() {
  // when outA changes, outA==outB means negative direction
  encoder += digitalRead(outA) == digitalRead(outB) ? -1 : 1;
}

void outBChange() {
  // when outB changes, outA==outB means positive direction
  encoder += digitalRead(outA) == digitalRead(outB) ? 1 : -1;
}

It's a patch job, since I'm a beginner, but I got a little help from my son (who's also a beginner)

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Steering wheel potentiometer less than 270 range
« Reply #32 on: February 08, 2017, 08:39:32 am »
Someone has the metal fab skillz.  :applaud:

immortalx

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:February 11, 2017, 01:44:39 am
Re: Steering wheel potentiometer less than 270 range
« Reply #33 on: February 09, 2017, 02:37:56 am »
Haha, thanks man, it's heavy as f##k though  ;D