What's new
Pinball info

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

In Progress Mishmash self build - let’s make a pinball machine

OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
Spent several hours today working on the code, making sure it's well documented, and all in the right place, started building it into the basic PinBall Operting System framework that I started back in July. Im not sure I have got the framework right - it's a first stab, and I'm sure it will change as we go along.
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
Busy day on this today. I did some more programming, lots and lots to do there. So to break up the day I decided to strip all the existing lamp holders out of the playfield
A1A22197-977F-4B9B-A0E5-AC9BA6705A0B.jpeg
playfield easy to work on now with my new rotisserie

ED002B04-7188-4400-AD73-9B34808FD31F.jpeg
stripping out the lamp sockets

AB9ADC70-4A94-4BB9-92C4-03FBA2EF0E77.jpeg
there are over 100 to do

E2CDFC8B-541A-48C2-8D22-B8BED03DDA90.jpeg
4BA86F2C-2AB3-4692-A805-B2444B665FAD.jpeg
I decided to remove all the lamp wiring from the loom too.

29F0BCFB-ABAF-4F49-A5BD-3DB7B6352AEA.jpeg
Tons of meters of wire.

B6FB2316-7D29-486B-B77A-A3B8CC624157.jpeg
Made a start putting in the addressable leds. got about 1/2 way.
 

Ashbo

Site Supporter
Joined
Apr 9, 2021
Messages
367
Location
Lincolnshire
Alias
Ash
Busy day on this today. I did some more programming, lots and lots to do there. So to break up the day I decided to strip all the existing lamp holders out of the playfield
View attachment 149816
playfield easy to work on now with my new rotisserie

View attachment 149817
stripping out the lamp sockets

View attachment 149818
there are over 100 to do

View attachment 149819
View attachment 149820
I decided to remove all the lamp wiring from the loom too.

View attachment 149821
Tons of meters of wire.

View attachment 149822
Made a start putting in the addressable leds. got about 1/2 way.
How much current are you expecting the addressable LEDs to pull? Are you running them from their own supply with a fuse on the ground wires? I learnt this the hard way building a virtual pin, touching grounds when I was messing about resulted in melting the wires. Sorted through proper solder rather than croc clips, and insulating around exposed wires, but ended up adding fuses to be sure. Lifing playfield up and down a lot, wires move....
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
20ma per led, approx 100in a string. RGB each led so 3 leds in each unit = 20/1000 X 100 X 3 = 6A - I will be adding another power supply just to make sure.
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
All the leds installed. tested and working with a simple led light test script. Tomorrow i’ll add some led light support into my main project.

I’ve come up with a name for my code. CEPOS - Cheap Easy Pinball Operating System.
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
Over 400 the day I tested and melted...24A :)
The key is not to run the leds at full brightness and totally white. that uses max power. I’ve got 2,500 leds on the ceiling of my pin room. if i switch all those on full bright white it will draw 150A 😂😂😂😂
 

Ashbo

Site Supporter
Joined
Apr 9, 2021
Messages
367
Location
Lincolnshire
Alias
Ash
The key is not to run the leds at full brightness and totally white. that uses max power. I’ve got 2,500 leds on the ceiling of my pin room. if i switch all those on full bright white it will draw 150A 😂😂😂😂
Yeah, that was me, just ran an auduino test program and smelled the smelled smell of failure. 🥵🧯🧯
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
Installing a string of addressable leds is ok, but there is quite a lot of work involved afterwards in addressing these. First we want to know what each led does on the playfield. some are GI lamps, most are “feature” lights, with a specific meaning. eg “shoot again”. 2X bonus, special , etc. so i have to figure out which led number in the string, is in which position. that then allows me to program up the game and switch the relevant feature leds on at the appropriate time.

In addition to this, i also want some led animations - an animation is where a group of leds or, even the whole playfield of leds, are controlled in sequence. All the example scripts you find generally just process the leds in led # order, but for a playfield this doesn’t work because we’ve wired the playfield up in any old random order, so the led number is meaningless. What has more meaning is the position of the led on the playfield, or another meaningful way is to group leds that are similar eg if there is a line of yellow arrow inserts you may want to light those in sequence. This means we need to hold positional coordinates for each led and also group leds together. It’s taken me a few hours to map out the coordinates of the leds on the playfield. i marked the playfield into 2.5cm squares and then figured out the X and Y co ordinates of each led. So now i can fairly easily program some light animations that run from side to side, top to bottom, diagonally, etc.

I’ve also coded in some test for the coil triggers and they seem to be firing off ok.

I need to test the coils themselves as i’m sure a couple are broken (i tested them a few months ago and remember some were not working)

