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 388756 times)

0 Members and 1 Guest are viewing this topic.

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 #240 on: February 10, 2020, 06:56:22 am »
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 took these



do you think they are fine? the space left is very little with these I should be able to insert them...

can I power 2 solenoids with a single 24v power supply?

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:

today I will do other tests and let you know :)

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 #241 on: February 10, 2020, 08:11:04 am »
Well, the leds that i have at the moment are sanded so they are less powerful than what they used to be but i've tried them anyway with the new firmware,
and unfortunately it still suffers from the same issues, but this could very well be due to the leds themselves.

I need to get new ones and try, i thought about installing 12 leds, 3 on each point and run them to their max specs, meaning 100ma each led.
What are your thoughts about that, JayBee? Would that cause issues? A testing tool for the leds would help tremendously, so looking forward to that.
Also, I didn't get the issues kill_one got, just the same ones as before, sometimes moving the gun vertically makes it go horizontal and so forth.
Again, before jumping into conclusions i think testing with new leds is mandatory.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #242 on: February 10, 2020, 09:05:31 am »
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
If they are truly powered in 5v and don't use so much current you can use the Arduino vcc.
But without knowing the current they are using it's a risk to take. I think the max current the vcc can provide is 500mA.

I'm not sure how to check the max voltage either, I wish I knew how to.
The best way I found so far is the follow the traces on the original pcb, from the rumble to the power supply, to see which components are used.
Sometime it's easy to see if the motor is fed directly from the vcc or not.


i took these

do you think they are fine? the space left is very little with these I should be able to insert them...

can I power 2 solenoids with a single 24v power supply?
I do use a very similar solenoid, so yeah it should work fine!
For the fitting I had to do so many measure and search for while before finding one that fits, and I still had to trim a little bit of plastic  :lol
Just remember that you need space both in the front and the back of the solenoid for the recoil to move without damaging anything.

Yeah a power supply can easily power both solenoid at the same time if it's powerful enough. At least that's what I am doing and it works great :D
Here are what I am using for the cables and power;
- 3m microUSB -> USB cable to connect the arduino
- 3m 2.1mm x 5.5mm connector power cable, male <-> female
- 3m plastic corrugated tube to hold both cables together and protect them
- a 24v 4A power supply with 2.1mm x 5.5mm connector (you probably don't need a power supply that strong, I took it large just in case I needed to power more solenoids at a time)
- 2.1mm x 5.5mm Y adapter to power 2 guns solenoid at a time

So I just cut the connector of the power cable I don't need, and solder it to the solenoid driver pcb.
I attached some images of those parts if you need.
« Last Edit: February 10, 2020, 09:08:20 am by JayBee »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #243 on: February 10, 2020, 09:34:35 am »
Well, the leds that i have at the moment are sanded so they are less powerful than what they used to be but i've tried them anyway with the new firmware,
and unfortunately it still suffers from the same issues, but this could very well be due to the leds themselves.

I need to get new ones and try, i thought about installing 12 leds, 3 on each point and run them to their max specs, meaning 100ma each led.
What are your thoughts about that, JayBee? Would that cause issues? A testing tool for the leds would help tremendously, so looking forward to that.
Also, I didn't get the issues kill_one got, just the same ones as before, sometimes moving the gun vertically makes it go horizontal and so forth.
Again, before jumping into conclusions i think testing with new leds is mandatory.
I will see if I can finish the tool tomorrow, I definetely want to check how the led detection behave on your system, to be sure to know where the issue is coming from.
This new firmware should be correcting those kind of detection problems in real time, but it might need some more work and testing.

Having 3 leds on each point is actually the solution I was going to try, it seems like the solution used in many IR systems (the wii sensor bar for instance).
But then I saw those:
https://www.aliexpress.com/item/32862219437.html
1W power, 120 degrees, looks easy to use on any surface...
I have no idea how well it would work on our system, nor how to power them, but I still ordered some of them just to try :lol
Might take a while to come from china, but I will keep you guys updated once I got to test them.

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 #244 on: February 10, 2020, 04:25:48 pm »
- 10k resistor
Doubt...10k or 100k ? Because in the scheme there is a 100k resistance
 Which one to use? :D

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #245 on: February 10, 2020, 09:49:25 pm »
Doubt...10k or 100k ? Because in the scheme there is a 100k resistance
 Which one to use? :D
I'm using 10k, but 100k should be fine too, it doesn't matter so much as long the resistor value is high enough to not short the data pin ;)

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 #246 on: February 11, 2020, 02:35:37 am »
I'm using 10k, but 100k should be fine too, it doesn't matter so much as long the resistor value is high enough to not short the data pin ;)

