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

Poll

-- deleted poll --

-- deleted poll --
0 (0%)
-- deleted poll --
0 (0%)

Total Members Voted: 0

  

Author Topic: GUN4IR - The Ultimate 4 Points Lightgun System  (Read 391114 times)

0 Members and 1 Guest are viewing this topic.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #200 on: February 02, 2020, 02:54:44 pm »
Regarding this led shallow angle issue.... why don't you guys just sand the LEDS?  That'll diffuse the light and they'll be viewable at any angle.
We already discussed about that, but diffusing the light will also make it weaker and harder for the cam to see. The more the light spread, the dimmer it becomes, even with high powered higher angle LEDs ;)
There might be some special model somewhere with higher angle and powerful enough for it, but I haven't found any so far.

So the only solution that works well and doesn't require special hardware is using 2 or more LEDs for each points, with slightly different angles.
And no need to add any filter or lens to it, since the IR cam will only see one point if the LEDs are close enough  :D

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: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #201 on: February 02, 2020, 03:08:33 pm »
Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great.  I'd suggest you try it before deciding it's impossible. 

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #202 on: February 03, 2020, 02:37:46 am »
Did you do the same for the top and bottom leds too?  ;D
Only on top :D
I see, it's indeed not normal, it might have something to do with the way Mame is configured.
What do you have in "device mapping" in the Mame config menu? are you using any app for mame that might interfere with the inputs?
I use a groovymame 64bit version and device mapping for lightguns set to lightgun if set mouse not work, can you post your mame.ini configuration

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #203 on: February 03, 2020, 02:56:19 am »
Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great.  I'd suggest you try it before deciding it's impossible.
I never said it's impossible, I said it reduces the leds brightness therefore might reduce the maximal distance of use  ;)
I'm not making it up, it's basic optical stuff.
https://www.instructables.com/id/how-to-defuse-an-LED/
You can see at the beginning "Diffusing makes the LED appear dimmer, but gives a wider viewing angle of the light."

You're right still, I never tested it, I only tested very wide angle powerful LEDs and the result was awful.
I just didn't see how sanding a LED with the around the same specs (beside the angle) would get better result.
But I'm willing to try it out, to see how it compares.
I would be happy to be wrong on this one, it would solve the main IR LEDs issue nicely  :lol

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #204 on: February 03, 2020, 10:22:28 am »
Only on top :D
You means the bottom leds are not facing the gun either? ;D
I use a groovymame 64bit version and device mapping for lightguns set to lightgun if set mouse not work, can you post your mame.ini configuration
Ok so let me test my groovymame machine once I finished setting it up again, I will send you the file.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #205 on: February 03, 2020, 10:32:17 am »
Any thoughts about these leds:
https://www.arrow.com/en/products/l1i0-0940060000000/lumileds
?
It's a surface mount, so might be annoying to install, but look at the specs.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #206 on: February 03, 2020, 10:39:30 am »
You means the bottom leds are not facing the gun either? ;D

I mean that the lower LEDs are already straight and turned towards the gun because the screen is slightly inclined starting from the bottom and coming upwards therefore obviously the LEDs placed on the sides in the middle of the screen are slightly inclined and the upper ones even more stupid I who had not thought of that ... :)

Ok so let me test my groovymame machine once I finished setting it up again, I will send you the file.