I am now at the stage where I feel I can start on the actual game code. To start with I am going to aim to get a game going that has similar rules to the original game of the playfield. 8 ball champ. this makes sense to me as a first attempt because i don’t have to really do much thinking about the game rules, they are already designed and documented.
 

Judderman

Site Supporter
Joined
Mar 28, 2016
Messages
491
Location
Cheshire
Installing a string of addressable leds is ok, but there is quite a lot of work involved afterwards in addressing these. First we want to know what each led does on the playfield. some are GI lamps, most are “feature” lights, with a specific meaning. eg “shoot again”. 2X bonus, special , etc. so i have to figure out which led number in the string, is in which position. that then allows me to program up the game and switch the relevant feature leds on at the appropriate time.

In addition to this, i also want some led animations - an animation is where a group of leds or, even the whole playfield of leds, are controlled in sequence. All the example scripts you find generally just process the leds in led # order, but for a playfield this doesn’t work because we’ve wired the playfield up in any old random order, so the led number is meaningless. What has more meaning is the position of the led on the playfield, or another meaningful way is to group leds that are similar eg if there is a line of yellow arrow inserts you may want to light those in sequence. This means we need to hold positional coordinates for each led and also group leds together. It’s taken me a few hours to map out the coordinates of the leds on the playfield. i marked the playfield into 2.5cm squares and then figured out the X and Y co ordinates of each led. So now i can fairly easily program some light animations that run from side to side, top to bottom, diagonally, etc.

I’ve also coded in some test for the coil triggers and they seem to be firing off ok.

I need to test the coils themselves as i’m sure a couple are broken (i tested them a few months ago and remember some were not working)

I am now at the stage where I feel I can start on the actual game code. To start with I am going to aim to get a game going that has similar rules to the original game of the playfield. 8 ball champ. this makes sense to me as a first attempt because i don’t have to really do much thinking about the game rules, they are already designed and documented.
I'd want to write a UI - fire each light in sequence, then assign it a name, add it to a group (or groups) with an ordering within a group, then base any animations on the groups/lamp names That removes the XY coordinate reliance (unless you actually need it for some other reason).
 

Jay Walker

Registered
Joined
Apr 19, 2013
Messages
1,469
Location
Swansea, U.K.
I see the playfield has the older Bally (pre linear) flipper assemblies. I suppose either Bally found some old stock, or someone liked this game (or disliked the linear type) enough to change them over.
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
Yes, good Spot there David. I have tested the coils today, one of the flipper coils is burned out, so found a spare and installed that.
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
Whilst testing the coils i found one of the drop targets doesn’t reset. it’s mechanically bashed and bent and rusted up, so took it apart. hammered the bent bits and the rust bits are in for a rustaway soak overnight.
301C7DE4-B2F0-472E-A7BB-86BC937DEFC1.jpeg
The drop targets are not easy to get out as the white stand up target attached doesn’t seem to want to drop through the hole in the playfield so i had to unscrew that first. bad design.

All coils working properly now, new flipper end stops as they were totally knackered on the main flippers. the flippers need rebuilding, but that’s for later in this project……
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
I’ve got wires all over my prototype and these need a better way to connect up, so i knocked up a connector distribution board and a power +5v and ground distribution points

I can then plug all the playfield plugs into this one board only
50BAD927-971C-42FA-A815-98E334BCAC2C.jpeg
 

Judderman

Site Supporter
Joined
Mar 28, 2016
Messages
491
Location
Cheshire
yes i need the XY cords so i can do “sweeps” of the whole playfield.
Fair enuff - I suppose the 2 systems could work in parallel, a mathematical version to select the bulbs to turn on/off based on a function for vertical/horizontal/radial/fan sweeps, and another to display a manually crafted pattern - the X/Y coords could be entered via the UI. You'd still need to do the measuring, but it would avoid manually changing config files manually.
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
i’ve got a UI that does exactly that - i used it to create the 24 illuminated playfields that are on my pinroom ceiling. they are all running the same software, just the position of the leds for each one is different and held in a config file. it took hours to enter all the coordinates for 2500 leds in total 😂😂😂. However for this project it’s easier to just type it into the code as a config setup
 

Judderman

Site Supporter
Joined
Mar 28, 2016
Messages
491
Location
Cheshire
i’ve got a UI that does exactly that - i used it to create the 24 illuminated playfields that are on my pinroom ceiling. they are all running the same software, just the position of the leds for each one is different and held in a config file. it took hours to enter all the coordinates for 2500 leds in total 😂😂😂. However for this project it’s easier to just type it into the code as a config setup
Only one word - Ouch! ;)
 