Ok since I had the 10k ones I will use those... Thanks

Recalibrating the gun with the new firmware is much better it has come back to be precise, but it still happens that pointing to the center of the screen the cursor moves to the right and remains blocked on the right side or off-center on the right, then I have to tilt the gun several times on one side to make it return to normal and then also the cursor duplicated every now and then, I don't know if it can depend on the LEDs on the right, I will wait for the tool to check them :)

Link to video
https://photos.app.goo.gl/RVx1jzdREEV9iEfA7
« Last Edit: February 11, 2020, 02:47:00 am by kill_one »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #247 on: February 11, 2020, 04:13:15 am »
* 2020/02/11 - IR cam testing tool
- I uploaded the Processing sketch for testing the IR points, and the firmware that works with it.

Read in the main post to see how it works  ;)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #248 on: February 11, 2020, 04:26:17 am »

Recalibrating the gun with the new firmware is much better it has come back to be precise, but it still happens that pointing to the center of the screen the cursor moves to the right and remains blocked on the right side or off-center on the right, then I have to tilt the gun several times on one side to make it return to normal and then also the cursor duplicated every now and then, I don't know if it can depend on the LEDs on the right, I will wait for the tool to check them :)

Link to video
https://photos.app.goo.gl/RVx1jzdREEV9iEfA7
Thanks for your testing and videos  :cheers:
I can see there is clearly a detection issue there, I'm interested to see how it react with the testing tool I just posted ;)


I think I actually found what's making the detection go crazy when there is a misdetection of IR points, I'm quite confident that can be fixed/improved with a software update, so it might come in the next 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 #249 on: February 11, 2020, 04:30:48 am »
This is the circuit that I created, I used IRF540 which is equivalent to IRL540 then 1N4001 Res 1k 10k transistor 2222 and res 270ohm.
can you tell me if the connections are all correct or did i do something wrong? It only remains to be seen whether the motors I have are powered by 5v or 3.7v. :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 #250 on: February 11, 2020, 04:35:00 am »
I can see there is clearly a detection issue there, I'm interested to see how it react with the testing tool I just posted ;)

Great! thanks! I will test it after lunch! :D

so should the firmware be replaced to test it?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #251 on: February 11, 2020, 05:14:44 am »
This is the circuit that I created, I used IRF540 which is equivalent to IRL540 then 1N4001 Res 1k 10k transistor 2222 and res 270ohm.
can you tell me if the connections are all correct or did i do something wrong? It only remains to be seen whether the motors I have are powered by 5v or 3.7v. :D
Sadly the IRF540 isn't the same, it's a power gate instead of a logic level gate.
The IRL540 will either fully open or fully close its gate when receiving a signal from the arduino, no matter the voltage.
The IRF540 will open the gate depending of the voltage it receives, with a maximum of 10v, meaning at 5v it will open half, your solenoid will be underpowered  :-\

The rumble circuit seems fine, but there are few mistakes in your solenoid circuit:
The 10k resistor should not be between the mosfet and the ground, but between the Gate pin and the Source pin of the mosfet.
And I think you reversed the gate pin and the drain pin of the Mosfet. I know it's confusing but the mosfet schematic pin order isn't the same as the real pin order.

I attached a pinout image for the mosfet.
« Last Edit: February 11, 2020, 05:19:32 am by JayBee »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #252 on: February 11, 2020, 05:35:07 am »
* 2020/02/11 - 1.60 beta
- I updated both the beta firmware and the test tool firmware to reduce the detection issues.

@kill_one & @Foxhole this version should improve the detection problems, I updated both the normal firmware and the test tool firmware.
Tell me if it works better for you ;)

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 #253 on: February 11, 2020, 06:19:23 am »
Sadly the IRF540 isn't the same, it's a power gate instead of a logic level gate.
The IRL540 will either fully open or fully close its gate when receiving a signal from the arduino, no matter the voltage.
The IRF540 will open the gate depending of the voltage it receives, with a maximum of 10v, meaning at 5v it will open half, your solenoid will be underpowered  :-\
ahhhhhhhrgghhhhh! At the shop they told me it was the same ...: D oh well but the solenoid works the same even if underpowered?

