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: Online electronics parts store?  (Read 13356 times)

0 Members and 1 Guest are viewing this topic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Online electronics parts store?
« on: June 28, 2019, 11:35:24 pm »
Are there any online electronic parts stores left that offer free and/or reasonable shipping?  Wanted to pick up a 12 position rotary encoder for a project.... the part was $1 and shipping was $9.  I just thought maybe I was looking in the wrong place.  Normally I turn to ebay for this sort of thing, but I don't want to wait two months for it to come in and they don't seem to carry 12 position encoders anyway. 

pbj

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10871
  • Last login:Yesterday at 03:47:56 pm
  • Obey.
    • The Chris Burke Band
Re: Online electronics parts store?
« Reply #1 on: June 29, 2019, 12:47:24 am »
Tayda electronics

Ken Layton

  • Guru
  • Trade Count: (+1)
  • Full Member
  • ****
  • Offline Offline
  • Posts: 7061
  • Last login:October 12, 2021, 12:25:59 am
  • Technician
Re: Online electronics parts store?
« Reply #2 on: June 29, 2019, 10:40:06 am »
I generally order from these suppliers:

Jameco Electronics

Mouser Electronics

Digi-Key (accepts Paypal for payments)

Newark/Element14

All Electronics

They generally have what I need at reasonable prices, but shipping charges are getting up there plus they all now are forced to collect sales tax too.
« Last Edit: June 29, 2019, 11:50:48 pm by Ken Layton »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #3 on: June 29, 2019, 11:29:14 am »
Allied Electronics is another good supplier.   ;D


Scott

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2895
  • Last login:August 11, 2023, 06:24:58 am
Re: Online electronics parts store?
« Reply #4 on: June 29, 2019, 01:16:48 pm »
I think the whole point was the shipping, Allied for example can be crazy in that light, but a nesessary evil depending on what your buying ...I find Jenn buys in bulk from most of those suppliers (little from epay/amozon) in intrest of quality  but the savings offsets shipping.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #5 on: June 29, 2019, 01:45:52 pm »
 :angry: :angry:

Been going down everyone's suggestions.... so far either they don't carry the part or they charge ~ 10 bucks shipping. 

Maybe I should clue you guys in for some general advice.

My 3d printer has been sitting un-used for a few months now.  I thought it might be cool to make something arcade-related for the hobby.  I was going through my parts when I ran across a sanwa  joystick.  It's really close to a ls-30 rotary joystick and the fact that the ball-top comes off and the e-clip is roughly the same size as the plastic sleeve on the shaft makes it a fairly easy hack.  I was just going to design the top(s), a new restrictor plate with a larger hole and a shaft extension that mates to a commonly found, off the shelf encoder (to save with the number of inputs used). 

Now here's the thing.  As you know, ikari warriors and most of the popular rotary games used a 12 position switch.  The modern equivalent would be a 12 position rotary encoder.  Well those aren't super common.  What's common is a 20 position rotary encoder.... you can buy a 5 pack of those with knobs on amazon all day long.  I'm also going to write some software for an Arduino Uno to run everything, so a 20 position encoder would also work... I would just ignore the extra clicks, but you would feel those clicks when you turn the knob. 

So I'm not sure where to go with this one as the end goal is to design a kit to allow people to inexpensively play the rotary games without much fuss.  Should I stick to my guns with a 12 position encoder, forcing people to go on a snipe hunt and pay 10 bucks shipping, compromise somewhat and design it around a 20 position encoder or just give up and use an old-school 12 position switch, which would really up the cost as they are more pricey, have the same shipping problem, and take up too many inputs, which would require two arduinos?  The other thing is that all three parts have a generic shaft on the end.  If I could find a common size shaft in all three styles of parts, that would be ideal as the shaft extension design could work for all three... it'd probably be best to look at some of the common 20 positions and go from there. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #6 on: June 29, 2019, 04:16:42 pm »
It's really close to a ls-30 rotary joystick and the fact that the ball-top comes off and the e-clip is roughly the same size as the plastic sleeve on the shaft makes it a fairly easy hack.  I was just going to design the top(s)
Already designed and tested the handle, eject pins, and handle top. (not shown)   :cheers:

http://forum.arcadecontrols.com/index.php/topic,158266.0.html