thanks, but setting mouse as device for the lightgun should be seen as axes and mouse buttons right?
I don't understand why he doesn't read it like this
« Last Edit: February 03, 2020, 12:19:25 pm by kill_one »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #207 on: February 03, 2020, 12:11:44 pm »
Any thoughts about these leds:
https://www.arrow.com/en/products/l1i0-0940060000000/lumileds
?
It's a surface mount, so might be annoying to install, but look at the specs.
Wait, 1190mW/sr?? That's insane  :lol
But it makes sense, it's also 3.4v and 1A, very high power consumption, I wouldn't even know how to power those monsters  :o
I even wonder if it won't be too powerful for the IR cam.
But if someone here could help us on how to make them work, I would sure want to try it out, powerful SMD LEDs would be really nice.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #208 on: February 03, 2020, 12:22:50 pm »
maybe connect ten of those in series and use a 34V 1Amp ac adapter?
I'd also like to know if there's any danger associated with these leds.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #209 on: February 04, 2020, 07:57:03 am »
maybe connect ten of those in series and use a 34V 1Amp ac adapter?
I'd also like to know if there's any danger associated with these leds.
Why would you want to use 10 of them?  :lol
My concerns are more about the led being too strong for the IR Cam sensor. I wonder if it wouldn't blind it or making the points too big on cam to track accurately?
Still, making small pcbs for this kind of LEDs would be a lot cleaner and easier to set up.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #210 on: February 04, 2020, 10:03:49 am »
Well, I've just finished building everything, i used the same leds you use, jaybee, SID1K10CM, 8 of them, connected everything, turned out the DFRobot camera needed to be rotated.
In my case i had to manually calibrate the gun since the screen i'm trying this on is 16:10, i haven't connected it to the big screen yet since it was easier to try it on the 24 inch.
It seems to work but i'm not sure it works optimally, since i find myself having to sit as far as my old Topgun 2 lcd gun and still get some inconsistencies. If i try to get closer it does work but with more inconsistencies.
Is it supposed to be like this? I mean, did you also get accuracy issues from time to time? I've tried messing with the leds, changing their angles and so on, though can't say there's any improvement.
Will appreciate any suggestions.
Edit: two things that i've done that seem to help, i changed the usb cable from 5m to 1.8m and changed the resolution to 1920x1080 and set the screen to stretch so as not to have black bars since the native res is 1920x1200, and this time i didn't use manual calibration, since it's set to 16:9 res.
Not sure which of these two have helped the most but the gun seems to be more consistent now.
« Last Edit: February 04, 2020, 10:59:50 am by Foxhole »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #211 on: February 04, 2020, 08:08:52 pm »
Well, I've just finished building everything, i used the same leds you use, jaybee, SID1K10CM, 8 of them, connected everything, turned out the DFRobot camera needed to be rotated.
In my case i had to manually calibrate the gun since the screen i'm trying this on is 16:10, i haven't connected it to the big screen yet since it was easier to try it on the 24 inch.
It seems to work but i'm not sure it works optimally, since i find myself having to sit as far as my old Topgun 2 lcd gun and still get some inconsistencies. If i try to get closer it does work but with more inconsistencies.
Is it supposed to be like this? I mean, did you also get accuracy issues from time to time? I've tried messing with the leds, changing their angles and so on, though can't say there's any improvement.
Will appreciate any suggestions.
Edit: two things that i've done that seem to help, i changed the usb cable from 5m to 1.8m and changed the resolution to 1920x1080 and set the screen to stretch so as not to have black bars since the native res is 1920x1200, and this time i didn't use manual calibration, since it's set to 16:9 res.
Not sure which of these two have helped the most but the gun seems to be more consistent now.
I'm glad you manage to build it!  :cheers:
So are you living in Japan too?  :lol
Yes the sensor is often tilted (it's a factory issue), as I wrote down in the first post  :dizzy:
So for any aspects ratio other than 16:9 or 4:3, the resolution shouldn't matter as long as you keep your content in full screen.
I'm currently doing a tool to change the default options of the gun, like the aspect ratio of the screen and many others.
Just in case, you might also want to check how the camera is seeing the led by using the testing tool by Samco in this forum or or the one dfrobot provided. If you see the points blinking or changing color often, it means there is something wrong with them (USB port not powerful enough, connection problem...).

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #212 on: February 05, 2020, 01:37:31 am »
I mean that the lower LEDs are already straight and turned towards the gun because the screen is slightly inclined starting from the bottom and coming upwards therefore obviously the LEDs placed on the sides in the middle of the screen are slightly inclined and the upper ones even more stupid I who had not thought of that ... :)
Oh I see, makes sense :P
Well I hope you got it fixed now  :lol
thanks, but setting mouse as device for the lightgun should be seen as axes and mouse buttons right?
I don't understand why he doesn't read it like this
I don't understand either, Mame is a bit obscure for me too sometime.
Which input mode are you using inside mame?
Because I saw you were testing buttons in the windows controller panel in joystick mode.
You have to be careful, there are 3 input modes with my firmware; mouse+kb, joystick, and mouse+joystick

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #213 on: February 05, 2020, 01:53:19 am »
Mame treats this gun as a lightgun, and that's how it's supposed to be, as far as I'm aware this has always been the case.
This was the same case when i connected my guncon and other mouse based lightguns.
By the way, you should disable offscreen_reload for games that don't need it, so you can use the reload button for other things.
I think you can get around the offscreen_reload option by directly sending a 0,0 left button instead of sending a right button click as offscreen shot. Though I'm not sure if that will work with all games.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #214 on: February 05, 2020, 04:14:08 am »
Yes the sensor is often tilted (it's a factory issue), as I wrote down in the first post  :dizzy:
Yeah, i've read the first post many times, just thought to point that out to share my experience with building it.
So for any aspects ratio other than 16:9 or 4:3, the resolution shouldn't matter as long as you keep your content in full screen.
That explains it, why i was having issues with 1920x1200.
Just in case, you might also want to check how the camera is seeing the led by using the testing tool by Samco in this forum or or the one dfrobot provided. If you see the points blinking or changing color often, it means there is something wrong with them (USB port not powerful enough, connection problem...).
For someone who has no experience whatsoever with arduino, how would i go around doing that?
I've tried uploading the samco test sketch but it fails every time in the verification phase, complaining that "DFRobotIRPosition.h: No such file or directory".
Tried adding that file to the same folder as the sketch, didn't do anything. In his video he didn't add anything or changed anything, so i'm not sure what's up.
I tried uploading the official dfrobot sketch, which did get uploaded to the arduino from what i could see, but the processing sketch doesn't show anything but a blank screen.
I'm sure it's just my inexperience with arduino. any tips?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #215 on: February 05, 2020, 08:11:14 pm »
Mame treats this gun as a lightgun, and that's how it's supposed to be, as far as I'm aware this has always been the case.
This was the same case when i connected my guncon and other mouse based lightguns.
By the way, you should disable offscreen_reload for games that don't need it, so you can use the reload button for other things.
I think you can get around the offscreen_reload option by directly sending a 0,0 left button instead of sending a right button click as offscreen shot. Though I'm not sure if that will work with all games.
I wondered for a while what's the best practice for the off screen shot functionality, and I ended up leaving it always on for few reasons;
I couldn't find any game that requires you to shot outside or on the borders of the screen beside the off screen reload, so it shouldn't cause any issue with normal games, and will avoid unattended shot in the screen border when you shot outside (many games aren't triggering shot at all when shooting outside of the screen).
With the way I coded it, you can assign the normal reload button to any function you want, it shouldn't cause any conflict.
But the main reason is because most emulators and games don't have a proper off screen detection, shooting in 0,0 just shot in the corner, which is quite annoying for most games. They also rarely allow to map 2 buttons at once, or remapping buttons at all, so even if shooting outside of the screen was on another button we wouldn't be able to use it.

But don't worry, in my upcoming configuration tool for this firmware you will be able to configure it the way you want ;)

And if you have any improvement suggestions, feel free to share.

Yeah for the samco and dfrobot sketch you have to add the dfrobot libraries first (both cpp and h files) , and then change the com Port to whatever port is currently used by your Arduino (you can check it in the Arduino IDE). I know it's not very easy to use, I might also do a user friendly tool for that too in the future.

Got tons of things to add and work on  :lol

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #216 on: February 06, 2020, 03:42:16 am »
I don't understand either, Mame is a bit obscure for me too sometime.
Which input mode are you using inside mame?
Because I saw you were testing buttons in the windows controller panel in joystick mode.
You have to be careful, there are 3 input modes with my firmware; mouse+kb, joystick, and mouse+joystick

yes I think mouse + keyboard since when I press Start or Select I press the keys 1 and 5 but mame set Trigger and A button always to GUNX B0 and B button GUNX B2 Pedal button GUNX B0...
in the mame you use, does the trigger see it as MOUSE B1 or GUNX B1?

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #217 on: February 06, 2020, 05:11:06 am »
I made other gun and is the same in mame GUNXX B0...I deduce that it is not a problem of defective arduino, no one else has my same problem?

This time i used a wireless compatible guncon2 Logic3






I connected the calibration button to the OPEN button used to remove the battery container :D

@JayBee will the utility you are preparing also indicate the various active modes?

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #218 on: February 06, 2020, 06:09:14 am »
I made other gun and is the same in mame GUNXX B0...I deduce that it is not a problem of defective arduino, no one else has my same problem?


This time i used a wireless compatible guncon2 Logic3






I connected the calibration button to the OPEN button used to remove the battery container :D

@JayBee will the utility you are preparing also indicate the various active modes?
Try setting offscreen_reload to 0 in mame.ini and check.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #219 on: February 06, 2020, 09:19:22 am »
Try setting offscreen_reload to 0 in mame.ini and check.
Yes! It was that! So should never be used offscreen_reload?
Foxhole thanks a lot :)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #220 on: February 06, 2020, 09:42:44 am »

yes I think mouse + keyboard since when I press Start or Select I press the keys 1 and 5 but mame set Trigger and A button always to GUNX B0 and B button GUNX B2 Pedal button GUNX B0...
in the mame you use, does the trigger see it as MOUSE B1 or GUNX B1?
I just checked, mine shows GUN 5 B0 (5 is the mouse number detected by mame) when shooting on screen, and GUN 5 B1 for off screen, button A and pedal button (which is the expected behavior).
So I really have no idea why your guns are detecting B0 on button A and pedal, it should be B1  :dizzy:
Unless there are still some traces on the Guns PCB that connect the buttons together somehow? do you have a continuity tester or a multimeter to test them out?
where is the buttons common ground connected?

I made other gun and is the same in mame GUNXX B0...I deduce that it is not a problem of defective arduino, no one else has my same problem?
Definitely not a defective arduino, you would have other issues I think.

@JayBee will the utility you are preparing also indicate the various active modes?
With the current firmware, beside the calibration the gun should reset to the default configuration at each power cycle.
But yes, it will show the active modes 8)
The tool will be a all in one toolbox that also allow to update the firmware, configure each button, change the default settings, and add tons of functionalities to the system.
But since it will take some time for me to make it, I might do a basic testing tool before that, to easily check the inputs, sensors and feedback  :lol

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #221 on: February 06, 2020, 09:45:46 am »
Try setting offscreen_reload to 0 in mame.ini and check.
Yes! It was that! So should never be used offscreen_reload?
Foxhole thanks a lot :)
Oh so Foxhole's solution did work? nice, thanks! :D
Indeed in my ini file offscreen_reload was 0 by default too, I should add that to the FAQ ;)

