Jump to: navigation, search

Difference between revisions of "Controlling Flippers"

(Software: Add links to MPF documentation)
(Dual-wound Flipper Coils (WPC-style))
Line 12: Line 12:
 
=== Dual-wound Flipper Coils (WPC-style) ===
 
=== Dual-wound Flipper Coils (WPC-style) ===
  
Dual-wound coils are essentially two coils in one, for each flipper.  One winding is called 'power', and the other is called 'hold'.  That's why the coils have 3 terminals.  One terminal is a common terminal that brings in power from the driver board.  The other two terminals get connected to 2 of the 8 transistor circuits so they can be controlled by the P-ROC.  Controlling two dual-wound flipper assemblies will therefore use 4 of the transistor circuits on one bank of a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16].   
+
Dual-wound coils are essentially two coils in one, for each flipper.  One winding is called 'power', and the other is called 'hold'.  That's why the coils have 3 terminals.  One terminal is a common terminal that brings in power from the driver board.  The other two terminals get connected to 2 of the 8 transistor circuits so they can be controlled by the P-ROC.  Controlling two dual-wound flipper assemblies will, therefore, use 4 of the transistor circuits on one bank of a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16].   
  
 
The power winding is used to pulse the coil, which is when the flipper flips.  That winding should measure about 4 ohms on a resistance meter.
 
The power winding is used to pulse the coil, which is when the flipper flips.  That winding should measure about 4 ohms on a resistance meter.
Line 23: Line 23:
 
<center>[[Image: WPC_coil.jpg]]</center>
 
<center>[[Image: WPC_coil.jpg]]</center>
  
 +
Note - The common lug on your dual wound coil may be different from the picture above. The common lug is denoted by two wires being connected to it. The remaining two lugs are then checked for resistance as explained above to determine the primary and hold wirings)
  
Note - Flipper assemblies with dual wound coils typically include and end-of-stroke (EOS) switch.  Before flippers were controlled programmatically, the EOS switch was used to switch power from the power coil to the hold coil.  With programmatically controlled flippers, the EOS switch is no longer necessary.  Software controls each coil individually and can therefore shut off the power coil whenever necessary.  Therefore, the EOS switch doesn't even need to be wired to the P-ROC.
+
Also, note - Flipper assemblies with dual wound coils typically include and end-of-stroke (EOS) switch.  Before flippers were controlled programmatically, the EOS switch was used to switch power from the power coil to the hold coil.  With programmatically controlled flippers, the EOS switch is no longer necessary.  Software controls each coil individually and can, therefore, shut off the power coil whenever necessary.  Therefore, the EOS switch doesn't even need to be wired to the P-ROC.
  
 
=== Single-wound Flipper Coils (Stern-style) ===
 
=== Single-wound Flipper Coils (Stern-style) ===

Revision as of 23:09, 12 February 2019

Hardware

The usual way to control flipper coils is to connect power (typically a relatively high DC voltage like 70V) to one side of the coil and to connect the other side to a low-side transistor circuit, such as an n-channel MOSFET. When the transistor is activated, the source voltage has a path to ground through the coil and through the transistor, thereby activating the coil.

Another way to hook up the flipper coils is to connect them to power through flipper buttons and use end-of-stroke switches to to govern how current flows through dual-wound coils. This is how 70V flipper circuits were implemented before the early 90's. If this is how you want to proceed, you don't need a P-ROC or a PD-16 for your flipper circuits. You can refer to an early WPC (pre-fliptronics) machine manual for wiring diagrams showing this implementation.

The rest of this page describes how flipper circuits have been implemented since the early 90's and how you could do the same with a P-ROC and PD-16, using software controlled (or P-ROC controlled) transistors to activate the flippers when button presses are detected on the appropriate P-ROC switch inputs. Implemented flippers this way affords the designer a lot more control. Because the transistors are controlled programmatically, it is very easy to increase or decrease the flip strength by simply varying the pulse times. A creative designer could even implement modes in their game that intentionally make the flippers weaker or stronger. Other reasons to control flippers programmatically are to have the flexibility to deactivate them at times, enable only one at a time, reverse the button/flipper relationship, only allow them to be held on for specific lengths of time, etc, etc. One other important advantage is that the flipper buttons can be used while the flippers are deactivated (for video modes, entering high score initials, etc).

Flipper coils, like most individual features on a pinball machine, can be controlled with a PD-16 board. It's best to connect the power side of the coil to the fused power output connector on the PD-16. This will cause only the PD-16's fuse to blow if there's ever a serious problem with the coil circuit, rather than taking out various other things on the machine. The other side of the coil is then connected to one of the eight transistor circuits the PD-16 provides in each bank.


Dual-wound Flipper Coils (WPC-style)

Dual-wound coils are essentially two coils in one, for each flipper. One winding is called 'power', and the other is called 'hold'. That's why the coils have 3 terminals. One terminal is a common terminal that brings in power from the driver board. The other two terminals get connected to 2 of the 8 transistor circuits so they can be controlled by the P-ROC. Controlling two dual-wound flipper assemblies will, therefore, use 4 of the transistor circuits on one bank of a PD-16.

The power winding is used to pulse the coil, which is when the flipper flips. That winding should measure about 4 ohms on a resistance meter.

The hold winding is used to hold the coil up after flipping. It can keep the coil active indefinitely, and it only draws about 0.5A because it's about 127 Ohms.

OK... now on to the actual wiring. Refer picture below. The center terminal is the power winding. It should be wired back to one of the transistor circuits. You can use a resistance meter to figure out the other two terminals. Put one probe on the center terminal and the other on one of the others. If it reads about 4 ohms, you've found the common terminal that you'll connect to the PD-16's power output (J3 or J4 depending on the back you're using). If it reads 131 ohms or so, you've found the 'hold' winding terminal, which also goes to a transistor circuit.


