Jump to content



Photo
* * * * * 3 votes

New DIY plunger design


  • Please log in to reply
734 replies to this topic

#601 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 13 April 2016 - 11:10 AM

What's the ETA on the updated version MJR?

 

Is it possible to throw out the dark lines outside the ends.



#602 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 13 April 2016 - 11:20 AM

Hey, was looking at the code...it looks like it is possible to throw out values that are dark after it starts being pulled back but it'd require rewriting ccd.h.



#603 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,323 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 13 April 2016 - 05:19 PM

What's the ETA on the updated version MJR?

 

Sorry, I won't know until it's ready.  There are still some more things to finish before it's usable.

 

 

Hey, was looking at the code...it looks like it is possible to throw out values that are dark after it starts being pulled back but it'd require rewriting ccd.h.

 

Have at it!  If you get that working, I'll be happy to try to incorporate it into the base code as an option, if you think it would work for other people.



#604 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 13 April 2016 - 05:51 PM

Unfortunately my C is terrible.  It's going to be slow going.  I don't even know how to compile the thing.  Are there instructions some place?  I would think that just looking at the set position and determining the previous one and if it's blank then just return nothing instead of the start. would work.


Edited by kruuth, 13 April 2016 - 05:52 PM.


#605 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,323 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 13 April 2016 - 06:20 PM

 I don't even know how to compile the thing.  Are there instructions some place?  

 

Just do the same thing you did to build the .bin file you installed in the first place - open the mbed project and click the Compile button at the top of the window.

 

 

 I would think that just looking at the set position and determining the previous one and if it's blank then just return nothing instead of the start. would work.

 

I doubt it's that simple, but you can certainly give that a try as a first stab at it.  I suspect what's actually going on is that you're getting random readings jumping around to unpredictable points from the shadow variations.



#606 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 14 April 2016 - 01:44 AM

There aren't any shadows that I can see.  You saw the video.

 

What do I do to make changes and then build?


Edited by kruuth, 14 April 2016 - 01:45 AM.


#607 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,323 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 14 April 2016 - 06:01 AM

There aren't any shadows that I can see.  You saw the video.

 

Yeah, it looked pretty clean, although you probably have a better view of it in person than I can get from the video.  I do think what's going on is most likely optical in nature given the observed behavior, but it's hard to tell by eyeballing it.  It's especially hard because the instability is so fleeting; the optical artifacts that are confusing the edge finder might be too fast to see in the pixel viewer.  We'll probably need to gather some raw data from the sensor for analysis to really see what's going on.  

 

 

What do I do to make changes and then build?

 

mbed has a quick getting-started guide here:  https://developer.mb...ating-a-program

 