Edit: @Foxhole I added the offscreen reload enable/disable option to the upcoming 1.4 version of the firmware, it will be easy to change it with a buttons combo.

Edit2:
Indeed it seems like this mame offscreen_reload options is a common issue:
http://forum.arcadecontrols.com/index.php?topic=75196.0
« Last Edit: February 06, 2020, 10:04:08 am by JayBee »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #222 on: February 06, 2020, 10:41:03 am »
Oh so Foxhole's solution did work? nice, thanks! :D
Indeed in my ini file offscreen_reload was 0 by default too, I should add that to the FAQ ;)

Edit: @Foxhole I added the offscreen reload enable/disable option to the upcoming 1.4 version of the firmware, it will be easy to change it with a buttons combo.


Yes, it works perfectly now

Trigger = GUNXX B0
A Button = GUNXX B1
B Button = GUNXX B2
C Button or Pedal = GUNXX B1

:D
« Last Edit: February 06, 2020, 10:46:09 am by kill_one »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #223 on: February 06, 2020, 10:49:58 am »
I look forward to completing with the rumble and solenoid, I hope you will publish soon :D

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #224 on: February 06, 2020, 12:29:36 pm »
Got tons of things to add and work on  :lol
could you implement the possibility of various key combinations? I'm trying to edit a biogun for dreamcast and I realized that it has only two buttons besides the trigger and the DPAD, Start and A button