The 10k resistor should not be between the mosfet and the ground, but between the Gate pin and the Source pin of the mosfet.
And I think you reversed the gate pin and the drain pin of the Mosfet. I know it's confusing but the mosfet schematic pin order isn't the same as the real pin order.
I attached a pinout image for the mosfet.
ah ok, thanks! As soon as IRL540 mosfets arrive that I ordered today I change the connections

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 #254 on: February 11, 2020, 07:51:50 am »
JayBee, I'm trying your test firmware with the pde file but i get the exact same issues.
I flashed the test firmware, started JB_ircam_test.pde, pressed run, and i get a gray screen, just like with the dfrobot ir cam code.
I believe it doesn't open the right COM port, the com port is 13 but i don't see any manual way to choose it.

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 #255 on: February 11, 2020, 08:12:19 am »
Also, i installed the 12 leds, 3 in each point, with 100ma current going through them, they are brighter than before.
Unfortunately, there are still issues, same ones as in my video, with all the firmwares, including the new 1.60, it tends to happen more often when coming from offscreen reload,
though i gotta say that with the new setup with the leds it's more stable than before, though not sure if it's because there are 3 on each point or because it's running on 100ma.
It's more playable now from about 1.3 meter, but trying to get closer results in more detection issues making it unplayable in games like point blank which require fast response.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #256 on: February 11, 2020, 08:17:52 am »
JayBee, I'm trying your test firmware with the pde file but i get the exact same issues.
I flashed the test firmware, started JB_ircam_test.pde, pressed run, and i get a gray screen, just like with the dfrobot ir cam code.
I believe it doesn't open the right COM port, the com port is 13 but i don't see any manual way to choose it.
You don't have any other device connected that might be using a serial port?
The pde file is coded to connect on the first available port, but your arduino might not be the first one somehow  :dizzy:
To manually force the serial port, in the pde file, replace this line:
Code: [Select]
myPort = new Serial(this, Serial.list()[0], 9600);By this line (if 13 is your arduino serial port):
Code: [Select]
myPort = new Serial(this, "COM13", 9600);

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 #257 on: February 11, 2020, 08:36:45 am »
That fixed it, it's working now.
From what i can see it seems to detect each point twice(?)
gonna post a video soon.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #258 on: February 11, 2020, 08:39:45 am »
That fixed it, it's working now.
From what i can see it seems to detect each point twice(?)
gonna post a video soon.
No it detects them only once, the second ones (slightly grayed ones) are with the tilt correction, it makes thing easier to check.
Just tilt the gun a bit you will see what I mean  ;)
« Last Edit: February 11, 2020, 08:43:54 am by JayBee »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #259 on: February 11, 2020, 08:42:15 am »
* 2020/02/11 - 1.65 beta
- I updated both the firmware once again to fix some bugs and reduce the detection issues even more.

Also, i installed the 12 leds, 3 in each point, with 100ma current going through them, they are brighter than before.
Unfortunately, there are still issues, same ones as in my video, with all the firmwares, including the new 1.60, it tends to happen more often when coming from offscreen reload,
though i gotta say that with the new setup with the leds it's more stable than before, though not sure if it's because there are 3 on each point or because it's running on 100ma.
It's more playable now from about 1.3 meter, but trying to get closer results in more detection issues making it unplayable in games like point blank which require fast response.
I made another update, managed to find other causes of issues and fix them, it should work a lot better and more stable now.
Tell me if that makes any difference for you  ;D

Also in this testing firmware I left the mouse control on, to check how the cursor is moving at the same time as testing with the tool.

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 #260 on: February 11, 2020, 08:53:52 am »
I've uploaded a video of me testing the IR Test, this is with the first IR Test you uploaded, I'll also try the new one.
https://drive.google.com/open?id=15bZ7yGlOgKJ37o0zE1ZBFgGQ65oOLFps

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #261 on: February 11, 2020, 09:10:35 am »
I've uploaded a video of me testing the IR Test, this is with the first IR Test you uploaded, I'll also try the new one.
https://drive.google.com/open?id=15bZ7yGlOgKJ37o0zE1ZBFgGQ65oOLFps
Thanks for your video, I can see more clearly what's happening now :cheers:
Both issues you had should actually be fixed in the last test firmware.
If you still get the first issue (axises flipped 90degrees), tell me, we might try something else if needed ;)

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 #262 on: February 11, 2020, 09:22:40 am »
You don't have any other device connected that might be using a serial port?
The pde file is coded to connect on the first available port, but your arduino might not be the first one somehow  :dizzy:
To manually force the serial port, in the pde file, replace this line:
Code: [Select]
myPort = new Serial(this, Serial.list()[0], 9600);By this line (if 13 is your arduino serial port):
Code: [Select]
myPort = new Serial(this, "COM13", 9600);

ah that's why it wasn't going ... I will try the test tonight, instead the firmware 1.60 was much better but every now and then the cursor would be thrown the same I will also try 1.65 tonight :)

