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: Using parallel port and mamehooker for gun recoils  (Read 13538 times)

0 Members and 1 Guest are viewing this topic.

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Using parallel port and mamehooker for gun recoils
« on: May 25, 2013, 05:45:54 am »
Hi, I posted in the main forum but decided here was probably better seeing as I had no replies!
So what I have so far is Two aimtrak lightguns with recoil solenoids that trigger only when pointing at the screen, What I would like to do is use mamehooker to trigger the solenoids using games with the recoil outputs enabled in Mame and Model2 (if and when howard implements it). I have 2x 24V 5A ITE PSU's to drive the solenoids, Can i use Mosfets similar to the ones on the Aimtrak module to trigger the solenoid using the parallel port. I also understand that the parallel port outputs a voltage during PC startup so would this result in the solenoids being active until windows loads? if so could I use another pin as a Not gate and use mamehooker to enable and disable it when a game supports the recoil?
Any kind person want to draw me up a circuit with the ideal components or would this idea just not work? if so why not, Thanks
« Last Edit: June 14, 2013, 11:28:00 am by charlieram »

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Help using parallel port and mamehooker for gun recoils
« Reply #1 on: May 25, 2013, 08:36:15 am »
You should be able to drive the solenoids with mosfets.
You can use pin 4 (at least this is what i have found) to turn off the mosfets when it is high. (The NOT gate you mentioned).
I have found pin 4 comes on at boot and stays on after windows loads up, but you will need to test it to be sure it works on yours.
When you run your program to fire the solenoids, you can turn off pin 4.
I used a pnp transistor attached to pin 4. You can look at my rotating project thread to see how I did it. (Warning thread is long and may burn the eyes.)

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #2 on: May 26, 2013, 06:56:37 am »
Thanks for the reply, I'm thinking I could actually use the little pcb with mosfets that came with the aimtraks and put the standard trigger switch pcb back in the gun, then all I should need to do is a not gate like this? I also assume I would need transisters wired for each recoil output and control them both with pin 4 and pins 2 and 3 for the recoil pulse, need to work out resister values though.

Edit.
Just remembered in one of your posts about connecting all ground pins so Pin 20 should actually be pins 18-25.
« Last Edit: May 26, 2013, 07:13:02 am by charlieram »

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Help using parallel port and mamehooker for gun recoils
« Reply #3 on: May 26, 2013, 11:12:31 am »
I had to look twice at your diagram, but then I remembered that the out on this circuit is basically just doing the same thing as the trigger button on your gun is doing. (Solenoid load is being handled by a transistor not shown in your diagram.)
I dont see why this wouldnt work, but just keep in mind that the maximum current on a LPT port is 10 to 20 ma. I dont know how much load that the trigger circuit is putting on the pin 2 LPT, but keep in mind that when pin 4 is high, the current on pin 2 will amount to current across the pin 2 resistor. (If pin 2 is high).

Here is an extremely rough drawing of an alternate way to do this, using a PNP as a NOT and an NPN as the switch, if your trigger circuit requires too much current.

 
« Last Edit: May 26, 2013, 11:14:13 am by DaOld Man »

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #4 on: May 27, 2013, 07:52:42 pm »
 Thanks for your time, what do you think about this, the red is the existing aimtrak trigger circuit minus the trigger switch circuit and the black is what i'm hoping will trigger and disable from the LPT or will i still need the transistor from your previous diagram and if so, what would i use for the V+.
Cheers,
Charlie

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Help using parallel port and mamehooker for gun recoils
« Reply #5 on: May 27, 2013, 09:39:38 pm »
That looks like it will work. I trust you have done your research on the mosfet, is it capable of handling the solenoid current? Is the mosfet gate current less than 20 MA?
(I dont know, and Im too lazy to look up the specs LOL)



charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #6 on: May 28, 2013, 05:03:23 am »
The mosfet definitely works to drive the solenoid, that is what it is doing now using the pulse from the aimtrak lightgun recoil output but I don't know what current it provides, I suppose I could just give it a go and if it doesn't work then add in the extra transistor shown in your diagram but then would I take power from the +5v on the PC psu and would it be OK with the separate 24v psu's. I tried to find out what the gate current is but man it's confusing for a total noob ???

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Help using parallel port and mamehooker for gun recoils
« Reply #7 on: May 28, 2013, 06:35:25 am »
I looked up the specs, and yes I do believe you are right about this transistor being capable of handling the solenoid current.
I am still little cloudy on the gate current draw, but the pin 2 resistor should limit the current flow enough to protect the LPT pin, so I say go with your plan. Try it, if it doesnt work try your plan B.
This looks like an interesting project, looking forward to seeing your results, and please, we crave pictures!

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Help using parallel port and mamehooker for gun recoils
« Reply #8 on: May 28, 2013, 06:45:26 am »
Hold on a sec. I just re-looked at the diagram I posted and I do believe the PNP transistor needs to be an NPN, because when the pin 4 is high, you need to kill the circuit.
With the PNP, a low on pin 4 will shut off the mosfet, due to switching the ground to the gate. (Killing your pin 2 control).
An NPN will do this only when the pin 4 is high, which I think is what you need.
Sorry about that.
So I think you need to go back to your first diagram and combine it with your second one. 
(NPN switching ground to mosfet gate).

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #9 on: May 28, 2013, 08:29:26 am »
Thanks for the help, I'm only on the planning/investigation stage and it will probably be a few weeks before I get the time to start ripping my cab and guns apart  :o but when i do you can be sure of some pics of this mod and also my homemade plastic bender which I will be making so I can make my own gun holsters, if it works that is!!

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #10 on: June 05, 2013, 03:47:46 pm »
Hi, Me agian. I have been thinking about an isolated circuit and I came across this on my travels.

                                                V+  (12V)
                                                 |
                                    +------------+-----+------+
                                    |                  |      |
Parallel                            |                  |      |
Port                                |          D1     ---     |
                                    |         1N4001  / \    Relay coil
          R1     1 ----------- 5    |                /---\    |
 D(x) ----1k------| Opto-     |-----+                  |      |
                  | Isolator  |                  +-----+------+
 GND -------------|           |-+                |            |
                 2 ----------- 4|                |            |
                   CNY 17 or    |   R2        | /             |
                   4N25         |   4.7K    B |/  C T1        |
                                +--\/\/\/\/---|     BC547A    |
                                |             |\  E           |
                                |             | V          | /
                                /               |        B |/C  T2
                                \  R3           +----------|    power
                                / 10 kohm                  |\E  transistor
                                \                          | v
                                |                            |
                                +----------------------------+
                                                             |
                                                external circuit ground