example: DPAD down + Start = Select button, DPAD up + A = B button, etc etc

thanks :)

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #225 on: February 06, 2020, 02:34:47 pm »
Try setting offscreen_reload to 0 in mame.ini and check.
Yes! It was that! So should never be used offscreen_reload?
Foxhole thanks a lot :)
Use it only on games that require it, like lethal enforcers for example.
JayBee, i've included a video showing the issues i'm having.
https://drive.google.com/open?id=14N6tEnCCD_Psx24A7DaRW4N3R8QNZn80
kill_one, how's the gun working for you? Do you have issues from time to time? Can you also look at the video and tell me if you get these issues, too?
most of the issues start on the second half of the video.
« Last Edit: February 06, 2020, 02:42:26 pm by Foxhole »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #226 on: February 06, 2020, 03:32:07 pm »
kill_one, how's the gun working for you? Do you have issues from time to time? Can you also look at the video and tell me if you get these issues, too?
most of the issues start on the second half of the video.
Yes, but it rarely happens, in the troubleshooting there is written how to solve, I point out the screen at the bottom and shoot and then I raster the screen, I believe that with the next update the problem will be solved by fixing the inclination of the gun

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #227 on: February 06, 2020, 08:26:35 pm »
Got tons of things to add and work on  :lol
could you implement the possibility of various key combinations? I'm trying to edit a biogun for dreamcast and I realized that it has only two buttons besides the trigger and the DPAD, Start and A button