The rumble engines of the xbox 360 that you used feed directly to the 5v? could you insert photos of the ones you made? Thank you

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 #263 on: February 11, 2020, 09:22:57 am »
Two more videos with the new IR Test firmware, I specifically wanted to show the difference between close and far, close = 70~85cm, far = 1.2M~1.3M
You can see the issues when coming back from offscreen, much worse when being close.
Close: https://drive.google.com/open?id=1wqlxqMSKPuO2LOhYP1SfgMXWLFWhHr8F
Far: https://drive.google.com/open?id=1rdHbK-zS34g7Wl8AhOxh29Gxw4LC-e-x

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #264 on: February 11, 2020, 09:41:42 am »
Two more videos with the new IR Test firmware, I specifically wanted to show the difference between close and far, close = 70~85cm, far = 1.2M~1.3M
You can see the issues when coming back from offscreen, much worse when being close.
Close: https://drive.google.com/open?id=1wqlxqMSKPuO2LOhYP1SfgMXWLFWhHr8F
Far: https://drive.google.com/open?id=1rdHbK-zS34g7Wl8AhOxh29Gxw4LC-e-x
Wait, I don't see any issues in your videos :lol
The leds are all moving and rotating correctly on the test tool.
Can you tell me what is the issue?

If it's the led staying black color when going back on screen after being out of range it's actually normal.
When losing track of all the leds (going off range), the system needs to see at least 3 leds again to know which is which.

It should actually need only 2 leds, but I disabled the 2 leds detection function on the last beta firmware to fix the 4 and 3 leds detection first.
I'm enabling it back right now, I will upload the next test firmware in few minutes if everything goes well ;)

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 #265 on: February 11, 2020, 09:53:53 am »
Two more videos with the new IR Test firmware, I specifically wanted to show the difference between close and far, close = 70~85cm, far = 1.2M~1.3M
You can see the issues when coming back from offscreen, much worse when being close.
Close: https://drive.google.com/open?id=1wqlxqMSKPuO2LOhYP1SfgMXWLFWhHr8F
Far: https://drive.google.com/open?id=1rdHbK-zS34g7Wl8AhOxh29Gxw4LC-e-x
Wait, I don't see any issues in your videos :lol
The leds are all moving and rotating correctly on the test tool.
Can you tell me what is the issue?

If it's the led staying black color when going back on screen after being out of range it's actually normal.
When losing track of all the leds (going off range), the system needs to see at least 3 leds again to know which is which.

It should actually need only 2 leds, but I disabled the 2 leds detection function on the last beta firmware to fix the 4 and 3 leds detection first.
I'm enabling it back right now, I will upload the next test firmware in few minutes if everything goes well ;)
Thing is, when trying to play close this causes issues.
Let me give you a scenario, you start a game of point blank, you're resting your hand, game starts and you need to shoot on the lower left of the screen, the gun will not fire, because you need to aim towards the center first. If playing from 1.2M it's not that big of a deal actually, but when close it's pretty much a deal breaker.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #266 on: February 11, 2020, 10:04:06 am »
Thing is, when trying to play close this causes issues.
Let me give you a scenario, you start a game of point blank, you're resting your hand, game starts and you need to shoot on the lower left of the screen, the gun will not fire, because you need to aim towards the center first. If playing from 1.2M it's not that big of a deal actually, but when close it's pretty much a deal breaker.
Yes I know, that's why I'm putting back the 2 leds detection function now.
I just removed it for the beta version (hence the beta title ;) ), just to fix the bugs one by one.
2 leds is enough to shoot in corners. If the cam is just close enough to see the 4 leds, it will catch 2 leds right away in corners/borders ;D

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 #267 on: February 11, 2020, 10:06:03 am »
Great, i'll try the new firmware and report.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #268 on: February 11, 2020, 10:24:58 am »
Great, i'll try the new firmware and report.
The re-implementation of the 2 points detection is taking me a bit more time than expected, I need to change the way it work to fit my new code.

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 #269 on: February 11, 2020, 10:46:19 am »
The re-implementation of the 2 points detection is taking me a bit more time than expected, I need to change the way it work to fit my new code.

so I who have 2 LEDs per point, shouldn't I use the latest firmware?

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 #270 on: February 11, 2020, 10:48:14 am »
but is it normal that this happens in the test tool?

https://photos.app.goo.gl/pjzWq4PuFxzNEPZr7

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #271 on: February 11, 2020, 10:49:31 am »
so I who have 2 LEDs per point, shouldn't I use the latest firmware?
Sorry for the confusion, I was talking about 2 points detection when going back onscreen, not 2 leds.
You can have as much leds as you want on each points it should be fine  ;)

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #272 on: February 11, 2020, 10:51:43 am »
but is it normal that this happens in the test tool?