OP
AlanJ

AlanJ

Site Supporter
Joined
Dec 27, 2017
Messages
4,340
Location
Leeds, West Yorkshire
Alias
Alan
A really L O N G and frustrating day of coding today. Its always a risk when you try to merge in various bits of software together, and even worse when you merge it all into something that you haven't fully properly designed yet. I've transplanted a load of stuff from other projects into this one, and then tried to sort it all out. I hate going off to bed or the night when I'm 1/2 way through something like this, but I've run out of steam today, but have made progress. I've got switches illuminating lights and also running 'light show animations' if required. An animation may run for a few seconds, so it's important that the system doesn't stop reading the switch matrix whilst a lighting animation display is in progress, so I've had to devise a way to handle that. I've got about 25 different led pattern animations that I can use, so I'm going to have to review them all and see what ones work in a game, and which ones don't, then figure out how to run these non exclusively so as to free up the processor to do other game related stuff whilst the animations are running - some will be easy to sort, others nigh on impossible I guess. I also need to write dedicated ones to do things with groups of lights, e.g. GI control to change its colour, brightness etc. I could spend a lifetime just on different lighting effects, so need to be pragmatic and get a few going, then add to it at a later date once I have a working game.

As a bit of light relief I put back together the de-rusted and cleaned drop target - now works perfectly.

Had a problem with my power supply, somehow giving out 7 volts at one bit and blew the first led in the ws2812b string - so had to remove that and solder in a new one. changed the power supply too! Those addressable LED's don't like much more than 5v.
 

Ashbo

Site Supporter
Joined
Apr 9, 2021
Messages
367
Location
Lincolnshire
Alias
Ash
A really L O N G and frustrating day of coding today. Its always a risk when you try to merge in various bits of software together, and even worse when you merge it all into something that you haven't fully properly designed yet. I've transplanted a load of stuff from other projects into this one, and then tried to sort it all out. I hate going off to bed or the night when I'm 1/2 way through something like this, but I've run out of steam today, but have made progress. I've got switches illuminating lights and also running 'light show animations' if required. An animation may run for a few seconds, so it's important that the system doesn't stop reading the switch matrix whilst a lighting animation display is in progress, so I've had to devise a way to handle that. I've got about 25 different led pattern animations that I can use, so I'm going to have to review them all and see what ones work in a game, and which ones don't, then figure out how to run these non exclusively so as to free up the processor to do other game related stuff whilst the animations are running - some will be easy to sort, others nigh on impossible I guess. I also need to write dedicated ones to do things with groups of lights, e.g. GI control to change its colour, brightness etc. I could spend a lifetime just on different lighting effects, so need to be pragmatic and get a few going, then add to it at a later date once I have a working game.

As a bit of light relief I put back together the de-rusted and cleaned drop target - now works perfectly.

Had a problem with my power supply, somehow giving out 7 volts at one bit and blew the first led in the ws2812b string - so had to remove that and solder in a new one. changed the power supply too! Those addressable LED's don't like much more than 5v.
Is it Python you are coding in? You'll need to get your light displays to trigger from an event, then set off the light display in a Thread. Threads can be a head screw, but will ultimately be your friend. Well worth the effort.

 

HomerRamone

Site Supporter
Joined
Mar 20, 2013
Messages
562
Location
Newcastle
Alias
HomerRamone
Is it Python you are coding in? You'll need to get your light displays to trigger from an event, then set off the light display in a Thread. Threads can be a head screw, but will ultimately be your friend. Well worth the effort.

Hes using C/C++. Dont think many of the arduinos have multi core CPUs

Need to split the logic into objects and have some tick functions to do the updating
 

Ashbo

Site Supporter
Joined
Apr 9, 2021
Messages
367
Location
Lincolnshire
Alias
Ash
Like a main loop that checks what's live and what's dormant and then progresses each function if needed? Not a c++ guy, more .net, but sounds like a nightmare.
Feels like the lights and the switches need to be in separate logic completely.
 

HomerRamone

Site Supporter
Joined
Mar 20, 2013
Messages
562
Location
Newcastle
Alias
HomerRamone
Yeah. That's certainly how I would approach it.
Have a sort of manager for switches, another for lamps and yet another for solenoids.
 

Fubar

Site Supporter
Joined
Feb 5, 2020
Messages
701
Location
Cambridge, UK
Alias
Thomas
Maybe you can get the DMA engine to do the heavy lifting for the lightshows? I believe that ws2812b can be driven from the SPI peripheral.

Re integration hell - the only way to avoid that pain is comprehensive automated unit and block-level testing... Usually takes more effort than the actual software though!
 
Top Bottom