example: DPAD down + Start = Select button, DPAD up + A = B button, etc etc

thanks :)
Yeah that's actually a good idea of features.
So far the only combo you can do are with the calibration button, to change various modes.
Might be a little more complex to add programmable buttons, but I will sure look into it  ;)

Try setting offscreen_reload to 0 in mame.ini and check.
Yes! It was that! So should never be used offscreen_reload?
Foxhole thanks a lot :)
Use it only on games that require it, like lethal enforcers for example.
JayBee, i've included a video showing the issues i'm having.
https://drive.google.com/open?id=14N6tEnCCD_Psx24A7DaRW4N3R8QNZn80
kill_one, how's the gun working for you? Do you have issues from time to time? Can you also look at the video and tell me if you get these issues, too?
most of the issues start on the second half of the video.
Oh I see what's happening!
It's not a problem with the tilt but with a misdetection of the LEDs, I used to have that all the time when my gun had trouble seeing the LEDs. It still happens once in a while when the cam is glitching somehow.
But that's also something I'm trying to improve, I'm currently working a function that will reset the detection when something is misdetected, fixing it instantly.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #228 on: February 07, 2020, 10:53:42 pm »
Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great.  I'd suggest you try it before deciding it's impossible.
So I gave it a try, and sanded one of my leds.
It seems like the sanding barely improved the angle, but made the light too dim to work correctly at more than 1.5 meters.
So overall it made it worse sadly  :-\

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #229 on: February 08, 2020, 09:00:04 am »
Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great.  I'd suggest you try it before deciding it's impossible.
So I gave it a try, and sanded one of my leds.
It seems like the sanding barely improved the angle, but made the light too dim to work correctly at more than 1.5 meters.
So overall it made it worse sadly  :-\
Tried that too, sanded the all 4 of them, made things worse in my case. The improvement in the angle is barely noticeable, but the power of the ir has been reduced quite a lot, reducing the range.
JayBee, according to the specs of the dfrobot ir cam it can detect up to 3 meter, have you managed to go beyond that?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #230 on: February 08, 2020, 12:58:58 pm »
Well ages ago before there were third party sensor bars available for the wii I made one for use on the pc... had the exact same issue with the leds… then I sanded them and they worked great.  I'd suggest you try it before deciding it's impossible.
So I gave it a try, and sanded one of my leds.
It seems like the sanding barely improved the angle, but made the light too dim to work correctly at more than 1.5 meters.
So overall it made it worse sadly  :-\
Tried that too, sanded the all 4 of them, made things worse in my case. The improvement in the angle is barely noticeable, but the power of the ir has been reduced quite a lot, reducing the range.
JayBee, according to the specs of the dfrobot ir cam it can detect up to 3 meter, have you managed to go beyond that?
My room is only 3 meter large, so I can't really go beyond :lol