That should show you the basics of using the online compiler.  Once you get through that, just go to the project page (https://developer.mb...ape_Controller/) and click the big blue Import This Program button at the top right, if you haven't already done that.



#608 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 14 April 2016 - 11:23 AM

Where you at?  It says you're stateside.



#609 NobodyYouKnow

NobodyYouKnow

    Hobbyist

  • Platinum Supporter
  • 48 posts

  • Flag: United States of America

  • Favorite Pinball: Space Invaders

Posted 17 April 2016 - 01:10 AM

So my TSL1410R arrived today, and I've had a bit of a chance to mess with it. Mind you, it is on my test bench - not in a game. My first goal was to just get it working and get a feel for its idiosyncrasies. The second was to use as simplistic a test bench setup to mock up a functional plunger sensor, so I can later test different configurations of placement / lighting / etc. My setup includes a barebones KL25Z running Pinscape, the TSL1410R linear array sensor, a few short wires to configure the sensor side, and 5 longer wires to connect it all up. This is all built on a prototyping board. A quick re-compile of Pinscape to turn on the sensor, and the off to the races.

 

The first tool I used to evaluate is the PinscapeConfigTool.exe. I opened up the CCD Exposure window and saw solid white. That bothered me, because the sensor was not in any particular directed light - in fact it was rather dark where the sensor was sitting. I grabbed a piece of opaque stiff paper, and used it to obscure part of the sensor. I was pleased to see the CCD display react, and follow as I moved the paper around - obscuring different parts of the sensor. Cool! This is working!

 

Looking at the data sheet, these sensors react to a very low light level and have a dynamic range (shades of gray) of 4000:1. I had to get my cardboard "plunger" exactly over the top of the sensor, and in contact with it to get the pixels all the way to black. I found that if I slightly angled the cardboard covering the sensor, I could get the individual pixels into their gray scale operational band.

 

@kruuth - I was able to reproduce symptoms similar to yours - individual pixels (displayed as a vertical bar in the CCD tool) and sometimes bands of pixels would show as slightly darker or lighter than the surrounding pixels. One factor I found was a translucent spot on the sensor PCB that allowed light through. That was kind of washing out that end of the sensor just a bit. Since the back of the sensor on my bench is not covered by anything, I put a bit of black electricians tape on it. That helped, but did not completely eliminate the bars.

 

So here is what may be going on. I found that the off-color gray bars would go to full black and full white. It was only in the gray zones that they looked different. In digging through the datasheet, the following footnote caught my eye:

 

"PRNU (Pixel response nonuniformity) is the maximum difference between the voltage from any single pixel and the average output voltage from all pixels of the device under test when the array is uniformly illuminated at the white irradiance level. PRNU includes DSNU (Dark signal nonuniformity)."

 

If I understand this geek-speak correctly, the manufacturer is telling us there may be some pixels lighter or darker than the others. This will vary from device to device, with differing degrees of prominence.

 

@mjr - I did a little spelunking into your code (very well written, by the way) looking for how the data stream from the CCD is handled. At some point I have not yet found (maybe in ccdSensor.h) you do a numerical average of dark to light, looking for the edge of the plunger shadow. The first time you encounter a pixel where the luminance dramatically drops, that becomes the shadow. Okay so far. What I have not found is where you accommodate the varying sensitivity of each pixel. It is almost like we need to do the light / dark average for each pixel, and offset accordingly. This seems computationally expensive.

 

Perhaps there is a way to introduce some hysteresis in the shadow edge calculation. We really do not care about "shades of gray" in this application. Would it be possible to introduce a deliberate rounding of the pixel luminance values as they are read? The idea is that anything below a certain threshold is considered black. Anything above a second higher threshold is considered white. This is the same approach the venerable TTL devices used. Anything below 1.5 is a zero, anything above 3.5 is a one. One good option may be to mask off the lower order bits. This should be computationally easy, and may neatly sidestep this gray bar consideration.

 

Anyway - this is just a first impression, and I fully understand I am years behind some of you.

 

Regards.



#610 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 17 April 2016 - 12:19 PM

Thanks for looking.  What do you think the fix should be?  Right now I'm using a single 12v LED as my light source, about 12 inches from the sensor.  Would putting electrical tape on the ends help?



#611 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 17 April 2016 - 04:07 PM

Looking at this code...since everything is done on the fly, it looks like returning the previous position of the shadow is not a possibility.  How do you know if it's in low or high res scan mode?  I think that rdeucing the resolution of when you're scanning the CCD should fix this, or, increase the shadow threshold, which I cannot figure out how to do.



#612 NobodyYouKnow

NobodyYouKnow

    Hobbyist

  • Platinum Supporter
  • 48 posts

  • Flag: United States of America

  • Favorite Pinball: Space Invaders

Posted 17 April 2016 - 04:46 PM

@kruuth - I need to say that despite the gray bars showing in the CCD Exposure window, the z-axis still works perfectly for me with the unmodified code.

 

I expect this gray bar thing is handled in software. I say that because new hardware is the alternative, and I am too pleased with the CCD concept.

 

I have done some hacking around and have found a simple code change to eliminate the bars. It looks perfect in the CCD exposure window - it was all solid black and solid white and moved smoothly with my cardboard plunger. The down side is that with this hack in place the z-axis position reporting (in joy.cpl) jumps all over the map as the plunger moves. It does not do that with the unmodified code. There is something I have not yet found in the code that is sensitive to this change. It will take me a while to figure out where all the moving pieces are.

 

As far as the electrical tape on the back of the sensor, I don't think that alone will fully resolve the problem. That said, it is an easy countermeasure to try. Maybe in your case it will help.

 

@mjr - I use the word "hack" above to indicate that I do not believe for an instant that what I am changing is either stable or desirable in the baseline. I feel kind of like I am wearing muddy boots when I step into your work.



#613 Les73gTx

Les73gTx

    Preschooler

  • Members
  • PipPipPipPip
  • 523 posts
  • Location:Maine

  • Flag: United States of America

  • Favorite Pinball: Power Play, BoP, JackBot, MM, AFM, CV, MB,Champions Pub, CftBL, ToM, and Many More

  • PS3 Gamer Tag: LCT0819, Les73gtx
  • 360 Gamer Tag: PissPoorShot

Posted 17 April 2016 - 05:07 PM

@NobodyYouKnow; have you tried to run your setup in the VP and see if your "gray bars" affect the plunger? I am asking because I also have the gray bars in my exposure window but it does not affect anything in VP for me ..... I had a problem getting the right light source and distance at the beginning and worked on it off and on for a week until I got it. I had interference from coin door lights flashing and also from the rgb led on the Freescale board itself when it was flashing from blue to green. I did not put anything on the back side of the CCD itself but I did have to fiddle with the distance between the CCD and the plunger.

@kruuth and NobodyYouKnow; I feel that if you follow the well laid out plans, this is the best setup available to date. I have experienced them all and only Zebs comes close but I prefer this DIY solution as it is damn near perfect with consistently repeatable results over long periods of play.

@mjr thank you for you diligence and dedication, this is amazing technology and very well put together and implemented. If we follow your hard work and steps and use the proper light source it will work first time every time. I am on my 3rd install into pinball cabs I have built for family, replacing Virtual plunger and a Zebs.
It just works Thank you.

Sent from my SAMSUNG-SM-G870A using Tapatalk

Edited by Les73gTx, 17 April 2016 - 05:10 PM.

les73gtx___atomicpin-pc.png
                                                                      


#614 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,323 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 17 April 2016 - 06:36 PM

So here is what may be going on. I found that the off-color gray bars would go to full black and full white. It was only in the gray zones that they looked different. In digging through the datasheet, the following footnote caught my eye:

 

"PRNU (Pixel response nonuniformity) is the maximum difference between the voltage from any single pixel and the average output voltage from all pixels of the device under test when the array is uniformly illuminated at the white irradiance level. PRNU includes DSNU (Dark signal nonuniformity)."

 

If I understand this geek-speak correctly, the manufacturer is telling us there may be some pixels lighter or darker than the others. This will vary from device to device, with differing degrees of prominence.

 

I think that's the right reading.  Basically they're saying that there's a variation to each voltage level by +/- 20% from the average of all pixels when the whole sensor is being uniformly illuminated at a level such that the average reading is fully saturated.  They don't give a lot of detail on how that translates over the whole exposure range, but I'd assume it's roughly linear - that it's effectively a +/- 20% error bar on each individual reading.  What's also not clear is whether the error for a particular pixel is constant over time, or if it's a random fluctuation on each reading.  If it's constant over time, it could be compensated for by gathering a bunch of calibration exposures to get a baseline for every pixel, figuring the ratio of that pixel's reading to the average over the whole sensor, and then dividing every reading of every pixel by that ratio.  If it's random on every reading, it would have to be handled with a dynamic noise reduction method.

 

 

There's also a random noise component from the ADC (the hardware module on the KL25Z that converts the voltage level read from each pixel to a digital value for the software).  And then there's the light source itself - our light sources are certainly not even close to perfectly uniform in time or space, and there are all sorts of stray lights and reflections that add further artifacts.

 

Anyway, the current software doesn't make any attempt to compensate for individual pixel response variation...

 

 

@mjr - I did a little spelunking into your code...  What I have not found is where you accommodate the varying sensitivity of each pixel.

 

Well, you haven't missed anything, because it's not there. :)

 

