PLC and Automation Store

Sunday, January 6, 2013

The design and build of a PLC controlled pinball machine

PSE Engineering Pinball
EGR 450 - Manufacturing Controls
Professor:  Hugh Jack, Ph.D
Spring/Summer 2002

1.0 Team Members:

Mark Essenburg
Vaughn McDaniel
Jeff Thompson
Joel VandenBrink

 

2.0 Project Description:

This project consisted of the design and build of a PLC controlled pinball machine.  The old pinball machine, Figure 1 and Figure 2, was torn down and parts were kept to help alleviate costs of the redesign.  The mechanical components of the pinball machine will be controlled by a PLC.  Switches will be installed to be used as inputs to the PLC, some of these will be used to add score and others will be used to help control the logistics of the game (i.e.  flippers, ball return, reset, etc.).

                        
Figure 1 - Old Pinball Machine                             Figure 2 - Old Pinball Machine Side View

3.0 Design Specifications:

The game has three states, as seen in figure 3.  In the game over state all outputs are disabled and the score is reset.  To leave the game over state and enter the play state the reset input is pushed.  Once in the play state all inputs and outputs are enabled until three balls have been played, it then returns to the game over state until reset is pushed again.  If tilt is triggered the tilt state is entered for 10 seconds, after which it returns to the play state.  While in the tilt state all outputs are disabled.

Figure 3 - State Diagram

4.0 Materials Used

Bottom-Side of Board

5 - 24 Vdc Spring Return Solenoids
4 - 24 Vdc Green Lights
1 - 24 Vdc Speaker
6 - 1.5K-ohm Resistors
5 - Micro-Switches

Top-Side of Board

2 - Micro-Switches
1 - 24 Vdc Spring Return Solenoid
2 - Flippers
3 - Mushroom Bumpers
2 - 1-Way Gates
4 - Targets
3 - Ring Contacts
2 - Rectangular Contacts
19 - Posts
3 - 24 Vdc Light Bulbs

Other Materials

1 - 24 Vdc Power Supply
1 - 5 Vdc Power Supply
4 - Terminal Strips
4 - Seven-Segment LED Displays
1 - 7448 BCD to 7-Segment IC
1 - 74138 Multiplexer

PLC Materials

1 - SLC-500 (1747-L30A)
1 - DC Sink Input (1746-IB16)
1 - DC Sink Output (1746-OV16)

5.0 Inputs and Outputs

Inputs                                             

I:1/0 - Reset Button                        
I:1/1 - "P" Rollover                         
I:1/2 - "S" Rollover
I:1/3 - "E" Rollover
I:1/4 - Bottom Triangle
I:1/5 - Tilt
I:1/6 - Mushroom Bumpers
I:1/7 - Drop Target 1
I:1/8 - Drop Target 2
I:1/9 - Extra Ball
I:1/10 - Ball Done

Outputs

O:0/0 - New Ball Solenoid
O:0/1 - "P" Light
O:0/2 - "S" Light
O:0/3 - "E" Light
O:0/6 - Mushroom/Paddle Power
O:0/9 - Extra Ball Solenoid
O:0/10 - Tilt Light
O:0/11 - Extra Ball Lock Light

6.0 Internal Memory Locations

Binary Memory

B3:0 - Scoreboard
B3:1 - Scoreboard
B3:2 - Constant "F"
B3:3 - Constant "BO"
B3:4 - Constant "AO"
B3:5 - Constant "FO"
B3:6 - Constant "AOO"
B3:7 - Constant "FOO"
B3:8 - Constant "BOO"
B3:9 - Constant "COO"
B3:10 - Constant "DOO"
B3:11 - Constant "EOO"
B3:12 - Constant "100"
B3:13 - Constant "200"
B3:14 - Constant "300"
B3:15 - Constant "400"
B3:16 - Constant "A"
B3:18 - Constant "B"
B3:20 - Constant "50"
B3:21 - Constant "100"
B3:22 - Constant "500"
B3:23 - Constant "1"
B3:24 - Constant "2"
B3:25 - Constant "0"
B3:30 - Score Bit
B3:31 - Score Bit
B3:32 - Score Bit
B3:40/0 - Game Over
B3:40/1 - Play
B3:40/2 - Tilt
B3:42 - "P" Memory
B3:43 - "S" Memory
B3:44 - "E" Memory
B3:45/0 - Extra Ball Lockout
B3:46/1 - "PSE" Set
B3:50/1 - One Scan Set Bit
B3:50/2 - One Scan Set Bit
B3:50/3 - One Scan Set Bit
B3:50/4 - One Scan Set Bit
B3:50/6 - One Scan Set Bit
B3:50/7 - One Scan Set Bit
B3:50/8 - One Scan Set Bit
B3:51/7 - One Scan Set Bit
B3:51/10 - One Scan Set Bit
B3:51/13 - One Scan Set Bit
B3:51/10 - One Scan Set Bit
B3:51/0 - T4:1 Control
B3:60 - Remote Score Location
B3:61 - Remote Score Location
B3:62 - Remote Score Location

7.0 Electrical Wiring Diagrams

   7.1 PLC Wiring Diagram

All of the wiring diagrams can be seen below.  Figure 4 is the DC Sinking Inputs, Figure 5 is the DC Sinking Outputs, Figure 6 is the 24 Vdc Relay Outputs, and Figure 7 is the complete wiring diagram.  The links below the figures are the actual AutoCAD2000 files.

        
            Figure 4 - DC Sinking Inputs

           

            Figure 5 - DC Sinking Outputs

            
            Figure 6 - Relay Outputs

            
            Figure 7 - Complete Wiring Diagram

        DC Sinking Inputs
        DC Sinking Outputs
        Relay Outputs
        Complete Wiring Diagram

   7.2 Scoreboard Wiring Diagram

      
          Figure 8 - Scoreboard Wiring Diagram

          Link to AutoCAD file