So I have more questions! Would I be able to power this directly using my 24v 5A PSU without changing anything else, I would be using the same Mosfet as before and I have come across some cheap Opto Isolators, I would be grateful if you could check over the following circuit and let me know what you think, would I need a lower voltage supplying the gate of the Mosfet? (I did read about using a 7805 voltage regulator but the generate a lot of heat)
Cheers.

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Help using parallel port and mamehooker for gun recoils
« Reply #11 on: June 05, 2013, 05:09:42 pm »
Thats looks like it would work, but the opto isolator circuit can be made a lot simplier.
Check out this drawing.
With Pin4 high, the leds on the optos will not light, causing the opto ouput to be off regardless of pin 2 or pin3 being high or low.
But if Pin 4 is low, it supplies a ground to each opto, so that they can be turned on or off by pin2 2 or 3 respectively.
(Im at work and spell check dont work here, so please disregard any misp[laced key punches.)

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #12 on: June 06, 2013, 09:33:06 am »
That definitely looks a more elegant solution thanks, I was looking over the specs of the mosfet which I chose based on the Aimtrak recoil module, but if I'm reading it right then it wont be able to cope with the 24v input on the gate so i started searching for one more suitable (with my limited knowledge!).
 I found this one on RS online FQPF10N20C, I've attached the datasheet so if you could take a quick look and let me know If i am right in thinking this would work or at least handle the 24v supply I would be very grateful, This sure is a very steep learning curve.
Also I don't know why but It feels like were having  private conversation in public view!

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Help using parallel port and mamehooker for gun recoils
« Reply #13 on: June 06, 2013, 11:35:51 am »
That RS mosfet looks to me like it will work.
I would breadboard your circuit first, just to make sure everything works like you want. I hate to solder stuff up then find out a different sized resistor (etc) was needed or would make it work better.
Posting your questions for everyone to read is a lot better, IMO, than messaging, because someone else could benefit from it and there are others on here that can double check my suggestions.

After reading that spec sheet, it looks like that mosfet would be a good transistor to use for our home made H Bridge motor drivers too. So see, your questions and ideas are already starting to benefit others.

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #14 on: June 07, 2013, 10:29:22 am »
Glad to be of help ;D
Anyway, after some more studying ??? and a £4.95 delivery charge from RS Components I decided to check out CPC Farnell, Some components weren't available there and the opto isolator I previously picked wasn't suitable (I think) so this is what I have gone for and placed the order so fingers crossed my next post will contain some real pictures and not just drawings!
Here is my final schematic with the actual components I ordered.

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Help using parallel port and mamehooker for gun recoils
« Reply #15 on: June 14, 2013, 11:27:30 am »
So I have built the circuit and it works! :applaud: sort of  ???, I first tested the inputs using a couple of 1.5v AA batteries and they triggered fine so the next step was to try it on an old donor PC. I plugged it in and switched it on and the solenoids engaged. Oops, back to the drawing board I thought.
 I decided to check the voltages on all the pins during boot and i found that Pins 2,3,6 and 8 were high during boot while Pins 1,4,5 and 7 were low and seeing as Pin 4 is the disable pin it needs to be high during boot time. All pins are high once windows loads.
I switched Pin 2 to the disable line and pins 3 and 4 as P1 and P2 recoils and it boots fine with just one short activation just as windows loads, I can live with that. I also notice that if I open 'My Computer' it also briefly activates the solenoids???.
I loaded up Mamehooker and tested the script lpe 1 3 1,lpe 1 2 0,wat50,lpe 1 3 0,lpe 1 2 1 and it works fine, I tried to run Terminator 2 in MAME but the donor PC is just not up to the job so I think I'm going to have to start ripping my cab apart to fully test it, Obviously I will have to check which pins are high on my MAME cab to find out which ones I should use.
Anyway, it seems to work and although it isn't going to be a one shoe fits all it is still possible for anybody to use this circuit as long as they have one pin that stays high during the boot process and once windows loads.
Thanks for the help, Once I get it running in MAME I will try and get a video of the solenoids in action. My soldering isn't the best but it does the job.
« Last Edit: June 14, 2013, 11:31:31 am by charlieram »

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #16 on: July 22, 2013, 09:01:08 am »
Back for more help, So I have finally ripped my cab apart and found which pins to use, for this one, pin 8 is disable and pins 5 and 6 are p1 and p2 trigger. I installed mamehooker and a new mame for testing purposes and the solenoids are activated fine but I tried it in terminator 2 and if you hold your finger on the trigger for the automatic gun all you can feel is the solenoid fire initially and then it has a really feint release before it is triggered again resulting in a really feint pulse, obviously this is no good for the solenoid as it is almost constantly on.
Would the switch off time be quicker if I increased the 10k resistor and if so would I go for the highest I could get? also would it be safe/advisable to reduce the 4.7k on the gate to increase switch on time although I am not sure that is the issue? Thanks in advance again :angel:

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #17 on: July 26, 2013, 10:16:45 am »
Anyone? ???

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #18 on: July 26, 2013, 01:12:17 pm »
Sorry for the delay.
Looks like you are doing some good electrical work there.
Im not sure what is triggering the printer port output to do what you are suggesting, but I doubt that changing the resistors you mentioned will help, but for grins and giggles, you can try changing the 10 K to maybe a 5K and the base resistor to a 1 K?
Also, looks like your 1 k resistors on the inputs of the opto-isolators might be a little large, although I dont think it would cause what you are seeing. a 500 ohm might produce better results (think of the opto-isolator input as being an led).
It appears to me that the software firing the solenoid (through the printer port outputs) might be firing too fast. A solenoid is a mechanical device and it will take time to completely engage and disengage.
So before I changed anything electrical (since your circuit does appear to be working), I would see if you can go into the games software and adjust the pulse times on the machine gun. (Maybe an ini, cfg, or settings file?) Looks to me like the pulses need to be on longer and off longer.
Im not sure if you can do that, I know nothing about that game or how it works.
If you cant do this, then you may have to use a timer circuit to get the machine gun fire. (I think this was discussed earlier?)
Good luck and let us know what you find. This is a very interesting project.

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #19 on: July 26, 2013, 01:19:48 pm »
Also I need to add that whichever pin you use to enable the circuit, make sure it is not being turned on or off in a weird way while the game is being played.
You can easily test this by disconnecting from the disable p-port output pin and connect to pin 18-25 (p-port ground). (Optoislotors led commons to ground.)
This will turn on the enable all the time so you can see how the gun acts when it should be firing like a machine gun.
CAUTION! DISCONNECT FROM YOUR DISABLE PIN FIRST! CONNECTING ANY P-PORT OUTPUT PIN DIRECTLY TO P-PORT GROUND WILL DAMAGE THE P-PORT OR COMPUTER IF THE DISABLE PIN GOES HIGH!
In other words, it will short the printer port output and quite possible fry your computer.

EDIT:
Also, the 1 k resistor on the optoisolator leds could be making the leds "flash" because of low current. You might want to try 500 ohm resistors. (You can solder another 1 k resistor across the current 1k and it will give you 500 ohms.)
« Last Edit: July 26, 2013, 01:22:47 pm by DaOld Man »

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #20 on: July 26, 2013, 03:37:03 pm »
Thanks again, Mamehooker is some software written by Howard Casto, a forum regular. It basically takes any outputs broadcast byMame and then sends them to real world devices such as the parallel port, this is why i am using it to control the recoils like a true arcade machine so that when the bullets are gone the recoil no longer fires
I will try the resistor on the opto isolator first as that may well be the cause because if i do a test, anything less than 20milli seconds is very unreliable. sorry for any spelling mistakes, I'm at work typing this on my phone and i cant  read it cos my eyes are knackered!!

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #21 on: July 30, 2013, 04:12:40 am »
Im sure Howard can help you on this, if not we can probably come up with a circuit that can cut the pulses in half, and increase on/off times.
But you need to make sure the sofware isnt doing something funny to your disable output. It might save a lot of worry if this is the problem.

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:November 14, 2023, 12:54:43 pm
  • I want to build my own arcade controls!
AW: Using parallel port and mamehooker for gun recoils
« Reply #22 on: July 30, 2013, 06:08:53 am »
I'm pretty sure most (not all) gun games didn't support recoil natively in the meaning of "no recoil with no bullets". The recoils usually fired all the time. So there is no output from mame hooker. I do know that Howard wanted to have this feature for troubleshooter.

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #23 on: July 31, 2013, 06:09:52 am »
In the individual .INI's for the games in the Mame Hooker folder one of the options is when Mame starts and stops so when it starts I enable the Disable pin and once Mame closes is disables it again so while the games are running it should be in the same state but I will check it out thanks.

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #24 on: August 18, 2013, 12:03:41 am »
Bump.
Any progress?

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #25 on: August 18, 2013, 07:01:31 pm »
Hi, Still here and progressing well.... err slowly then  ;D

 School summer holidays + 3 lads + 1 wife + 1 dog + 2 cats = Busy!!

Seriously though, I have managed to sort the automatic recoil problem with terminator 2 and others with the same method, I posted this in the mamehooker thread last week.
Ok so I sorted the recoil issue in model 2 by editing my command in the [keystates] section of the default.ini which now reads
a=lpe 1 5 %s%, wat 18, lp 1 5 0
z=lpe 1 6 %s%, wat 18, lp 1 6 0
A and Z are the keys that are remapped by troubleshooter 2 for the triggers to work for model2, the downside to this is it also fires when shooting off screen. Hopefully this will change when Howard has had his MK9 fix and gets onto something more productive  ;)
The upside to the above INI change means that I now have the automatic recoil working correctly in Terminator 2 and operation wolf but I think the output must be screwed up in operation wolf 3 because they are totally random.
Well I will keep plugging away until someone with more knowledge can point me in the right direction, and if anyone can think of a way to register the off screen shots please let me know, Mame hooker still register A and Z whether on or off screen
but Howard seems to be busy with his new pet project and doesn't have time or inclination to respond to a mere mortals requests/demands unfortunately  :hissy:
I am setting up Hyperspin (again!!) at the minute to try and integrate all the new gun games into my cab and Ive built my plastic/perspex bender to make the gun holsters, just aint got no plastic to bend!
I've got a few days off next week so hopefully I will progress a bit more and i will try and get a video of the gun in action with recoil (which is good btw) but I want to build a new circuit, the same but better. I rushed the last one and didn't clean the copper tracks and also I needed to make it bigger for mounting holes :banghead:

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #26 on: August 20, 2013, 05:48:02 pm »
I might be biting off more than i chew with this project. Today I was playing/setting up T2 and Operation Wolf 3 and after about 10 minutes the solenoid was hot enough for me to feel it through the gun shell, Is this normal? anyone with recoils want to rapidly fire there guns for 10 minutes and left me know if there recoils get hot?

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #27 on: August 23, 2013, 05:27:01 pm »
It is not normal for a solenoid to get real hot, however they will get warm.
Some solenoids are designed to be intermittent, which means if they are turned on for an extended amount of time, they will get hot and possibly burn out.
All solenoids will get hot if the armature (the metal part that sucks into the coil), is blocked from travelling completely in.
The resistance of a solenoid is very low when the armature is not present.
As the armature goes into the coil, the resistance goes up. (Due to inductance.)
So if the armature travel is obstructed, coil resistance is low, thus more current draw, thus more heat created.
This could be a problem, not really sure.
You also have to remember that electricity travels faster than a mechanical device, so if the armature is only travelling half way (or less) before coil turns off, the coil may still be seeing it as the armature not fully in, if this makes sense.
If this is the case, try tweaking your on and off times, longer on and longer off. 

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #28 on: August 27, 2013, 07:32:41 am »
Just wondering if the following changes would do what I'm thinking. I want the gate input voltage to be 10v, the changes to the circuit are in red, basically I moved R1 before R2 rather than having them in parallel and switching to a 3K and 4.7K resistor? I am also going to change the diodes for higher rated 1N4004's across the solenoids as recommended in another thread and reducing the 1K resistors on the opto inputs as you suggested, I really ought to get a breadboard so I could prototype this stuff! If you have time could you look at the spec sheet for the 4N35 and suggest what value resistor I should use before I order some.
Thanks
Forgot to mention, I did add another resistor to make 500ohm on the opto isolator side and changed the 10k for 5k and 4.7k for 1k but it didnt change anything, It still works the same as before?
« Last Edit: August 27, 2013, 10:34:49 am by charlieram »

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #29 on: August 27, 2013, 10:44:00 am »
Maybe a video will explain things a bit better
This is the recoil action controlled by Mame Hooker using the outputs broadcast by mame when playing Terminator 2, using this method means that when the energy runs low, the solenoid pulses slow down too and for other games with the outputs hooked up it will also stop firing if you run out of ammo and need to reload.
Don't mind the 2 gun sights, I havn't properly calibrated yet and wont do until its all back in my cabinet. The 'clacking' you can hear is the solenoid firing, After playing this game for about 10-15 minutes the gun feels warm where the solenoid is located. I took the gun case apart to check the temperature of the solenoid and while I can hold it it is uncomfortably hot. Would you say it is down to the rate of fire or something in my circuit?

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #30 on: August 27, 2013, 06:45:36 pm »
Wow that recoil is really neat. I now completly understand why you are going for this.
As for the LED resistor for the opto, according to the specsheet, forward current for the led is 60 ma, this seems awfully high to me, and since the printer port is only good for 10-20 ma, I would limit it to that, as long as it works. So according to my calculations, around 220 ohm resistor will limit current to 16 ma. Your 500 ohm you are currently using sets it at around 7 ma, which is safe for the port.
Since it is working with the 500 ohm resistor, I would leave it at that.
Now for the heat, I can see why the solenoids are heating up, they are getting quite the workout.
Can you bore some holes in the gun case to allow air circulation around the coils? Or is it possible to add some heat sinks to them?
Maybe some light weight aluminum to spread some of the heat away from the coil frames?

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #31 on: August 27, 2013, 07:19:39 pm »