I haven't actually even experimented with that, mostly because all of my empirical testing has seemed to indicate that random noise is the big factor.  So the algorithm is just meant to be tolerant of random noise in aggregate, without trying to compensate specifically for any one source.

 

 

At some point I have not yet found (maybe in ccdSensor.h) you do a numerical average of dark to light, looking for the edge of the plunger shadow. The first time you encounter a pixel where the luminance dramatically drops, that becomes the shadow. 

 

It actually doesn't do any averaging - it just pulls the pixels at opposite ends of the sensor and uses those as the dark/bright levels.  The reasoning is that the plunger shadow edge always has to be somewhere in the sensor window, so the pixels at one end will always be in shadow, and the pixels at the other end will always be bright.

 

This is part of the noise tolerance strategy, by the way.  We don't know what the absolute exposure level is for any one frame - the time can vary, and we want to be tolerant of a wide range of lighting conditions - so we just take the samples of the extremes from each frame get the actual light-to-dark range for that frame.

 

 

We really do not care about "shades of gray" in this application. Would it be possible to introduce a deliberate rounding of the pixel luminance values as they are read? The idea is that anything below a certain threshold is considered black. Anything above a second higher threshold is considered white. This is the same approach the venerable TTL devices used. Anything below 1.5 is a zero, anything above 3.5 is a one. 

 

