https://pinballmakers.com/wiki/api.php?action=feedcontributions&user=Harto&feedformat=atomPinball Makers - User contributions [en]2024-03-29T01:34:55ZUser contributionsMediaWiki 1.27.1https://pinballmakers.com/wiki/index.php?title=Controlling_Flippers&diff=52430Controlling Flippers2019-02-12T23:43:17Z<p>Harto: /* Dual-wound Flipper Coils (WPC-style) */</p>
<hr />
<div>== Hardware == <br />
<br />
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.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] for your flipper circuits. You can refer to an early WPC (pre-fliptronics) machine manual for wiring diagrams showing this implementation.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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).<br />
<br />
Flipper coils, like most individual features on a pinball machine, can be controlled with a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] board. It's best to connect the power side of the coil to the fused power output connector on the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. This will cause only the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] provides in each bank.<br />
<br />
<br />
=== Dual-wound Flipper Coils (WPC-style) ===<br />
<br />
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]. <br />
<br />
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.<br />
<br />
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.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
<br />
<center>[[Image: WPC_coil.jpg]]</center><br />
<br />
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 windings. Your resistance readings may also be different. Generally speaking, 0 ohms would imply that your coil is dead (burnt out/broken winding), the same resistance across both windings would also imply a problem, but a lower resistance and a higher resistance respectively would indicate a good coil. See https://www.flippers.com/coil-resistance.html for a list of coils and their know resistance for cross-checking. <br />
<br />
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.<br />
<br />
=== Single-wound Flipper Coils (Stern-style) ===<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. <br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. Otherwise it would destroy either the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
'''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.<br />
<br />
== Software ==<br />
<br />
===Mission Pinball Framework ===<br />
To configure your flippers in the Mission Pinball Framework (MPF) you should follow [http://docs.missionpinball.org/en/stable/tutorial/3_get_flipping.html tutorial step 3]. For single wound modern flippers have a look at the [http://docs.missionpinball.org/en/stable/devices/flipper_config_single_wound.html single wound flipper documentation]. If you are using a WPC machine more information about fliptronics can be found in the [http://docs.missionpinball.org/en/stable/machines/wpc.html WPC Howto]. Advanced topics, fine tuning and special configurations are covered in the [http://docs.missionpinball.org/en/stable/devices/flipper.html flipper device documentation]. <br />
<br />
=== P-ROC ===<br />
<br />
==== Switch Rules ====<br />
<br />
When using a P-ROC with the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
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:<br />
<br />
PRGame:<br />
machineType: custom<br />
<br />
PRFlippers:<br />
- flipperLwR<br />
- flipperLwL<br />
<br />
PRSwitches:<br />
flipperLwR:<br />
number: P-ROC input number for the Lower Right flipper button<br />
flipperLwL:<br />
number: P-ROC input number for the Lower Left flipper button<br />
<br />
PRCoils:<br />
flipperLwRMain:<br />
number: PD-16 circuit number for the LwR main flipper<br />
flipperLwRHold:<br />
number: PD-16 circuit number for the LwR hold flipper - if using dual-wound coils. If not, delete this Hold entry<br />
flipperLwLMain:<br />
number: PD-16 circuit number for the LwL main flipper<br />
flipperLwLHold:<br />
number: PD-16 circuit number for the LwL hold flipper - if using dual-wound coils. If not, delete this Hold entry<br />
<br />
===== Configuring the P-ROC =====<br />
<br />
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 [[Configuring Driver Boards|found here]].<br />
<br />
===== libpinproc =====<br />
<br />
For setting up the switch rules, see ConfigureWPCFlipperSwitchRule() (for dual-wound coils) and ConfigureSternFlipperSwitchRule() (for single-wound coils) in the [https://github.com/preble/libpinproc/blob/master/examples/pinproctest/switches.cpp libpinproc pinproctest example code].<br />
<br />
===== pyprocgame =====<br />
<br />
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 [https://github.com/preble/pyprocgame/blob/master/procgame/game/game.py game.py]. Use the WPC method for dual-wound coils and the Stern method for single-wound coils.<br />
<br />
==== Software Control ====<br />
<br />
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. <br />
<br />
===== Software control using P-ROC functions =====<br />
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.<br />
<br />
====== Dual-wound (WPC-style) Flippers ======<br />
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.<br />
<br />
====== Single-wound (Stern-style) Flippers ======<br />
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.<br />
<br />
===== Software control without using P-ROC functions =====<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/p-roc/documentation P-ROC FPGA documentation] for more details.<br />
<br />
=== Other controller (non - P-ROC) ===<br />
<br />
If you're using a microcontroller such as an Arduino or Parallax Propeller to control your flippers through a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16], you'll need to do everything in software. Refer to the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] documentation for a description of the PDB Protocol used for sending commands to the driver board.</div>Hartohttps://pinballmakers.com/wiki/index.php?title=Controlling_Flippers&diff=52429Controlling Flippers2019-02-12T23:10:18Z<p>Harto: /* Dual-wound Flipper Coils (WPC-style) */</p>
<hr />
<div>== Hardware == <br />
<br />
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.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] for your flipper circuits. You can refer to an early WPC (pre-fliptronics) machine manual for wiring diagrams showing this implementation.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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).<br />
<br />
Flipper coils, like most individual features on a pinball machine, can be controlled with a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] board. It's best to connect the power side of the coil to the fused power output connector on the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. This will cause only the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] provides in each bank.<br />
<br />
<br />
=== Dual-wound Flipper Coils (WPC-style) ===<br />
<br />
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]. <br />
<br />
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.<br />
<br />
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.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
<br />
<center>[[Image: WPC_coil.jpg]]</center><br />
<br />
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<br />
<br />
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.<br />
<br />
=== Single-wound Flipper Coils (Stern-style) ===<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. <br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. Otherwise it would destroy either the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
'''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.<br />
<br />
== Software ==<br />
<br />
===Mission Pinball Framework ===<br />
To configure your flippers in the Mission Pinball Framework (MPF) you should follow [http://docs.missionpinball.org/en/stable/tutorial/3_get_flipping.html tutorial step 3]. For single wound modern flippers have a look at the [http://docs.missionpinball.org/en/stable/devices/flipper_config_single_wound.html single wound flipper documentation]. If you are using a WPC machine more information about fliptronics can be found in the [http://docs.missionpinball.org/en/stable/machines/wpc.html WPC Howto]. Advanced topics, fine tuning and special configurations are covered in the [http://docs.missionpinball.org/en/stable/devices/flipper.html flipper device documentation]. <br />
<br />
=== P-ROC ===<br />
<br />
==== Switch Rules ====<br />
<br />
When using a P-ROC with the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
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:<br />
<br />
PRGame:<br />
machineType: custom<br />
<br />
PRFlippers:<br />
- flipperLwR<br />
- flipperLwL<br />
<br />
PRSwitches:<br />
flipperLwR:<br />
number: P-ROC input number for the Lower Right flipper button<br />
flipperLwL:<br />
number: P-ROC input number for the Lower Left flipper button<br />
<br />
PRCoils:<br />
flipperLwRMain:<br />
number: PD-16 circuit number for the LwR main flipper<br />
flipperLwRHold:<br />
number: PD-16 circuit number for the LwR hold flipper - if using dual-wound coils. If not, delete this Hold entry<br />
flipperLwLMain:<br />
number: PD-16 circuit number for the LwL main flipper<br />
flipperLwLHold:<br />
number: PD-16 circuit number for the LwL hold flipper - if using dual-wound coils. If not, delete this Hold entry<br />
<br />
===== Configuring the P-ROC =====<br />
<br />
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 [[Configuring Driver Boards|found here]].<br />
<br />
===== libpinproc =====<br />
<br />
For setting up the switch rules, see ConfigureWPCFlipperSwitchRule() (for dual-wound coils) and ConfigureSternFlipperSwitchRule() (for single-wound coils) in the [https://github.com/preble/libpinproc/blob/master/examples/pinproctest/switches.cpp libpinproc pinproctest example code].<br />
<br />
===== pyprocgame =====<br />
<br />
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 [https://github.com/preble/pyprocgame/blob/master/procgame/game/game.py game.py]. Use the WPC method for dual-wound coils and the Stern method for single-wound coils.<br />
<br />
==== Software Control ====<br />
<br />
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. <br />
<br />
===== Software control using P-ROC functions =====<br />
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.<br />
<br />
====== Dual-wound (WPC-style) Flippers ======<br />
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.<br />
<br />
====== Single-wound (Stern-style) Flippers ======<br />
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.<br />
<br />
===== Software control without using P-ROC functions =====<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/p-roc/documentation P-ROC FPGA documentation] for more details.<br />
<br />
=== Other controller (non - P-ROC) ===<br />
<br />
If you're using a microcontroller such as an Arduino or Parallax Propeller to control your flippers through a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16], you'll need to do everything in software. Refer to the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] documentation for a description of the PDB Protocol used for sending commands to the driver board.</div>Hartohttps://pinballmakers.com/wiki/index.php?title=Controlling_Flippers&diff=52428Controlling Flippers2019-02-12T23:09:11Z<p>Harto: /* Dual-wound Flipper Coils (WPC-style) */</p>
<hr />
<div>== Hardware == <br />
<br />
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.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] for your flipper circuits. You can refer to an early WPC (pre-fliptronics) machine manual for wiring diagrams showing this implementation.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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).<br />
<br />
Flipper coils, like most individual features on a pinball machine, can be controlled with a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] board. It's best to connect the power side of the coil to the fused power output connector on the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. This will cause only the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] provides in each bank.<br />
<br />
<br />
=== Dual-wound Flipper Coils (WPC-style) ===<br />
<br />
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]. <br />
<br />
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.<br />
<br />
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.<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
<br />
<center>[[Image: WPC_coil.jpg]]</center><br />
<br />
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)<br />
<br />
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.<br />
<br />
=== Single-wound Flipper Coils (Stern-style) ===<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. <br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. Otherwise it would destroy either the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
'''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.<br />
<br />
== Software ==<br />
<br />
===Mission Pinball Framework ===<br />
To configure your flippers in the Mission Pinball Framework (MPF) you should follow [http://docs.missionpinball.org/en/stable/tutorial/3_get_flipping.html tutorial step 3]. For single wound modern flippers have a look at the [http://docs.missionpinball.org/en/stable/devices/flipper_config_single_wound.html single wound flipper documentation]. If you are using a WPC machine more information about fliptronics can be found in the [http://docs.missionpinball.org/en/stable/machines/wpc.html WPC Howto]. Advanced topics, fine tuning and special configurations are covered in the [http://docs.missionpinball.org/en/stable/devices/flipper.html flipper device documentation]. <br />
<br />
=== P-ROC ===<br />
<br />
==== Switch Rules ====<br />
<br />
When using a P-ROC with the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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.<br />
<br />
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:<br />
<br />
PRGame:<br />
machineType: custom<br />
<br />
PRFlippers:<br />
- flipperLwR<br />
- flipperLwL<br />
<br />
PRSwitches:<br />
flipperLwR:<br />
number: P-ROC input number for the Lower Right flipper button<br />
flipperLwL:<br />
number: P-ROC input number for the Lower Left flipper button<br />
<br />
PRCoils:<br />
flipperLwRMain:<br />
number: PD-16 circuit number for the LwR main flipper<br />
flipperLwRHold:<br />
number: PD-16 circuit number for the LwR hold flipper - if using dual-wound coils. If not, delete this Hold entry<br />
flipperLwLMain:<br />
number: PD-16 circuit number for the LwL main flipper<br />
flipperLwLHold:<br />
number: PD-16 circuit number for the LwL hold flipper - if using dual-wound coils. If not, delete this Hold entry<br />
<br />
===== Configuring the P-ROC =====<br />
<br />
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 [[Configuring Driver Boards|found here]].<br />
<br />
===== libpinproc =====<br />
<br />
For setting up the switch rules, see ConfigureWPCFlipperSwitchRule() (for dual-wound coils) and ConfigureSternFlipperSwitchRule() (for single-wound coils) in the [https://github.com/preble/libpinproc/blob/master/examples/pinproctest/switches.cpp libpinproc pinproctest example code].<br />
<br />
===== pyprocgame =====<br />
<br />
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 [https://github.com/preble/pyprocgame/blob/master/procgame/game/game.py game.py]. Use the WPC method for dual-wound coils and the Stern method for single-wound coils.<br />
<br />
==== Software Control ====<br />
<br />
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. <br />
<br />
===== Software control using P-ROC functions =====<br />
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.<br />
<br />
====== Dual-wound (WPC-style) Flippers ======<br />
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.<br />
<br />
====== Single-wound (Stern-style) Flippers ======<br />
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.<br />
<br />
===== Software control without using P-ROC functions =====<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/p-roc/documentation P-ROC FPGA documentation] for more details.<br />
<br />
=== Other controller (non - P-ROC) ===<br />
<br />
If you're using a microcontroller such as an Arduino or Parallax Propeller to control your flippers through a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16], you'll need to do everything in software. Refer to the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] documentation for a description of the PDB Protocol used for sending commands to the driver board.</div>Hartohttps://pinballmakers.com/wiki/index.php?title=Controlling_Coils&diff=52427Controlling Coils2019-02-12T23:05:29Z<p>Harto: /* Controlling coils */</p>
<hr />
<div>== Hardware == <br />
<br />
The usual way to control coils is to connect power 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.<br />
<br />
Coils are typically controlled with a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] board. It's best to connect the power side of the coil to the fused power output connector on the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16]. This will cause only the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 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 [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] provides in each bank.<br />
<br />
As shown in the diagram below, banks A and B of the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] are completely independent. The voltages used to feed each bank can be the same, but they don't have to be. This diagram is showing how to use bank A to control high power coils and bank B to control low power coils or flashlamps.<br />
<br />
[[Image:Power-Driver-16-example-use.jpg|500px]]<br />
<br />
=== Controlling coils ===<br />
<br />
Coils are used for a variety of features in most pinball machines. Common features with coils are flippers, slingshots, pop bumpers, drop targets, diverters, etc. Most coils are simply a long wire wrapped around a hollow core. When current flows through through the wire, a magnetic field is created in the core. This magnetic field pulls in metal objects. Typically, a steel rod (plunger) is connected to the playfield feature. When the coil is activated (current applied), the steel rod is pulled into the core due to the magnet field. The movement of the rod translates to movement of the feature. For instance, a pop bumper typically has a metal ring attached to the plunger that gets pulled down toward the playfield when the coil activates. This downwards motion pushes the ball away from the pop bumper.<br />
<br />
As shown in the picture below, a coil generally has two lugs, sometimes with a diode wired between them.<br />
<br />
[[Image:P-Coil.jpg|300]]<br />
<br />
To connect a coil to a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] board, simply wire power out from the desired bank (J3 or J4) to one lug, and one of the bank's 8 transistor circuits (J7 or J11) to the other lug. <br />
<br />
'''Important''': If the coil has diode, you MUST wire power out to the bar end of the diode and the transistor circuit to the non-bar end of the diode. Otherwise, bad things ensue (blown diodes, blown transistors, blown fuses, blown PD-16, etc). The [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] boards have their own diodes on each circuit; so diodes on the coils are unnecessary and should be removed.<br />
<br />
=== Controlling Flippers ===<br />
<br />
[[Controlling Flippers|Click here for a more detailed description of flipper control.]]<br />
<br />
== Software ==<br />
<br />
=== P-ROC ===<br />
<br />
The P-ROC can be configured to automatically control your chain of driver boards, allowing you to issue higher level commands (pulse, schedule, patter, etc). If you're using libpinproc (C) or pyprocgame (Python), you'll first need to configure the P-ROC to work with your chain of driver boards. Instructions for doing this are [[Configuring Driver Boards|found here]].<br />
<br />
<br />
==== libpinproc ====<br />
<br />
To activate the coils in a C program using libpinproc, you simply need to call the desired PRDriver... libpinproc function, passing in the handle to your P-ROC, the coil number, and the desired activation params. For instance, to pulse coil 32 for 40 milliseconds:<br />
<br />
PRDriverPulse(PRHandle, 32, 40)<br />
<br />
Other available driver commands include:<br />
<br />
PRDriverSchedule() - Issue a defined pattern that repeats every second<br />
PRDriverPatter() - Issue a repeating pitter-patter style pattern where the coil repeatedly turns on for X ms and off for Y ms.<br />
PRDriverPulsedPatter() - Same as above except the pattern ends after Z ms.<br />
PRDriverDisable() - Turn off the coil<br />
<br />
Refer to the [https://github.com/preble/libpinproc libpinproc code] for implementation details.<br />
<br />
'''Warning - It's best to use only PRDriverPulse() and PRDriverDisable() commands for high power coils. This will help to eliminate errors that could result in coils staying on too long and burning up or blowing fuses.'''<br />
<br />
==== pyprocgame ====<br />
<br />
Your machine's YAML file will need to contain coil definitions so that pyprocgame will know know which coils exist on your machine. Here's an example YAML with only the relevant coil items:<br />
<br />
PRGame:<br />
machineType: custom<br />
<br />
PRCoils:<br />
coil0:<br />
number: PD-16 circuit number for coil0 (0 for board 0, bank A, output 0)<br />
coil1:<br />
number: PD-16 circuit number for coil1 (1 for board 0, bank A, output 1)<br />
coil2:<br />
number: PD-16 circuit number for coil2 (8 for board 0, bank B, output 0)<br />
coil3:<br />
number: PD-16 circuit number for coil3 (16 for board 1, bank A, output 0)<br />
<br />
Once your YAML file is loaded into pyprocgame, you can activate your coils by calling:<br />
<br />
game.coils.coil0.pulse(40) - Drives coil0 for 40ms<br />
<br />
Other available driver methods include:<br />
<br />
schedule()<br />
patter()<br />
pulsedpatter()<br />
disable()<br />
enable()<br />
<br />
Refer to the [http://pyprocgame.pindev.org/ref/game.html#driver pyprocgame] docs more detailed information.<br />
<br />
'''Warning - It's best to use only pulse() and disable() commands for high power coils. This will help to eliminate errors that could result in coils staying on too long and burning up or blowing fuses.'''<br />
<br />
==== Mission Pinball Framework (MPF) ====<br />
See the [http://docs.missionpinball.org/en/latest/hardware/multimorphic/drivers.html MPF Documentation about P-Roc Coils] for details. <br />
<br />
==== Direct Control ====<br />
<br />
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 [http://www.pinballcontrollers.com/index.php/products/p-roc/documentation P-ROC FPGA documentation] for more details (register addresses and data format)<br />
<br />
=== Other controller (non - P-ROC) ===<br />
<br />
If you are using a microcontroller such as an Arduino or Parallax Propeller to control your flippers through a [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16], you'll need to do everything in software. Refer to the [http://www.pinballcontrollers.com/index.php/products/driver-boards/power-driver-16 PD-16] documentation for a description of the PDB Protocol used for sending commands to the driver board.</div>Harto