Right now I'm doing lot of testing (and coding) to optimize everything, and the more I think about it the more I want to find a better LEDs solution.
I realized something that might help, and I think the guys behind the Amtrak gun also realized it:
The IR points need to be big enough to be recognized well, even if the LEDs are powerful.
So adding more LEDs on each points or putting a bit more space between them should be a good idea I guess.
I will do more experiments tomorrow.

And for the next firmware, since I changed many things I will release it in beta, for everyone to test out.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #231 on: February 09, 2020, 07:31:22 am »
New firmware update as promised! ;D

changelog:
* 2020/02/09 - 1.55 beta
- Rewrote a big part of the aiming calculation, it should be far more stable.
- Added a better tilt/twist detection, now the gun should still work fine when tilting it, it increases the maximum tilt to 89 degrees on each side.
- Added a function to disable the press of secondary button when shooting offscreen.
  + You can disable it by holding trigger button and pressing the calibration button briefly.
  + Enable it back the same way.
  + For now this parameter isn't saved in the EEPROM, it will reset on power cycle.

@foxhole & @kill_one
Since there are a lot of changes in my code, I leave it as beta version for now, until I'm sure it works.
If you can test it and give me your feedback that'd be great  :cheers:

Next update should be the diagrams for the rumble and solenoid.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #232 on: February 09, 2020, 10:03:41 am »
New firmware update as promised! ;D

@foxhole & @kill_one
Since there are a lot of changes in my code, I leave it as beta version for now, until I'm sure it works.
If you can test it and give me your feedback that'd be great  :cheers:

Next update should be the diagrams for the rumble and solenoid.

Great @JayBee!!! 
tonight if I can try it ... a question but once updated should the calibration be redone or the data is not deleted?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #233 on: February 09, 2020, 10:08:26 am »
New firmware update as promised! ;D

@foxhole & @kill_one
Since there are a lot of changes in my code, I leave it as beta version for now, until I'm sure it works.
If you can test it and give me your feedback that'd be great  :cheers:

Next update should be the diagrams for the rumble and solenoid.

Great @JayBee!!! 
tonight if I can try it ... a question but once updated should the calibration be redone or the data is not deleted?
The calibration data should still be there after update  ;)

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #234 on: February 09, 2020, 10:19:22 am »
New firmware update as promised! ;D

@foxhole & @kill_one
Since there are a lot of changes in my code, I leave it as beta version for now, until I'm sure it works.
If you can test it and give me your feedback that'd be great  :cheers:

Next update should be the diagrams for the rumble and solenoid.

Great @JayBee!!! 
tonight if I can try it ... a question but once updated should the calibration be redone or the data is not deleted?
The calibration data should still be there after update  ;)

Perfect!!! :D

@JayBee Could you begin to interrupt us only the list of components to be taken to make the 2 circuits of the rumble and solenoid? So we already order them to be ready when you publish the schematics? :)
From one of the photos you put in the other thread I seem to understand that for the solenoid it takes: 1 Mosfet IRL540 - 1 kickback diode (1N4001 or equivalent can it be fine?) - 2 resistances (from what value?) And for the rumble which transistor to take?

Thanks a lot! :D

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #235 on: February 09, 2020, 11:42:36 am »
Perfect!!! :D

@JayBee Could you begin to interrupt us only the list of components to be taken to make the 2 circuits of the rumble and solenoid? So we already order them to be ready when you publish the schematics? :)
From one of the photos you put in the other thread I seem to understand that for the solenoid it takes: 1 Mosfet IRL540 - 1 kickback diode (1N4001 or equivalent can it be fine?) - 2 resistances (from what value?) And for the rumble which transistor to take?

Thanks a lot! :D
Yes, your guess was very good  ;D

For the solenoid:
- IRL540 Mosfet
- 1N4001 diode
- 10k resistor
- 1k resistor

For the rumble:
- np2222 transistor
- 1N4001 diode
- 270ohms resistor

For the schematics, I attached some I just found online that are very similar.
They are fairly basic and should be easy to follow  :cheers:

However I'm still not sure on how good an reliable those circuits are, electronic isn't my specialty so you're free to suggest any improvement  ;)
« Last Edit: February 09, 2020, 11:46:15 am by JayBee »

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #236 on: February 09, 2020, 08:33:58 pm »
However I'm still not sure on how good an reliable those circuits are, electronic isn't my specialty so you're free to suggest any improvement  ;)
I'm not even a great expert in this field ...: D As far as rumble motor and solenoid are concerned, what specifications must they have besides being 5v?

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #237 on: February 09, 2020, 09:22:33 pm »
I encountered two problems in this version ... the first one when I start flash.bat the firmware flash doesn't start, I had to rename the file and use the old one flash.bat. The second problem concerns the aiming, 'tilt now works but often when I aim at a point the cursor moves by itself making it impossible to hit the target, and sometimes the cursor is seen repeated on different points of the screen, ultimately it seems less precise than the version previous one. I hope I have been clear and helpful.

Here the video where at the end you see the duplicate cursor
https://photos.app.goo.gl/vjxYt4Wt9gqoVFi18

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Today at 12:49:21 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #238 on: February 09, 2020, 11:00:16 pm »
I'm not even a great expert in this field ...: D As far as rumble motor and solenoid are concerned, what specifications must they have besides being 5v?
The rumble can be anything up to 40v with an external power supply as long as it's not using too much power (just check the npn2222 specs)
If you want to use a 5V rumble motor connected to the arduino vcc, the motor has to have a very low power consumption, or else it won't work on the arduino power pin and might even fry it. That's why I use xbox 360 rumbles. But any USB powered rumble motor should work fine I guess?
For the solenoid, it has to be powered by a separate power supply, it can't be connected to the arduino.
The power will depend on your what your solenoid is rated for.
I use a 24v power supply since my solenoid are all 24v, but again, the IRL540 has quite a large working range (100V max).
Just don't forget to separate the power lines, and attach all grounds together.

I encountered two problems in this version ... the first one when I start flash.bat the firmware flash doesn't start, I had to rename the file and use the old one flash.bat. The second problem concerns the aiming, 'tilt now works but often when I aim at a point the cursor moves by itself making it impossible to hit the target, and sometimes the cursor is seen repeated on different points of the screen, ultimately it seems less precise than the version previous one. I hope I have been clear and helpful.

Here the video where at the end you see the duplicate cursor
https://photos.app.goo.gl/vjxYt4Wt9gqoVFi18
that's weird, the flashing worked perfectly for me with the new flash.bat. I didn't change anything to it beside the name of the file  :dizzy:

The cursor duplication/jumping around (thanks for the video by the way) is clearly an issue with the cam seeing your leds "blicking" meaning it has trouble picking them up steadily :-\
On the old firmware that's the thing that would mess up the tracking and make your cursor move the wrong way.
On this one, it recalibrates and fixes the problem in real time, preventing the cursor to move in wrong directions, but making it blink sometime when doing so.
I just modified dfrobot led visualization tool to display/checks the leds and buttons, I will do a special firmware soon to go with it and share it with you ;)

For the aim moving on its own, you mean it's shaking?
For this new firmware because I'm reaching the limit of the arduino's memory, I tried to use integers instead of floats for the coordinates calculation, so it lost a little bit of precision. It didn't have much impact on my setup, but that probably depends on the size of the screen, distance and all. I might be able to do something about that if needed.

Could you please test this firmware and the previous one from the exact same distance/angle and hold the gun still to see how much it differs?  :laugh:
Thanks for your help :cheers:

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #239 on: February 10, 2020, 06:48:49 am »
The rumble can be anything up to 40v with an external power supply as long as it's not using too much power (just check the npn2222 specs)
If you want to use a 5V rumble motor connected to the arduino vcc, the motor has to have a very low power consumption, or else it won't work on the arduino power pin and might even fry it. That's why I use xbox 360 rumbles. But any USB powered rumble motor should work fine I guess?
The Biogun Xbox port is 5v
The Biogun DC port is 5v
 
since these two guns already have a rumble motor to use them, connect them directly to the circuit made and feed them to 5v externally? Even if the console ports are 5v, I doubt that the rumble goes to 5v is there a way to check the voltage without blowing them up? In that of DC there are soldered components, perhaps they serve to reduce the voltage? If so, should I leave them and feed at 5v?



The one for xbox that looks the same as the DC one instead had only two wires one connected to the onoff switch and the other went on the main board of the gun

I don't know how to proceed now: D