7.2.1 How the Scoreboard Works
The scoring mechanism is controlled by the DC sinking output card on the PLC.  The 7448 chip has 4 inputs, A, B,C, and D.  Each one of these is a BCD value with A being the least significant bit.  The chip then converts the BCD value into the appropriate number and outputs that number through 7 outputs on the chip.  These outputs are a-g and each output corresponds to a segment on the LED display.  The 74138 is the multiplexer chip that controls which of the eight LED digits to refresh.  The multiplexer has three inputs, A, B, C, where A is the least significant bit.  These three bits equate to a binary number which controls which LED digit to activate.  For example, if A, B, and C are all zeros the first LED digit will be active, if B and C are equal to zero and A is equal to 1 the second LED digit will be active and so forth.  Each scan of the ladder logic lights up one bit, therefore it takes eight scans of the ladder logic to go through all eight digits.  For the manuals on the chips see section 10.2.

7.2.2 How the Scoring Works
The total score for each pinball game is displayed on an 8-digit display.  Each digit requires 4 bits, where the BCD value of these bit combinations are the value of the number displayed on each digit.  Since a word is made up of only 16 bits, multiple memory locations were needed to keep scores.  Also, since bit memory is signed binary, numbers over 7FFF cannot be stored.  Therefore, the digits of the score were stored in the following locations (1 being the least significant).

                                    B3:32       _ _ _ _  _ _ _ _  _ _ _ _  _ _ _ _
                        Digit                                        3           2           1 
                                    B3:31       _ _ _ _  _ _ _ _  _ _ _ _  _ _ _ _ 
                        Digit                                        6           5           4 
                                    B3:30       _ _ _ _  _ _ _ _  _ _ _ _  _ _ _ _ 
                        Digit                                                      8           9

The scores used were 50, 100, 500, 1000, and 2000.  Since these values are in BCD instead of decimal, they do not add correctly, so the following codes and processes were implemented.  These methods also were used to make the 8 bytes in different memory locations act as one 8-digit score.

To add 50 points to 50 points:

          50 
         +50 
          A0

To fix this problem, the second bit is continuously checked with a masked compare statement.  The mask is F0, so that only the second bit is checked.  When this does equal an A, the bit is cleared, and 100 is added to the memory location.  The process is shown below.

          50 
       +50 
         A0
        00            move mask 0 to second bit 
      100            100 added to B3:32

The same  procedure was followed for all cases, which will be shown below, but explained in less detail.

        900 
     +100 
      A00 
       000            move mask 0 to third bit 
     1000            1 is added to 4th digit (B3:31)

        600 
     +500 
        B00 
         000            move mask 0 to third bit
         100            100 added to B3:32 
       1000            1 is added to 4th digit (B3:31)

        700 
     +500 
       B00 
       000            move mask 0 to third bit 
       200            200 added to B3:32 
      1000          1 is added to 4th digit (B3:31)

        800 
     +500 
      C00 
       000            move mask 0 to third bit 
       300            300 added to B3:32 
       1000          1 is added to 4th digit (B3:31)

                                                                    900 
                                                                +500 
                                                                  E00 
                                                                 000            move mask 0 to third bit 
                                                                 400            400 added to B3:32 
                                                                 1000          1 is added to 4th digit (B3:31)

        9000 
      +1000 
        A000 
        0000            move mask 0 to fourth bit 
      10000            10 is added to B3:31

        9000 
      +2000 
       B000 
        0000            move mask 0 to fourth bit
        1000            1 is added to B3:31 
     10000            10 is added to B3:31

 

The above calculations take care of all of the situations that could occur by directly adding score onto score from the inputs of the pinball machine.  The following cases occur from scores being accumulated in higher digits.

       90000
     +10000            (accumulated)
       A0000
       00000            move mask 0 to fifth bit
     100000            100 is added to B3:31

     900000
   +100000            (accumulated)
     A00000
      000000            move mask 0 to sixth bit
    1000000            1 is added to B3:30

   9000000
 +1000000            (accumulated)
   A000000
   0000000            move mask 0 to seventh bit
 10000000            10 is added to B3:30

 

8.0 Ladder Logic

The ladder logic was written in RS-Logix 500 English v4.50.00. 

Link to Ladder Logic File 

Below is the PDF version of the Ladder Logic

PDF Version

9.0 Rules and Scoring of the Game

1.  Hit the left and right face targets 2 times to lock the "Extra Ball" light
2.  Hit the "P", "S", and "E" lights to get bonus
3.  Point values are as follows:

        Triangles................................................50 points
        Mushrooms...........................................100 points
        "P" and "E" Rollovers...........................100 points
        "S" Rollover...........................................500 points
        Face Targets........................................500 points
        Extra Ball...............................................500 points
        Left and Right Targets hit 2x each......1000 points
        "P", "S" and "E".....................................2000 points
       Extra Ball and Extra Ball Light..............2000 points

4.  When tilted, outputs turn off, wait 10 seconds for next play 

10.0 Other Links

    10.1 Pictures

        Pictures of Old Pinball Machine

        Redesigned Pinball Machine Work In Progress Pictures

    10.2 Manuals

        PLC Manual
        Input and Output Card Manual
        7448 BCD to 7-Segment IC
        74138 Multiplexer IC

    10.3 Special Thanks

        A special thanks is extended to Mr. and Mrs. Essenburg for donating the old pinball machine.  To 
        Brandon Slater for helping us get the project done.  To the Padnos School of Engineering for the use of 
        a PLC.

               

No comments:

Post a Comment

We will publish you post once it has been approved. Thank you for posting.