Sunday, February 3, 2019

Electronic Tilt Bob for Pinball Machines - Part 3

It's been a few months since I last posted an update and I blame that on diving head first into a new job.  Since that has passed and it's become a routine, I'm back to Tilting.


As I stated on TiltForums, I love to get feedback because it forces me to look at things from a different perspective and improve as necessary.  After reading one of the comments, I came to the conclusion that I did not accurately simulate the physical movement of the table which can be caused by loose bolts on the machine's legs.  In fact, this particular situation made me re-evaluate how acceleration is applied and translated into the bob's movement.  In layman's terms, this just means that the math got more complicated, but from the player's perspective, the simulation feels more responsive and real ... which is the ultimate goal.


Phase 13:  Yet Another Design Improvement


Evolution is the backbone of any good project and this product has had its fair share of improvements that I've implemented.  This particular improvement is based on the future implementation of the device in a tournament environment.  I've highlighted the changes in the picture.


It might not seem like much, but adding a switch to the design increases the security of the device.


So, why the switch and what does it do?  Let me explain.



In order to configure the device, we use a wifi connection for communications.  The unit sets itself up as an Access Point that we can log into, very much the same way as your router does to do its configuration.  It can be used as a stand alone option or you can additionally connect the device to your existing router (as a Station) and access advanced options (ie tournament setting).

Connecting as a Station on your router is secure because, in theory, only you know the SSID (if hidden) and password to access it.  However, for simplicity of use, I never implemented a user settable password when the device is configured as an Access Point.  Every device has the same Access Point password as part of the initial setup and this is done to ensure that you can connect and configure it in the first place.  But this does create a dilemma.  It is equivalent to leaving the access door open on the front of the machine and allowing the player to alter the tilt mechanism during play ... Not a good idea.