https://photos.app.goo.gl/pjzWq4PuFxzNEPZr7
Not normal at all... what's your screen resolution/refresh rate?

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 #273 on: February 11, 2020, 11:14:21 am »
Not normal at all... what's your screen resolution/refresh rate?
Windows 1024x240  60hz  and Mame resolution is 2560x240 60hz  :D
it is a 15khz arcade monitor...
can the test window be set to fullscreen?


JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #274 on: February 11, 2020, 11:29:22 am »
* 2020/02/12 - 1.66
- fixed some bugs and re implemented the 2 points detection

Great, i'll try the new firmware and report.
Done! 2 points detection is back ;D
I hope this time it's working fine  :cheers:

Windows 1024x240  60hz  and Mame resolution is 2560x240 60hz  :D
it is a 15khz arcade monitor...
can the test window be set to fullscreen?
Oh, that explains the issue :laugh2:
yeah this app is supposed to be running in 1024x768, the native resolution of the IR cam sensor.
Can you run the desktop at 480i instead just for testing?
I will try to make the app fit in 640x480 :P

Edit: I just modified it to fit 640x480, and while I was at it I did another version for 1024x240  :lol
You will find them in the zip attached to this post
« Last Edit: February 11, 2020, 11:47:09 am by JayBee »

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 #275 on: February 11, 2020, 12:07:41 pm »
Unfortunately, with the new firmware, it still has issues when trying to play close.
Included another short video.
Sometimes, even after detecting 2 leds they still stay black and the cursor is stuck.
Happens often while gaming.
https://drive.google.com/open?id=1qg0YXbC96wi5R3u6-aUxk0tMmtPkCWKj

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 #276 on: February 11, 2020, 12:14:38 pm »
Edit: I just modified it to fit 640x480, and while I was at it I did another version for 1024x240  :lol
You will find them in the zip attached to this post

you are great! :D
I will try tonight... ;)

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 #277 on: February 11, 2020, 12:56:54 pm »


i found and removed these from an old broken usb joypad for pc, what happens if i power externally at 5v and i am not at 5v? They explode ??? : D

I think those of bioguns xbox e DC are 3v or 3.7v even if I don't find much info about it... how can I reuse them?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #278 on: February 11, 2020, 01:21:31 pm »
Unfortunately, with the new firmware, it still has issues when trying to play close.
Included another short video.
Sometimes, even after detecting 2 leds they still stay black and the cursor is stuck.
Happens often while gaming.
https://drive.google.com/open?id=1qg0YXbC96wi5R3u6-aUxk0tMmtPkCWKj
I see what's happening; from the way the corrected points (gray points) are oriented, the gun was tilted on the side when the cam went off range of the leds, and was in a different angle when back.
Without gravity sensor tracking the twist out of the leds range is impossible, so for the 2/3 points recognition to work, the twist when going off range and the twist when going back on has to be around the same (it has around 35 degrees tolerance).
But it should always come back instantly when seeing the 4 leds again anyway, no matter the angle.

It's weird tho, during the many hours I tested the gun, I never had a case where 3 points where not recognized. Sometime it wasn't recognized correctly with an older firmware, but never not recognized at all.

I made a small fix that might help with the issue, can you test the firmware attached to this post and tell me if you see any difference? (replace the one in the test folder)

I also have some other ideas if this fix doesn't work well, but it will have to wait tomorrow  :lol
« Last Edit: May 07, 2020, 09:15:13 am by JayBee »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 496
  • Last login:Today at 12:21:52 am
  • I it ain't good, I'll make it good.
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #279 on: February 11, 2020, 01:29:07 pm »

i found and removed these from an old broken usb joypad for pc, what happens if i power externally at 5v and i am not at 5v? They explode ??? : D

I think those of bioguns xbox e DC are 3v or 3.7v even if I don't find much info about it... how can I reuse them?
I'm still not an electronic specialist, but if I was you I would start powering them with a couple of AA batteries (so a total of 3~3.3V) to check how well they turn.
And then try with a 5V power to see if they seem to turn faster/too fast.
Motors have quite a good tolerance for over voltage usually, so it shouldn't blow up or anything.
If it's USB there is a big chance it's 5V tho, 3V ones are more likely to be smaller than that and be in wireless controllers.
There are even motors that work with 7~9V in the PS2 Dual shock controllers, but they are turning a bit slow and weak with the arduino :lol