Now for the heat, I can see why the solenoids are heating up, they are getting quite the workout.
Can you bore some holes in the gun case to allow air circulation around the coils? Or is it possible to add some heat sinks to them?
Maybe some light weight aluminum to spread some of the heat away from the coil frames?
Now this is what I want to hear  :notworthy: I don't think the game will ever be played any longer than 10 minutes but I wanted to try the most intense rapid fire game I could find and got quite worried at how warm it became.
Thank You for all the help :cheers:

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #32 on: September 02, 2013, 10:11:00 am »
Just wondering if you took a look at my revised circuit using the resistors as a voltage divider? I haven't built it up that way yet but I'm still wondering if it will do what I am hoping, mainly to provide a voltage of 10v at the gate rather than the full 24v. I'm thinking that because the coil seems to activate instantly that gate supply is more than adequate but the gates actually charge a capacitor don't they? and I'm thinking if I limit the voltage then there will be less voltage to drain from the capacitor at the gate? I really don't know enough about electronics to say whether this is correct or not so I have no idea whether this will work or just go up in smoke!!

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #33 on: September 02, 2013, 11:46:05 am »
What capacitor are you talking about? I don't see any in your drawings.

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #34 on: September 02, 2013, 01:56:34 pm »
sorry, I mean the mosfet gate capacitance. It seems to get mentioned a lot when I read the datasheets for mosfets and so I assumed they have a built in capacitor that charges initially, this is what I was referring to. :dunno

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #35 on: September 02, 2013, 11:56:02 pm »
Im not sure about the capacitance on the mosfets, I mean, all circuits have capacitance, even wires ran side by side will have capacitance, but it's usually not enough to even consider. (Unless you are building high frequency radio circuits.)
I will have to read up on the data sheets for that mosfet, but just a hint, most data sheets will give you a lot more info than you actually need. It can get pretty confusing if you let it.
If your circuit is working (and it appears to be), and you are not seeing any weird things going on, then I would say you are ok on your circuit design.
Is there something specific that is troubling you?

charlieram

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:March 20, 2024, 05:47:01 pm
    • TTA Games
Re: Using parallel port and mamehooker for gun recoils
« Reply #36 on: September 03, 2013, 12:03:44 pm »
Is there something specific that is troubling you?
I was just wondering if the changes would reduce the time that power was applied to the solenoid to reduce the heat up, I was looking at the specs for the mosfet which stated a Vgs of 10v (max of 30) and so I was trying to get just 10v to the gate and not 24v.
 I'm not overly concerned just striving for perfection. ;D

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Using parallel port and mamehooker for gun recoils
« Reply #37 on: September 03, 2013, 12:31:50 pm »
Well, try to adjust the resistors to give you 10 volts, cant hurt and may actually do what you want.