Think of the switch as the lock on the front door of the machine.  When you turn on/off the switch you can enable/disable the WiFi as an Access Point.  The device will continue to access your router as a Station (if you've set it up) but it will not act as its own router to be connected to as an Access Point.  So when you flick the switch, the WiFi access to the configuration page is disabled ... just as if you had a mechanical bob and locked the cabinet door.


Phase 14:  Yaw, Pitch and Roll Sensing

It should be noted that Yaw, Pitch and Roll (YPR) values are rotational components generally received from a gyroscope and not force components in the X, Y and Z axis that are received from an accelerometer.  However, Pitch and Roll angles can be calculated from accelerometer values as described in the 2010 ST Microelectronics application note (AN3192).



PR angles calculated in this matter, as applied to a pinball machine, translates into someone lifting the front/rear of the machine (Pitch) or lifting the left/right side up (Roll).  While these values could help with the levelling of the machine during its initial installation, they provide no real value during actual gameplay.  I've yet to see a pinball machine that encourages people to physically Pitch, Roll or Yaw its 250+ pound enclosure ... bumping in the X or Y axis yes, but not rotating in YPR.

It is my opinion that pinball owners will use an external bubble level to assist with the initial roll levelling and use the playfield bubble level (if equipped) to set the pitch as per the setup instructions.  Based on this premise, I do not calculate YPR values for setup, operation or automatic levelling.  I deal exclusively with acceleration in the XYZ axis only.  Perhaps in the future I might incorporate this into the initial machine levelling however, it is very low on the priority list since players have been levelling their machines without electronic assistance for years.  I still have the ability to adjust for minor levelling offsets of the Electronic Tilt since I doubt anyone has the ability to mount any tilt device 100% level, mechanically.


Phase 15:  Y'All Ready For This

Beta testing has begun.  In other words, I've put prototypes in the hands of a number of players and I'm getting some great feedback rolling in.  A special shout out goes out to all my testers at Hammer City Pinball and Jerry at Player One Amusement Group (Toronto) for being the first ones to receive/test/critique the prototypes.


I've been offered to place one in a machine on the showroom floor of Player One Amusement Group in Toronto.  However, I've delayed the installation until I can assure that they get something in return (ie more customers).  This requires active promotion on my behalf which I'll admit, is not my forte.  To twist a Dr. McCoy Star Trek quote "Dammit Jim, I'm an Engineer not a Salesman".

Send me a message if you'd be interested in going there to see it in action and I'll prioritize the install.

UPDATE:  I am planning to be at Player One Amusements (Toronto) on Saturday, February 9, 2019 for "The Munsters Launch Party". 


Phase 16:  Tournament Tilt Matching

Some of the biggest excitement I get from people is the ability to match the tilt settings from one machine to the next.  We've all seen it before ... You go to a tournament with 8 identical machines, yet everyone only plays on machine number 3 because the tilt settings are much looser.  The same goes for comparing the ability of someone playing in New York versus someone playing in Sydney.  How can we accurately compare the abilities of the players if the tilt is set tighter in one location versus the other?  You can't ... until now.

Matching the tilt settings from one location/machine to the next ensures that everyone is held to the same standard.  This way, player rankings can more accurately reflect the players true abilities as opposed to getting an artificially high score by playing on a loose machine.


Phase 17:  Tournaments and the Waiting Game

In addition to matching tilt parameters for machines around the world, I've added the ability to remotely zero the tilt bob.  (As I typed the last sentence I heard a thousand pinheads say 'Thank You')

Why?  There are some players who will wait 1~2 minutes after the previous player before they start their ball.  The reason being is that they are waiting for the tilt bob to settle first.  If you've ever been in this situation then you know how this disrupts the flow of the game ... and if you've ever run a tournament then you know how much extra time this can add to your day.

I've got a few ideas on how to implement this automatically and will eventually incorporate it into the electronics, but for the time being, a simple click of a web-page zeros the tilt bob.

No more waiting between players ... amazing.


Phase 18:  Building A Better Mouse Trap

Prototypes are meant as a stepping stone to get you to the final product.  As stated earlier, user feedback has driven improvements and will continue to drive improvements in the future.

One of the biggest improvements by far, is the ability for the user to modify the javascript/html/css interface to their liking and SAVE IT TO THE DEVICE.  Perhaps you prefer a green background or different button styles or even a nicer simulation of the tilt bob's movement ... now you can do it.  I leave this customization to the creativity of the community.

Other improvements I'm currently working on or thinking about:
 - shrinking the board size (will be done before first sale)
 - porting to a 32 bit processor
 - central server configuration/setup
 - auto tilt bob zeroing between players
 - integration with streaming video to show tilt bob position
 - using your smartphone's NFC as a means to zero the tilt bob


Phase 19:  Kick It

I'm at the point where proof of concept has proven itself, initial prototypes have yielded positive results and the feedback from others has been extremely encouraging.  There's not much left except to take it to the next level.

Production of the first saleable units will begin shortly however, I'd like to gauge the real interest level.  I have a targeted retail price of $99 USD, with discounts for bulk purchases.

Those people interested in acquiring a unit for purchase can post their intent in the comments section or contact me at:  electronictilt (_at_) gmail.com



To Be Continued ... 

Monday, June 18, 2018

Electronic Tilt Bob for Pinball Machines - Part II

At this point in time, the core software emulation is functioning as expected which leaves only fine tuning to be completed.  The only firmware changes I am making at this point are to add new features as people suggest them.  One of which is to to be able to zero the tilt bob between players (ie tournaments).


Phase 7:  Installation

Have you ever designed a product only to say, "Ooops, I didn't think of that at the time"?  Well, this happens to be one of those times.  Two things jumped out at me the second I tried to install the PCB.

  1.   The board is just slightly too large
  2.   No holes for mounting



The whole idea of making this project was to replace a mechanical tilt bob with minimal changes to an existing pinball machine.  Ideally, the PCB should have fit between the top and bottom metal piece of the existing tilt bob ... in other words, no changes to the existing setup and the ability to quickly switch back if required.  My measurements were close, but not close enough.  The board was about 3~5 mm too big to fit within the space.  Unfortunately, this required the removal of one half of the tilt bob bracket which can be seen by the holes between the board and the ball and under the tie-wrap.

The other issue I ran into was I didn't think about mounting holes.  In the back of my mind I was thinking velcro would work, but I'm sure the board would come loose over time.  Luckily there were a couple of spaces on the PCB I could drill into.


Phase 8:  Connecting to the Existing Tilt Mechanism and Power





The two white wires connect to the existing tilt brackets using spade connectors.  Again, the whole idea was to quickly and easily tap into the existing wiring without any major modifications to the machine.


Power connects on the top left





Phase 9:  Staying on the Level

The first thing that needs to be done once the Electronic Tilt is installed, is to fine tune the levelling of the device.  This is really no different than ensuring a mechanical tilt plumb bob is centered within the bracket however, instead of a physical adjustment, we do an electronic one.















By clicking on the green buttons, we can bring the values of the X and Y axis as close to zero as possible in real time.  We can also adjust the Z axis to bring as close to +/- 1.0000 as possible.

The values are immediately saved in non-volatile memory allowing them to be loaded the next time the machine powers up.  In addition to saving the values in non-volatile memory, I've also included the option to backup/restore the offsets to the internal file system.


Phase 10:  To Tilt Or Not To Tilt.  That Is The Question.

A mechanical tilt bob is electrically equivalent to a switch which opens and closes so an electronic version should act in a similar fashion.  I could have used an electro-mechanical relay which physically opens and closes, but anything mechanical is subject to wear.  Instead, I chose to do this electronically.  As such, my first test was to verify I could trigger the tilt in the machine.  Instead of shaking the machine to cause a tilt, I included a test button to manually trigger the tilt ... much easier.

In order to understand how a pinball machine detects a tilt condition, I need to introduce you to the TILT HOLD setting.  In other words, how long is the tilt switch closed for.  Every pinball machine has a switch matrix which scans (polls) through rows and columns to check the state of the switches attached to it.  This happens continuously but requires a certain amount of time in order to read the state correctly.  Based on my research, 10 ms was a good starting point ... and based on my initial testing, this number appears to be correct.  I could set it to a higher number (seconds vs milliseconds), but this could have the potential to cause issues with tilt warnings being detected multiple times as the switch polling period repeated.


Phase 11:  Zen and the Art of Tuning an eTilt

Accurately simulating the movement of a mechanical tilt bob requires us to first understand the characteristics of its movement.  Newton's Laws of Motion cover the majority of this topic and since they are basic scientific principles, I'll spare you the details.  These are controlled by the following user settable variables:  BOB DIAMETER, PLATE DISTANCE, HOLE DIAMETER and CENTER OF MASS.


The remaining characteristics of movement involve friction.  The video link (~3:05) shows what we need to accomplish.

https://youtu.be/E4ZZT2nvgkg?t=182

In the video, the fore/aft movement came to a rest after about 7 cycles while the right/left movement took around 42.  With that in mind, let me introduce you to X DECAY and Y DECAY.  These parameters affect the settling time of the tilt bob.  I'm using a bit of reverse logic in my calculations so a value of 1.000000 is no decay/friction while a value of 0 represents full friction.  I've allowed 6 digits of precision in these variables, so really fine tuning is possible.

Numerous decay values were tested in order to achieve the 7/42 swings of the tilt and my visual representation of the tilt plumb bob was an excellent means of observing this.  From these tests, I came up with a starting value of 0.999 for the X axis and 0.996 for the Y axis.  I like to point out that my eyes sometimes confused the sixes and nines so I ended up using 0.999001 and 0.995999 respectively ... not only did this prevent my misreading of the values, but it also served as a reminder that I have 6 digits of precision instead of 3.

EDIT:  It was difficult trying to bump the table consistently after making minor changes to the decay values.  Sometimes I hit harder than I did previously and so my results were inconsistent.  The latest firmware revision now has test buttons to start the tilt at its maximum.






Phase 12:  Do the Shake

Somebody was asking me for video of the Electronic Tilt in action.  Here's a short clip of what happens when you shake the machine.




I'm happy to say that the device has performed as expected.  The individual tuning parameters (ie DECAY, DIAMETER, etc.) could be played with a little more to help zero in on the "ideal" settings, but that brings up to the question of 'What are the ideal settings?'  This is where I'd like to see one of of my devices in the hands of the players ... both real and virtual pinball players since there is an application in both markets.  That way, a consensus can be made on standard settings for home and tournament use.


To be continued ...

Friday, May 18, 2018

Introducing: Electronic Tilt Bob for Pinball Machines - Part I

Some time around 2003 I came up with the idea of using an accelerometer to simulate a pinball tilt plumb bob.  I had been working with gyroscopes and accelerometers since 1993 and it seemed like a good crossover to my hobby of pinball.  I recall my biggest challenge at the time was creating a simple user interface to customize the internal settings ... a task that would require adding a whole new layer of interface electronics such as a display and keypad.  After researching a few microcontrollers I had a basic design, but unfortunately I lacked the will to complete the project due to other commitments.

Fast forward to 2012 and the birth of the Raspberry Pi.  MEMs devices have become mainstream and I decided to revisit my Tilt Simulator project and learn Python while I'm at it.  The simulation worked ok.  And by ok, I mean it worked but it really didn't work entirely as anticipated.  Python is not the language for anything in real time and the Raspberry Pi is not the ideal substitute for a microcontroller.  Proof of concept was achieved, but the burden of requiring ancillary equipment once again put my idea on hold ... I called this prototype #2 and relegated it back on the shelf where it belonged.

Fast forward again to 2015 and I find out about a microcontroller called the ESP8266.  This device had built in WiFi and that combined with a smartphone, solved all my interface challenges.  It was then I realized that the Tilt Bob Simulator was once again a viable concept.


Phase 1:  The New Plan

Basic System
- A device which accurately mimics the movement of a pinball tilt plumb bob
- Usable in both Electro Mechanical (EM) & Solid State (SS) pinball machines
- Usable in Virtual pinball machines
- Length, size, distance, diameter, etc. in the simulation must be user customizable
- Independent decay rates (ie friction) in both X & Y axis to mimic a mechanical setup
- Accelerometer 6 point calibration to get consistent data output across multiple machines (ie tournaments)
- Mountable in any one of the 6 major axis and self aware of its orientation
- Offset tuning to correct for minor alignment errors
- WiFi connection via Access Point and Station
- mDNS support for ease of access
- Tuning/setup done via web and/or MQTT server
- Utilize power already available in the machine (5V~12V DC)

Additional Considerations
- Variable tilt hold time to accommodate for different switch matrix read times
- Tilt warnings.  So older machines can act like new ones.
- A second 'Simple Force' simulation to emulate modern systems
- Setable force threshold
- A visual indication of current force or tilt bob position

Crazy Ideas
- variable gravity (have you ever played pinball on the moon?)

UPDATE:  All features implemented except variable gravity


Phase 2:  The Test Circuits

Prototype #3 and Prototype #4

The plastic box was originally the packaging from an Intel camera however, it was the perfect solution for performing a six point calibration.


Phase 3:  The Software

I remember the days when I used to code in Assembler and wondered why you'd ever code in anything else ... Those days are now gone but not forgotten.  Coding languages may have changed but methodologies do not.  I won't go into details on how a PID control loop works or the mechanics of how to calculate the current position of the tilt bob.  I have no intention of teaching you Calculus, Physics, Electronics or Software Programming.  Just be confident in the knowledge that I've been curious about all of them at one point of time in my life.

I held off learning javascript for the longest time and finally 'bit the bullet' for this project.  It was very easy to pick up however the whole time I couldn't help but think that someone slapped this language together and said 'good enough'.  Anyways, I shouldn't complain ... it talked XML to me and made communications much simpler to implement.



Phase 4:  The Web Interface


General Setup




Fine Tuning and Levelling




Classic (Tilt Bob) Tuning




Modern (Simple Force) Tuning




Phase 5:  The Supporting Cast

Bally PLAYBOY
Here's the perfect candidate ... well, yes and no or yes.

Pros:
Has damaged tilt mechanism so it needs replacing anyways.  A few bulbs may have come loose but it is otherwise functional.

Cons (or Pros in disguise):
Display buzz ... you know the sound, it's common for machines of this era.  Despite the potential doom and gloom, it's secretly a 'pro' since it helps test the robustness of taking power from the machine.


Phase 6:   Time To Get Serious


I had to use a hot air gun to solder some parts.  Since the soldering was successful, you could technically say that I'm good at blowing hot air 😏


Installation is next, but it's a long weekend in my part of the world so hold tight for a couple days.

To Be Continued ... 

Monday, December 2, 2013

Legal Disclaimer

All postings that follow remain the property of Jeff Petro and may not be reprinted or used without exclusively granted permission in writing.

Permission is granted for limited use under Creative Commons License.  Credit MUST be given and a link to the blog referenced MUST be provided.

Permission is granted to blogger.com to use portions of my blogs for promotional purposes of the website blogger.com.

Any further changes to terms of use not accompanied by my written signature of acknowledgement shall be deemed invalid and unenforceable.