WPC coil.jpg

Note - The common lug on your dual wound coil may be different from the picture above. The common lug is denoted by two wires being connected to it. The remaining two lugs are then checked for resistance as explained above to determine the primary and hold wirings)

Also, note - Flipper assemblies with dual wound coils typically include and end-of-stroke (EOS) switch. Before flippers were controlled programmatically, the EOS switch was used to switch power from the power coil to the hold coil. With programmatically controlled flippers, the EOS switch is no longer necessary. Software controls each coil individually and can, therefore, shut off the power coil whenever necessary. Therefore, the EOS switch doesn't even need to be wired to the P-ROC.

Single-wound Flipper Coils (Stern-style)

Single-wound flipper coils are much simpler than dual-wound coils, at least electrically, because they have only two terminals. One terminal is connected directly to the power source (power output from a PD-16). The other terminal gets connected to one of the transistor circuits so it can be controlled by the P-ROC. Controlling two single-wound flipper assemblies will therefore use only 2 of the transistor circuits on one bank of a PD-16.

The single-wound coil is a high power coil. It draws a lot of current so that the flipper will have enough power to flip the ball. If the coil remains active for longer than a short pulse, though, it will blow the fuse on the PD-16. Otherwise it would destroy either the PD-16's transistor or the coil itself, maybe even both. To keep this from happening, games with single-wound coils use software (or a P-ROC) to activate the coil for a long flip pulse (30 milliseconds or so) and immediately follow that with short pulses (maybe 2 milliseconds every 20 milliseconds) to keep the flipper active until the flipper button is released.

Important: If your coil has a diode on it, you must wire power to the bar end of the diode and the desired transistor circuit to the non-bar end.

Software

Mission Pinball Framework

To configure your flippers in the Mission Pinball Framework (MPF) you should follow tutorial step 3. For single wound modern flippers have a look at the single wound flipper documentation. If you are using a WPC machine more information about fliptronics can be found in the WPC Howto. Advanced topics, fine tuning and special configurations are covered in the flipper device documentation.

P-ROC

Switch Rules

When using a P-ROC with the PD-16 to control flippers, the best thing to do is configure P-ROC switch rules. Doing this will configure the P-ROC to automatically drive the flippers appropriately when the flipper buttons are pressed. This is better than trying to activate the flippers programmatically in response to button presses because it eliminates the latency of the switch event getting to software and the coil activation request getting back to the P-ROC.

Whether you're using libpinproc (C) or pyprocgame (Python), your machine's YAML file will need to contain flipper definitions so the software will know which switches to link to link to which coils. Here's an example YAML with only the relevant flipper items:

   PRGame:
       machineType: custom
   PRFlippers:
       - flipperLwR
       - flipperLwL
   PRSwitches:
       flipperLwR:
           number: P-ROC input number for the Lower Right flipper button
       flipperLwL:
           number: P-ROC input number for the Lower Left flipper button
   PRCoils:
       flipperLwRMain:
           number: PD-16 circuit number for the LwR main flipper
       flipperLwRHold:
           number: PD-16 circuit number for the LwR hold flipper - if using dual-wound coils.  If not, delete this Hold entry
       flipperLwLMain:
           number: PD-16 circuit number for the LwL main flipper
       flipperLwLHold:
           number: PD-16 circuit number for the LwL hold flipper - if using dual-wound coils.  If not, delete this Hold entry
Configuring the P-ROC

You'll need to configure the P-ROC to work with your chain of driver boards. If you're using libpinproc (C) or pyprocgame (Python), instructions for doing this are found here.

libpinproc

For setting up the switch rules, see ConfigureWPCFlipperSwitchRule() (for dual-wound coils) and ConfigureSternFlipperSwitchRule() (for single-wound coils) in the libpinproc pinproctest example code.

pyprocgame

For setting up the switch rules, refer to the code that already does this for WPC and Stern flippers in pyprocgame. It's done in the enable_flippers() method of the GameController class in game.py. Use the WPC method for dual-wound coils and the Stern method for single-wound coils.

Software Control

If you're dead-set on activating the flippers in your software instead of using P-ROC switch rules, you can do this easily enough.

Software control using P-ROC functions

If you've configured the P-ROC to control your chain of driver boards, you can simply issue the appropriate pulse or patter commands when the appropriate switch events occur.

Dual-wound (WPC-style) Flippers

For software control of dual-wound WPC-style flippers, it's recommended to issue both a pulse command (30ms or so) to the power coil and an indefinite pulse (0ms) to the hold coil when the flipper button is pushed. Then deactivate both coils when the flipper button is released.

Single-wound (Stern-style) Flippers

For single-wound Stern-style flippers, it's recommend to issue a patter command when the flipper button is pushed. Use an on/off cycle time of about 2ms/18ms, respectively, and give it an original_on_time of 30 ms or so for the initial flip. Then deactivate the coil when the flipper button is released.

Software control without using P-ROC functions

If you'd rather use software to write to the driver board directly, which is possible though eliminates the possibility of using the pulse, schedule, patter, etc functions the P-ROC provides, you can issue direct register writes to the P-ROC that, in turn, get sent to the appropriate driver board. Refer to the P-ROC FPGA documentation for more details.

Other controller (non - P-ROC)

If you're using a microcontroller such as an Arduino or Parallax Propeller to control your flippers through a PD-16, you'll need to do everything in software. Refer to the PD-16 documentation for a description of the PDB Protocol used for sending commands to the driver board.