That's actually not far off from the effect of the algorithm, even though it doesn't actually recalculate any pixel values.  The algorithm finds the extremes of the exposure levels, then calculates a midpoint between them.  (The midpoint isn't quite the halfway point - it seems to work better to weight it a bit more toward the bright side.)  Anything brighter than the midpoint is pegged to "fully exposed" in the scan, and anything dimmer than the midpoint is pegged to "fully dark".  The edge finder just finds the place where we switch sides.  As long as any noise artifacts in the image are on one side or the other of that midpoint, it doesn't matter how "gray" they are.

 

I actually tried adding some more formal noise reduction when I was working on the new version of the sensor scanner a couple of months ago.  I found that a rank selection filter (basically a median cut filter) did a really good job of cleaning up the noise - but unfortunately, the poor little 48 MHz M0+ CPU couldn't execute it fast enough to keep up with the sensor frame rate, so I reluctantly had to remove it.  I did, however, tweak the edge finder algorithm slightly to make it a little better at rejecting transient pixel noise locally.

 

I might experiment a little at some point to see if it's possible to improve things with PRNU calibration - but not until after I get the new release out. :)  My intuition is that it wouldn't do much good given the magnitude of the random noise factors, but I've been around long enough to know that my intuition doesn't always stand up to numerical analysis, so I'll at least spend some time gathering data and see if it would help and could be made fast enough at run-time.



#615 NobodyYouKnow

NobodyYouKnow

    Hobbyist

  • Platinum Supporter
  • 48 posts

  • Flag: United States of America

  • Favorite Pinball: Space Invaders

Posted 17 April 2016 - 11:19 PM

@Les73gTx - Thanks for the input. There are things you mention that I will have to address when I finally start the build of my first V-Pin.

 

I personally am not having any adverse effects from the gray bars. "JOY.CPL" shows only a tiny wiggle on the z-axis when everything is mechanically stable, and follows my cardboard cursor nicely. Given this, I expect no issues from VP(n). I will have to do some more bench testing to be sure. Your mention of sensitivity to ambient light strikes home. It is surprising to me how sensitive those sensors are.



#616 Mace

Mace

    Hobbyist

  • Members
  • PipPip
  • 28 posts

  • Flag: United Kingdom

  • Favorite Pinball: Centaur

Posted 18 April 2016 - 11:50 AM

I'll go back to my earlier comments on the forum, my rig had issues similar to this which I traced to the the light coming from other indicator LEDs in my cab. The fix was really easy, I took a piece of plastic pipe from the DIY store which fitted over the plunger and pushed onto the base of the mounting, it fitted so securely no other hardware was needed to hold it in place. I measured the plunger travel and cut two slots exacely the size of the sensor window facing one another into the tube. On one side I use a hot glue gun to secure the sensor in place supported by two tie wraps, on the other side I mounted a piece of clear plastic 5mm thick with the same tie wraps holding it and hot glue again, I then mounted the two blue LEDs Mike listed pointing into the side of the plastic at the top and bottom of the tube so they were aligned with the plunger travel directions. Then the whole thing was covered in black tape to block external light, including a bung at the end of the tube. I used a normal plunger rubber on the end of the plunger and squared it off, adjustments were made using Mikes test program and in the first instance fine tube length trimming (I left it a little long to allow this) and finally by adjusting the rubber tip by adding washers if necessary inside the tip rubber. The performance has been spot on ever since, my LED's are not bright, I've adjusted their resistors to give them a little less then their normal current. As a bonus I've mounted bright white LEDs inside my cab wired through the original door power switch so, like a fridge, when I open the door the light comes on to save groping around for the USB slots.

One thing which is key is the normal resting point of the plunger should still leave a good sized (~20%) white area at the top of the travel to allow for over ounce on the plunger release and to make sure that if you use Zebs push launch option Mike built in there is enough of the sensor left to measure that extra travel.

Hope this helps.

Edited by Mace, 18 April 2016 - 11:54 AM.


#617 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 18 April 2016 - 10:51 PM

I'm using twilight zone, and the plunger is very, very slightly angled.  A problem

 

I tried something new.  I covered the light with black electrical tape to the point where I had about 1/2 the LED working.  I also put black electrical tape on both ends of the sensor.  This gave it a much better source that <i>almost</i> works.  It seems to have only about 25% of the play it should have, even after using the windows config.  I've got a much darker LED on the way so I can test with that.

 

 

MJR, this is a really great project with the critical flaw of the banding problem.  As more people start using it, I would wager that more people are going to see this. I'm perusing the code and it looks like it's not very easy to throw out any black lines between the start and end points of travel for the plunger.  If lowering the resolution on it would help, that might be the answer, since you really only need 8-16 points to get enough for vpin to handle the rest.  Maybe dropping the resolution waaaaaay down would be a better solution?  Is there a simple way to do that in the ccdsensor.h file?  It looks as though there is already a lowres scan and then a hires scan.



#618 Les73gTx

Les73gTx

    Preschooler

  • Members
  • PipPipPipPip
  • 523 posts
  • Location:Maine

  • Flag: United States of America

  • Favorite Pinball: Power Play, BoP, JackBot, MM, AFM, CV, MB,Champions Pub, CftBL, ToM, and Many More

  • PS3 Gamer Tag: LCT0819, Les73gtx
  • 360 Gamer Tag: PissPoorShot

Posted 18 April 2016 - 10:54 PM

Lol there is no flaw .... sorry man you have proved it to yourself

Sent from my SAMSUNG-SM-G870A using Tapatalk

les73gtx___atomicpin-pc.png
                                                                      


#619 kruuth

kruuth

    Enthusiast

  • Members
  • PipPipPip
  • 316 posts

  • Flag: United States of America

  • Favorite Pinball: Pinbot

Posted 18 April 2016 - 11:29 PM

I said it almost works. I have issues with travel still. It's still giving me trouble

#620 Les73gTx

Les73gTx

    Preschooler

  • Members
  • PipPipPipPip
  • 523 posts
  • Location:Maine

  • Flag: United States of America

  • Favorite Pinball: Power Play, BoP, JackBot, MM, AFM, CV, MB,Champions Pub, CftBL, ToM, and Many More

  • PS3 Gamer Tag: LCT0819, Les73gtx
  • 360 Gamer Tag: PissPoorShot

Posted 19 April 2016 - 12:08 AM

Sorry but I have been reading all your posts and your comment seems to point to the fact that there is a flaw in his hard work, when you have proved it yourself that changes made by you in placement and light source makes improvements. Regardless if your issue is fixed or not was not the point, your comment was just humorous to me. There is nothing wrong with this DIY project as proof from all the others that can make it work. Putting it nicely there needs to be some more adjustments made to your setup. I have installed 3 setups into different Pincabs and if you follow the instructions to the letter (light source included) it works, no need for any more code work.
Thanks that is all I have to say. Good luck to you

Sent from my SAMSUNG-SM-G870A using Tapatalk

les73gtx___atomicpin-pc.png