The OpenSCAD code is parametric so you can easily change variables like shaft diameter or the height above the CP.







take up too many inputs, which would require two arduinos
Here's how the GP-Wiz40 and KADE handle rotary joystick inputs from an LS-30 or a Happ mechanical rotary joystick 12 position switch.

The 13 pin connector has 12 directions + ground, but you only need three inputs + ground.

Connect every third directional connection together and you're good-to-go -- 1(1), 2(2), 3(3), 4(1), 5(2), 6(3), 7(1), 8(2), 9(3), 10(1), 11(2), 12(3) + ground.

Input 1->2, 2->3, or 3->1 = right turn. (output keystrokes only on transition)

Input 3->2, 2->1, or 1->3 = left turn.

The 3-input pattern instead of the 12-input works because the keystrokes that MAME looks for are relative, not absolute.

In other words, rotary games only look for inputs to indicate if you're turning right/left, not "wire 7 is grounded so you're facing 180 degrees."

Each click is a 30 degree (1/12th) rotation of the stick, but a 45 degree (1/8th) turn on the screen.


Scott
« Last Edit: June 29, 2019, 04:42:55 pm by PL1 »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:47:02 pm
  • ...
Re: Online electronics parts store?
« Reply #7 on: June 29, 2019, 06:31:32 pm »
I did a 3D printed rotary setup for sanwa JLFs a while back.  Works fine.  Too busy with other stuff to implement it on my cab (don't have enough depth at the moment).
http://forum.arcadecontrols.com/index.php/topic,152784.msg1599616.html#msg1599616
The detents of the switch linked in that thread have a very good feel.  Not has hard as original arcade sticks, but enough that there is no doubt whether you've moved one or two clicks.
I had previously tried rotary optical encoders thinking it could be used for spinner and driving games, but it sucked without the detents.

TLDNR: The closer the yoke is to the pivot point level of the joystick shaft, the less you can feel its presence.


Let me know if you want the files.

EDIT: bracket for Alps switch   https://www.tinkercad.com/things/77OzLAC8Q1L 
coupler: https://www.tinkercad.com/things/fVXXvPPj2ju
sleeve to hold coupler halves together: https://www.tinkercad.com/things/jzYmrPW284t
possibly useful "tolerance test: : https://www.tinkercad.com/things/6sh9aQ2vu2M
DISCLAIMER: IT HAS BEEN YEARS SINCE I MESSED WITH THIS AND YOUR PRINTER COULD HAVE DIFFERENT TOLERANCES.

DOUBLE EDIT: OMG, blocky faces on those rounded parts!  I've improved, but am still limited to Tinkercad.  :lol
« Last Edit: June 29, 2019, 07:01:27 pm by BadMouth »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:47:02 pm
  • ...
Re: Online electronics parts store?
« Reply #8 on: June 29, 2019, 06:36:04 pm »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #9 on: June 29, 2019, 07:30:41 pm »
Well dang guys nevermind.  I knew about the joystick tops but I didn't realize somebody had already made all the other hardware. 

Maybe I should just work on the software end then...I'd like to see something for the very low end avrs that could handle a full ikari layout with maybe some shifted keys as well. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:47:02 pm
  • ...
Re: Online electronics parts store?
« Reply #10 on: June 29, 2019, 08:48:25 pm »
We'll, I never did refine it enough for public release.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #11 on: June 29, 2019, 09:02:05 pm »
Hmm.... well maybe I can work on it a little.  Ideally it'd be nice to have the yoke generic enough to where it would work with any kind of encoder/switch assuming the shaft size is the same.  I've gotta say though, what you made is pretty close to what I had in my head. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #12 on: June 29, 2019, 09:58:35 pm »
Maybe I should just work on the software end then...I'd like to see something for the very low end avrs that could handle a full ikari layout with maybe some shifted keys as well.
I don't know of any rotary encoder software/firmware that would work with the KY-040 encoders you mentioned earlier -- pretty sure that it outputs quadrature waveforms like an optical (mouse) circuit.

Perhaps a composite mouse + keyboard device would work for that hardware setup.
------------
KADE miniArcade 2.0 firmware has already been well-tested with 12-position rotary switch hardware.

It is highly customizable and works with a wide variety of 32u4 boards like the MattairTech MT-DB-U4, Arduino Micro, Teensy 2.0, etc.
- P1 rotary is on ports B 4, B5, and B6.
- P2 rotary is on ports C6, C7, and D2.

There's full documentation in the User Guide.   ;D





The Arduino Pro Micro can only support a single rotary stick because port C7 isn't available.




Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #13 on: June 29, 2019, 11:09:25 pm »
The kade software is impressive, but I'm trying to aim at low end avrs.  The teensy is inexpensive to be sure, I've used them in the past, but an uno clone is practically free.  I wasn't going to use the ky encoders... I'll post a link of the one I found when I find it again (too much search-fu).  It's just a 2-bit, two pin system... real easy to write a relative direction check for it.   

Ken Layton

  • Guru
  • Trade Count: (+1)
  • Full Member
  • ****
  • Offline Offline
  • Posts: 7061
  • Last login:October 12, 2021, 12:25:59 am
  • Technician
Re: Online electronics parts store?
« Reply #14 on: June 29, 2019, 11:47:24 pm »
Allied Electronics is another good supplier.   ;D


Scott

But Allied Electronics is a business-to-business supplier. It's right there in the Term and Conditions on their website:

"Allied is a business to business supplier. Its catalog and any specialogs and other product brochures produced by Allied are intended for use by business customers and not consumers. By ordering, the Customer represents and warrants that Customer is acquiring the Products on behalf of a business and not as a consumer."

Allied does NOT accept Paypal and here are the payment terms:

Cash with order.

Credit card.

Net 30 days.
« Last Edit: June 29, 2019, 11:54:44 pm by Ken Layton »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #15 on: June 30, 2019, 12:59:24 am »
Digikey seems the cheapest so far.  Still 5 bucks for shipping, but it's a whole hell of a lot cheaper than 10 bucks for shipping and adding extra parts doesn't seem to up the shipping price. 

Anyway, this is the style of encoder I was thinking:

https://www.digikey.com/product-detail/en/PEC11R-4315F-S0012/PEC11R-4315F-S0012-ND/4699232/?itemSeq=296805556

There's also a cheaper, plastic style, but I've just got a feeling that the signal is going to bounce a lot on that one. 

https://www.digikey.com/product-detail/en/EN12-HS11AF25/987-1194-ND/2408772/?itemSeq=296825245

One of the reasons I wanted to use something like this is to reduce the vertical height of the shaft extension..... it'd be nice to be able to fit a converted stick inside a madcatz/hori joystick enclosure.  That's a tall order I know, but I'm just thinking there aren't a lot of people that will want this on their main mame cab as the yoke makes fighters hard to play.

Anyway, the coding, in theory at least is easy.  Read A and B and then wait for the change... if they are both equal then it's a tick clockwise, if they differ then it's a tick counter clockwise.   

It very well may be that the rotary encoders are too cheap to work on a joystick and that's why the beefier 12 position switches were used, but I'd like to find out.  With PL1's excellent wiring suggestion I can do the 12 way as well, it'd just be bigger and take an extra input pin. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #16 on: June 30, 2019, 10:18:47 am »
Anyway, the coding, in theory at least is easy.  Read A and B and then wait for the change... if they are both equal then it's a tick clockwise, if they differ then it's a tick counter clockwise.   
Wait, wut?   :dizzy:

The encoder you linked to outputs quadrature wave forms when rotated.  It is the mechanical equivalent of the optical circuits in a spinner/trackball/mouse.

For example:
Last read was A=1 and B=1, your starting point is Phase 3.

Next read
- A=1 and B=1, you are still on Phase 3 ==> no change, no movement.
- A=0 and B=1, you've changed to Phase 2 ==> one step counter-clockwise
- A=1 and B=0, you've changed to Phase 4 ==> one step clockwise



One thing that could make coding for these encoders different from a typical spinner is that each of the 12 detents are centered on Phase 3.
- Datasheet "Quadrature Output Table" diagram shows a dashed line labeled "D" (detent) running vertically through Phase 3.

12 detents and "12 Pulses per 360 ° Rotation" ==> Turn one click = move 4 phases.

You may want to convert each 4-phase clockwise or counter-clockwise transition to a single keystroke output instead of mouse movements for easier setup in MAME.


Scott
« Last Edit: June 30, 2019, 10:21:24 am by PL1 »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #17 on: June 30, 2019, 03:26:54 pm »
Yeah your right.  Was reading up last night about how the detents made them behave differently than you would expect and got some bad info from a site.  Regardless it's super simple was my point. 

I probably need to use interrupts for these... might help with any noise as it'd self correct fairly quickly.   I don't know though, I'm thinking with only 12 positions a normal loop would do ok... have to wait and see.  Thanks for the advice/info guys. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:47:02 pm
  • ...
Re: Online electronics parts store?
« Reply #18 on: June 30, 2019, 04:28:40 pm »
Anyway, this is the style of encoder I was thinking:

 :lol  I've also experimented with that style.  The idea with that one was to build everything including the yoke into a PCB.
I'm not sure if I ever posted it.  IIRC, it was 12 or 16 step.  It was from sparkfun, possibly this one: https://www.sparkfun.com/products/9117
It was very inconsistent, possibly due to the super low resolution.  Sometimes it would register the turn, sometimes it wouldn't.
Giving it a full twist always resulted in less than a full twist.  I was using an opti-wiz from groovygamegear as the interface.
Not sure if it was the interface or MAME that didn't like the low resolution, but 300+ count encoders worked fine.
If you're making a dedicated interface, that may not matter.

EDIT: That was back in 2012! http://forum.arcadecontrols.com/index.php/topic,122506.msg1312156.html#msg1312156
It turns out that it worked on Ikari Warriors, but not on other rotary games.  So it must have been a MAME issue.
I guess that won't be an issue if you are converting the input to key strokes.
« Last Edit: June 30, 2019, 04:33:51 pm by BadMouth »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #19 on: June 30, 2019, 06:35:10 pm »
Yeah your right.  Was reading up last night about how the detents made them behave differently than you would expect and got some bad info from a site.
Did a little more research and the approach you were talking about earlier looks like it might be a better method.   :cheers:

With the detent centered at Phase 3, both data lines start high.

Instead of monitoring both data lines looking for a change, you only need to monitor line A.

When line A goes low, read data line B.

- If the knob is turned clockwise, the drop happens going from Phase 4 to Phase 1 so line B will be low. (lines match)

- If the knob is turned counter-clockwise, the drop happens going from Phase 3 to Phase 2 so line B will be high. (lines don't match)

- Once both data lines are high again (back to Phase 3), resume monitoring line A for the next drop.



Here's an example with animation and code.



He posted more info and code at https://howtomechatronics.com/tutorials/arduino/rotary-encoder-works-use-arduino/


Scott

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #20 on: June 30, 2019, 07:04:30 pm »
Giving it a full twist always resulted in less than a full twist.
That's normal operation for all of the mechanical rotary games I can think of.

The player on the screen could face either one of the four cardinal directions or one of the four diagonal directions -- 8 possible directions.

If you turn the handle one click = 30 degrees = 1/12th rotation.

That same click turns the player on the screen 45 degrees = 1/8th rotation.


Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #21 on: July 01, 2019, 01:43:03 am »
Yeah these games and the rotary sticks in general are weird.  The 12 position thing is odd.  I'm not sure if they got a deal on cheap 12 way switches, in play testing they determined that little hands had trouble twisting the knob all the way around or what. 

I'm going to order some stuff tomorrow for testing.  The plan is to have the Arduino  show up as a composite device (mouse, keyboard and serial) but that entirely depends upon if I can get things working well with the rotation being fed into the mouse axis.... I might have to go old school and do button presses like that old ultimarc board did.  I really need to research custom composite devices.... it'd be nice to get the board to show up as two gamepads.... I could add a mode to send the rotation to the second thumbstick as an absolute position if the fire button is pressed, which would allow you to play modern twin stick games

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #22 on: July 01, 2019, 09:09:09 pm »
So paypal just sent me a $5 off $15 coupon.  I'll order a bunch of stuff and the fiver will handle shipping so I won't feel as ripped off at least. 

PL1... Did you ever model the dataeast joystick top?  Been trying to find some dimensions on it but the best I can do are some pics.... seems to be a bit fatter than the snk version and the cap is also bigger.  I know I'm the odd man out on this but I always liked heavy barrel better than ikari warriors back in the day and thus I'm used to that style stick. 

Mr. Peabody

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 810
  • Last login:November 05, 2019, 02:30:42 pm
Re: Online electronics parts store?
« Reply #23 on: July 01, 2019, 09:23:56 pm »
I had a hard time orienting the last time I played Ikari Warriors. I wonder what the optical set-up was like....

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #24 on: July 01, 2019, 11:58:08 pm »
PL1... Did you ever model the dataeast joystick top?  Been trying to find some dimensions on it but the best I can do are some pics.... seems to be a bit fatter than the snk version and the cap is also bigger.  I know I'm the odd man out on this but I always liked heavy barrel better than ikari warriors back in the day and thus I'm used to that style stick.
Unfortunately, not yet.

8BitMonk was kind enough to loan me an SNK LS-30 handle so I could get exact measurements for that model.   :notworthy:

Just PM'd someone who might have a spare Data East handle.

Otherwise, if someone else has one that I can borrow for measurements, please PM me.   ;D

 

The good news is that the Data East handle should be easy to model, assuming I can get/guess the measurements and figure out how to round the upper and lower edge of a cylinder.
- The only other thing needed is a clean copy of the "DE + curved arrow" logo. (preferably black and white)

If we can't find a loaner DE handle, I could probably get pretty close using the pics above or you can change the variables in the Ultimarc LS30 handle OpenSCAD code (lines 18-69) to make that octagonal handle as large as you'd like.   :lol

I had a hard time orienting the last time I played Ikari Warriors. I wonder what the optical set-up was like....
There was no optical on the Ikari Warriors cab.  It used an LS-30.

It would be harder to accurately orient yourself if you were using an optical rotary stick with 24-transitions-per-revolution and no detents, compared to the original 12-position mechanical rotary stick where turning 1 click = 45 degree turn on screen.

Another possible problem is using a mechanical rotary stick with the default settings in MAME.  That doesn't always give you a 45 degree turn for each click.

For rotary encoders that send one keystroke per click:
Quote
"Input (this Game)" menu

    Positional Analog to none

"Analog Controls" menu

    Positional Digital Speed = 0
    Positional Sensitivity = 100

The MAME settings for Howard's encoder will be different if he uses mouse movements for rotary.


Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #25 on: July 02, 2019, 12:16:06 am »
I'm going to try and support both methods... just so we have options.  I might go ahead and get some 12 position switches as well as the rotary encoders... might as well support it all.  :)

Yeah I looked into the few games that used the optical sticks and, in mame at least, the regular 12 pos sticks should work ok the way things are hooked up(with more limited resolution of course) but it seems like things would be awkward the other way around.   I think there's an ikari clone and two kinda crappy football games or something like that.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #26 on: July 02, 2019, 01:57:25 am »
I think there's an ikari clone and two kinda crappy football games or something like that.
Considering the game list, current optical rotary sticks are usually not worth the cost.

Optical Rotary Joystick Games (Loop-24 or Happ Optical Rotary Sticks)
    Caliber .50
    Exterminator
    Touchdown Fever
    Touchdown Fever II

Not sure if it would throw off gameplay in the mechanical rotary games, but you might also want to try the 12 PPR, 24 detent version here of the 12 PPR, 12 detent encoder you mentioned above.

With the right rotary encoder outputs and MAME settings, it could support both optical and mechanical rotary games.

The downside is that mechanical rotary games would either have double the sensitivity or require two clicks per step.


Scott

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #27 on: July 02, 2019, 09:25:45 pm »
The good news is that the Data East handle should be easy to model, assuming I can get/guess the measurements and figure out how to round the upper and lower edge of a cylinder.
The rounded cylinder code is easier than expected -- 7 lines to minkowski sum a cylinder and a sphere vs. 100 lines to generate the 32 spheres that define the boundaries of the octagonal handle hull.   ;D

Code: [Select]
$fn=180;
minkowski()
{
  cylinder(d=40,h=55);
  translate ([0, 0, 3])
  sphere(r=3);
}

Animation showing the minkowski sum of a triangular shape and sphere.


Most of the remaining handle code is either plug-and-play reusable or not needed.   ;D


Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #28 on: July 03, 2019, 01:42:59 am »
Nice work man.  So the logo image... do you need vector or just a really big raster?  I used to be pretty good at flattening out and removing distortion from pics in my 3DArcade days.... that pic you included should be good enough to recreate the design. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #29 on: July 03, 2019, 03:21:07 am »
Nice work man.  So the logo image... do you need vector or just a really big raster?  I used to be pretty good at flattening out and removing distortion from pics in my 3DArcade days.... that pic you included should be good enough to recreate the design.
Great!  Either format should work.   ;D

If possible, put the logo and arrow in black on a square white background the same height/width as the removable cap.  (no circle)

The LS-30 SNK logo was made from a 666x555 px PNG that was imported, vectorized and exported as a DXF using this Inkscape plugin and this workflow procedure.

Code: [Select]
Convert an image to DXF for OpenSCAD

1. Prep the image in MSPaint.

2. Open Inkscape.

3. File -- Document Properties (Shift+Ctrl+D)
==> Set document size, units = mm

4. View -- Zoom -- Page

5. File -- Import
==> Import image into inkscape

6. Select image (resizing arrows visible)

7. Path -- Trace Bitmap (Shift+Alt+B)
Adjust settings.  When preview looks good, click OK then close the "Trace Bitmap" window.

8. Select then delete the original image, leaving the traced path.

9. Clean up the path as desired.

10. Position and scale image
(Ctrl+Click+Drag Corner to maintain ratio _or_ enter the position/size info via the Inkscape toolbar)

11. Select everything (Ctrl+A) and ungroup all groups. (Ctrl+Shift+G)

12. Path -- Object to path (Ctrl+Shift+C)
==> Converts everything into paths.

13. Ungroup all groups again. (Ctrl+Shift+G)

14. Path -- Union

15. Open the layer window (Ctrl+Shift+L), create new layer, name the new layer. i.e. Layername

16. Cut/paste the paths onto the new layer.

17. Delete the old layer.

18. File -- Save

19. File -- Save as and select “OpenSCAD DXF Output” as the file type.

20. SCAD code
translate([X, Y, Z])
linear_extrude(height = 2, convexity = 10)
import(file = "Filename.dxf", layer="Layername");

NOTE: Filename (Filename.dxf) and layer (Layername) are case sensitive.

Files are coming along quickly:
- Test Print (shaft diameter) - Done
- Test Print 2 (hex locknut) - Done
- Handle - Get handle/panel-clearance measurements, add comments, and set variables
- Eject pins - Set PinHeight variable
- Handle top - Update logo code and set TopDiameter variable
- Diagram - Label handle/panel-clearance measurements
- DE_Logo.svg (Inkscape) - Awaiting logo
- DE_Logo.dxf (Inkscape) - Awaiting logo


Scott
« Last Edit: July 03, 2019, 03:41:14 am by PL1 »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #30 on: July 03, 2019, 11:13:55 pm »
Yeah that's doable.  Probably wait until after the 4th though. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #31 on: July 05, 2019, 10:54:02 pm »
Worked on the joystick logo a little..... I need to adjust things around to compensate for the distortion, but it's actually pretty minimal considering.  The arrows probably need cleaned up a little too.  I'll finish it up tomorrow. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #32 on: July 06, 2019, 02:17:06 am »
Looks great.   :applaud:

No response yet from the guy who might be able to provide accurate measurements.

He hasn't logged in lately so I sent an e-mail.


Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #33 on: July 08, 2019, 02:23:43 pm »
I've got the logo done, but I still need to convert it to 3d.  My 3d printer came with software that can generate 3d via a raster image.... would that work or would you prefer me to process it through inkscape first?

Parts came in today.  I will no longer complain about the shipping from digikey.  Shipped in a super sturdy box with anti-static, recyclable stuffing.  Each part was clearly labeled and in it's own bag.  Looked like 5 bucks worth of care was put into filling this order if nothing else. 

So I ended up ordering the 12 and 24 ppr versions to try them both out.  Glad I went with the all metal variants as they are amazingly sturdy.  I couldn't get them to flex or anything and that was a concern since they aren't nearly as beefy as the old 12 pos switches.  Been doing research and creating a joystick mouse and keyboard composite device isn't easily possible with the uno's chipset so I'll probably stick to just a keyboard and mouse and then maybe do a joystick version later on.  I should be able to something fairly robust.   Might as well include the option to do a simple trackball/spinner control panel as well, I mean it's the same code basically.  Just trying to make a dirt cheap option for inexpensive cab conversions, similar to the zero delay but for stuff other than joysticks. 

Anyway, I'll start coding tonight probably.  I'll keep you all posted. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #34 on: July 08, 2019, 07:02:19 pm »
I've got the logo done, but I still need to convert it to 3d.  My 3d printer came with software that can generate 3d via a raster image.... would that work or would you prefer me to process it through inkscape first?
I can do the conversion for you.  (It will also let me verify that the code for the top is working properly.)

The Inkscape==>DXF==>OpenSCAD process is the best option here.

- Not everyone will have the software that came with your printer, but anyone can get Inkscape and the plugin.

- The removable top has a slight taper so it fits snugly.  Not sure if your software has that option.

- Resizing the logo and rendering a new top is really easy -- only 5 steps and no fancy math, just the measurement for the variable TopDiameter.
-- In Inkscape:  Resize the page dimensions to match TopDiameter, resize the vector image to match TopDiameter, and export to DXF.
-- In OpenSCAD:  Re-render the top and export to STL.

Still waiting for a reply from a guy who can probably provide accurate measurements.

Once we get everything sorted out, I plan to cross-post all of the files and directions to Thingiverse like I did with the LS-30 handle here.
- Of course, that's assuming you grant permission to include (and credit) your work on the logo.   ;D

So I ended up ordering the 12 and 24 ppr versions to try them both out.
So . . . 12 and 24 pulses per rotation (1 pulse = 4 quadrature phases), wth how many detents each?

or

Did you order a 12ppr with 12 detents (1 click = 4 quadrature phases) and a 12 ppr with 24 detents? (1 click = 2 quadrature phases)

Just asking because it could make a difference in how you'd approach the code, based on the discussions we've had in this thread.


Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #35 on: July 08, 2019, 08:29:02 pm »
I'll work on that tonight then, thanks.  I can do a taper, but it's not easy to figure out in 2d, probably better to use your method. 

Yeah this whole thing should be open-sourced... the whole point is to make these controls (and as a result the associated games) more accessible to the average Joe. 

I picked up a 12 ppr 12 detent and and 24 ppr 24 detent.  You mentioned that an alternative to the 24 position optical sticks might be the 24 detent, so I thought I would give it a try.  I'm also going to program a "skip mode" for the 24 detent that can be turned on and off via a serial command to only register a turn after two clicks, so assuming a person didn't mind the extra clicks they could use that and have full compatibility.  I tried them out just in my hand.... the 12 feels more like the ikari sticks (softer clicks of course) and the 24 feels more like a radio knob with all the extra stops.  Both have their pros and cons.  It's entirely possible that I order the wrong stuff though..... rotary encoders aren't something I'm intimately familiar with. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #36 on: July 09, 2019, 02:04:14 am »
Good news:
Found a way to automatically resize the logo in OpenScad using the scale command.

Bad news:
X-axis and Z-axis are fine, but the SNK logo Inkscape files I used for testing (original and stretched/resized) induce some sort of wierd Y-axis offset.   :banghead:

Hopefully, creating a properly sized, clean file from scratch will eliminate that.

Yeah this whole thing should be open-sourced... the whole point is to make these controls (and as a result the associated games) more accessible to the average Joe. 
Agreed, and anyone who wants to use your rotary encoder can chose which type of handle they want -- DE round or LS-30 octagon.   :cheers:

I still plan to post the DE handle files by themselves since they can also be used with the Ultimarc rotary conversion kit or original rotary sticks.

I picked up a 12 ppr 12 detent and and 24 ppr 24 detent.
Good.  1 click = 1 pulse = 4 quadrature phases on both of those.   ;D

The approach described in reply #19 above will work for both of those.

You mentioned that an alternative to the 24 position optical sticks might be the 24 detent, so I thought I would give it a try.  I'm also going to program a "skip mode" for the 24 detent that can be turned on and off via a serial command to only register a turn after two clicks, so assuming a person didn't mind the extra clicks they could use that and have full compatibility.
Good news:
If you can get the 24 detent version working with the optical rotary games using keystrokes, you probably don't need "skip mode" for MAME mechanical rotary games.

Use the settings mentioned earlier, but change Analog setting "Positional Sensitivity" to 50 ==> two keystrokes = turn one step.

It worked pretty well on the five or so games I tested.   ;D

Not-so-good news:
Caliber 50 (optical rotary game) is really finnicky with a Happ mechanical rotary stick and a KADE miniArcade rotary encoder -- one click doesn't always equal turn one step.   :dizzy:

It might be the duration of the keystroke or several possible settings in MAME.   :dunno

If you can't find a combination that works reliably for keystrokes, the 24ppr encoder may only be worth pursuing if you use a mouse axis for rotation.   :-\


Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #37 on: July 09, 2019, 02:56:55 pm »
On my end anyway, I can also provide the source image and the photoshop document.  I made it 300dpi and 2.5 inches wide so it should be over-sized for any cap size you'd be able to use.  I think 300 dpi is a high enough resolution, but I'm not sure as some of the resin printers have a really high resolution.  Then again if you can afford a resin printer you can probably just buy some OEM sticks. 

Well if caliber 50 is problematic I could just add a mode to switch them to mouse input instead of a skip mode.... there wouldn't be any real difficulty in adding that. 

On my end I forgot that the uno doesn't natively support showing up as a HID device.  Custom firmware fixes that (I had already done it) and it's not terribly difficult to do, but I need to document the installation process so that other people can actually use this thing when it's done.  Of course I'm using the stock Arduino IDE to actually write the code, it's just the firmware that changes, so if it works on the uno it'll work on any of the more powerful boards.  People have cade for that though. 

My mom got her purse stolen and I'll probably be spending the next day or so setting up her new phone, but I'll get back to this shortly.  Apparently the guys at AT&T didn't turn on icloud backup on her old phone, so she lost everything.  :(  She spent all weekend and had to take a day off yesterday to get everything cancelled and/or changed.  Her replacement phone finally came in, so I guess I'm up. 

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 11:45:17 pm
  • Designated spam hunter
Re: Online electronics parts store?
« Reply #38 on: July 09, 2019, 07:29:28 pm »
Turns out the guy I know who had a few of these handles sold them a while ago.   :(

We're back to either looking for someone else who can provide the measurements or reverse engineering the handle from images.

On my end anyway, I can also provide the source image and the photoshop document.  I made it 300dpi and 2.5 inches wide so it should be over-sized for any cap size you'd be able to use.
That 750x750px image exported to png should be perfect.   ;D

I think 300 dpi is a high enough resolution, but I'm not sure as some of the resin printers have a really high resolution.  Then again if you can afford a resin printer you can probably just buy some OEM sticks. 
No worries about printer resolution.

As long as the STL model isn't excessively jaggy, the slicer software will output a smooth path.

On my end I forgot that the uno doesn't natively support showing up as a HID device.  Custom firmware fixes that (I had already done it) and it's not terribly difficult to do, but I need to document the installation process so that other people can actually use this thing when it's done.  Of course I'm using the stock Arduino IDE to actually write the code, it's just the firmware that changes, so if it works on the uno it'll work on any of the more powerful boards.
Glad to hear that it will also work on the commonly available 32u4 boards.   :applaud:

People have cade for that though.
The KADE rotary firmwares only work with 12 position rotary switches, not quadrature encoders.

My mom got her purse stolen and I'll probably be spending the next day or so setting up her new phone
I hope she is well.

The rotary encoder/handle project can wait.  Family first.   :cheers:


Scott

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Yesterday at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Online electronics parts store?
« Reply #39 on: July 09, 2019, 10:20:30 pm »
Yeah she's fine.... they didn't steal it off of her or anything... she walked out of a Krispy Kreme without it and when she went back someone had already picked it up.  The Police have a fairly good idea who it is so we just have to wait for them to do their thing and maybe she can eventually get the pics on her old phone back.  Surprisingly I got her new phone fixed tonight.... no headaches setting it up and putting everything back on for once.  Me and Apple products normally don't get along.  It did take 3 frikkin hours though.  :cry:

We can get a decent guestimate from that one pic.  I can check the relative dimensions between the two and give you a percentage difference...it's not going to be super accurate but it'll be in the ballpark.   I know that the height is the same as the ikari sticks at least.  They have a different mounting style... I don't think the tops even come off, but I think I prefer the ikari top's method better anyway.