Monthly Archives: March 2014

Update 3/27/2014, Mostly Python

Finished the conversion of prototype code to the real code.  Wow, it looks much better at this point.  Fixed the organization of the code and much better design.  (Actually the design didn’t change, just the implementation).

Moved from 80s code development into the 2000s.  When the original stuff was written, it was tested by what used to be called printf debugging.  Since my background in Python was basically writing regression tests for scientific/telecomm gear, it worked well enough.  Python was used as a replacement for Expect.  (Doubt if anybody remembers Expect anymore, but once it ruled the serial communication world).  Well, writing python as you would expect really doesn’t do justice to python as a language.  This past week the time was taken to re-organize the code to better match pythonology.  (Yeah, that is a made up word).

Took the time to download PyDev as an IDE.  What a breath of fresh air, as opposed to using print statements to debug.  It took about 15 or 30 minutes to add it to Eclipse and get the project pulled into it.  In the next hour, the code was being improved by leaps and bounds.  Background compiling to look for issues, auto code completion, easy project searches, the features just go on and on.  PyDev has helped progress immensely.

What’s up next?  The screen outputs are done in PyGame, and the debug interface will be in TKinter.  Both exist natively on the Pi.  (Took a while to get both programs to play nice with each other since both of them wanted to own the main loop thread.)  Luckily the TKinter stuff is going to just be a debug interface to help people test their rules.  Next big update will include the debug stuff.

If anyone was foolish enough to grab previous versions of the OPP Pinball Frameword, I would suggest grabbing the latest version.  It is significantly better and has more features.

Update on 3/1/2014

I try to keep most of the stuff in the blog purely technical, but I have little to add technically.  Late winter blues have set in and things have gotten really busy at work.  There was a project that was not going to be delivered on time or meeting the features, and it finally got delivered on Friday on time and budget.  It meant a lot of hours to get it back on track, but now it is done.

Why does this matter to the pinball community?  Simple, they gave me a small thanks bonus which I’m going to use some of it to start buying parts for my CNC router.  I think that the Solsylva 25×25 should meet the needs perfectly.  While it only cuts in a 25×25 areas there are no stops on the y axis, so it should be pretty simple to move the playfield to two different positions to cut the whole length of the playfield.  I’ve been researching CNC routers for about six months or maybe a year, and it seems to match my needs pretty closely.  It is meant to be built from standard parts that you can get at a hardware store.  (That of course doesn’t include the stepper motors, drivers, etc).  The tolerance is reported to be about +/- .003 inches (about the thickness of 2 pieces of paper) which should be good enough for what I need.

Besides that, I’ve mostly been futzing around.  The basement is really too cold to do a lot of work, and since my job was so busy, most of my free time was eaten up there.  I built up a bunch of new boards so that I could finish Camelot, but I have not tried them yet.  They are soldered, but no testing.  I need a 60 cent part from Mouser and I don’t want to pay the shipping.  Grrrrrr.  I ended up buying the parts from Sparkfun since the price per part was cheaper, and the shipping was slightly less.

A few last ideas that are worth exploring down the road.  First one is using a screw drive to open and close the outlanes automatically.  It would involve moving the outline post to make the pinball easier or more difficult during a game.  Right now, in all the games the I know of, outlane posts are in a single position during a game.  Allowing the post to move would allow a game to become more difficult the longer it is played, or a player could be handicapped to make two people of different abilities to “challenge” each other.  Another thing that would be cool is that a route game could be set up as relatively easy.  As players get better (i.e. play longer), the game slowly makes the game tougher and tougher.  Kind of like a progression in replay scores.  Another option is when the game is started to start the scoring at higher values, but the outlanes are more open.  When people play a routed game, if the ball drains very quickly, there is little reason to put more money into the machine.  They feel somewhat cheated.  If the game is set up too easily, the operator doesn’t make money because too many free games are won.  Changing the outlane post position might address both of these issues programmatically.

Second idea is going to be incorporated into Disaster.  That is the Sharpe Attack mode (pun intended).  (Disaster and sharks, what is better than that, maybe a Sharknado?).  The Sharpe Attack is simply getting rid of the hold on the flippers.  Since all of the solenoids are controlled by PWMs, it is very easy to make them stronger, weaker, or even get rid of a part of the cycle and make it so the flippers can’t hold.  The name comes from the fact that if you watch a video of Josh Sharpe playing, (or really any good pinball player), they cradle the ball all the time.  It allows more control over the ball because it is starting at a known velocity, and makes the shots much more repeatable.  During Sharpe Attack, no cradling would be possible because the flipper hold would be set to off (or 0 ms in the config).  That would significantly change the dynamics of a game for a brief time period.

There is another pinball machine idea which I’m working, which will involve a reducing the flipper power during certain modes.  (basically a dreamy, or druggy mode)  Power and strength of any driven signal is easy to control since it is just a PWM and the duty cycle can be altered.