Skip to content

coils:

This is a config file reference. Click for instructions.

This page is reference material which explains every setting and option for this section of an MPF yaml config file. See the instructions for config files for formatting and other details. See our guide to config file examples for more examples of real configs in action.

Valid in
machine config files YES ✅
mode config files NO 🚫

The coils: section of your config is used to map coil (solenoid) names to driver board outputs. You can also set the default pulse times, set tags, and specify power levels for coils that get held on. This section can be used in your machine-wide config files. This section cannot be used in mode-specific config files. Here's an example section:

coils:
  flipper_right_main:
    number: A0-B0-0
    default_pulse_ms: 30
    max_pulse_ms: 100
    default_pulse_power: 0.7
    max_pulse_power: 1.0
  flipper_right_hold:
    number: A0-B0-1
    default_hold_power: 0.25
    max_hold_power: 0.5
  knocker:
    number: A0-B1-0
    default_pulse_ms: 20
    max_pulse_ms: 100
  pop_bumper_left:
    number: A0-B1-1
    default_pulse_ms: 18
    max_pulse_ms: 100
  ball_gate:
    number: A0-B1-2
    default_hold_power: 0.375
    max_hold_power: 0.5

Warning

Please ensure that you have established common ground between logic and coil power before turning on high voltage on your coils (especially on homebrew machines). Ignoring this might lock on your coils, overheat them, burn down your house or kill you. We are serious, floating grounds are dangerous. If you are not an electrical engineer read the guide about voltages and power.

In a nutshell: You need to connect your logic ground (5V/12V) and your high voltage ground (48V or 80V). A power entry or power filter board is a convenient solution to solve this (and more) issues.

Always turn all PSUs off when connecting power or you might fry all boards at once. This is generally a good idea but even more important when connecting more than one power supply to a board.

IF YOU DID NOT UNDERSTAND WHAT THIS WARNING MEANS STOP NOW AND TRY TO UNDERSTAND IT. OTHERWISE YOUR HARDWARE WILL LIKELY BURST INTO FLAMES AND YOU NEED TO WAIT A FEW DAYS FOR A REPLACEMENT OR EVEN WORSE IT MIGHT KILL YOU. IGNORING THIS IS THE MOST COMMON CAUSE FOR BROKEN DRIVER BOARDS.

The options are as follows:

Required settings

The following sections are required in the coils: section of your config:

number:

Single value, type: string. Defaults to empty.

This is the number of the coil which specifies which driver output the coil is physically connected to. The exact format used here will depend on which control system you're using and how the coil is connected.

See the How to configure "number:" settings guide for details.

Optional settings

The following sections are optional in the coils: section of your config. (If you don't include them, the default will be used).

allow_enable:

Single value, type: boolean (true/false). Default: false

MPF will not enable any coil at 100% power unless you also add an allow_enable: true entry to that coils' settings. We include this as a safety precaution since many coils will burn up if you enable them on solid, so the fact that you have to explicitly allow this for a coil prevents you from screwing something up and accidentally enabling a coil that isn't supposed to be enabled. If you have a default_hold_power: setting less than 8 (full power), then you don't need this allow_enable: entry since you are implying you want to hold the coil by adding the default_hold_power setting. The default default_hold_power is 100%, so if you just want to be able to enable a coil at 100% then just add allow_enable: true and you don't have to add a default_hold_power entry. If you try to enable a coil that does not have default_hold_power configured or allow_enabled set to true, then the coil will not actually be enabled and you'll get an error in your log file.

default_hold_power:

Single value, type: float(0,1). Defaults to empty.

This setting lets you control how much power is sent to the coil when it's "held" in the on position. This is an float value from 0-1 (i.e. 0% power to 100% power) which controls the relative power.

Different hardware platforms implement the hold power in different ways, so this 0-1 default_hold_power setting provides a generic interface that works with all hardware platforms. (You can also add platform-specific settings here for more fine-grained control of how the hold power is applied. See the How To guide for your specific hardware platform for details.) This default_hold_power: section is optional, and you only need it for coils you intend to hold on. In other words, if a coil is just pulsed (which is most of them), then you don't need to worry about this section.

This provides the default value for any enable calls on the coil. Devices might call enable with a different power setting.

default_pulse_ms:

Single value, type: time string (ms) or template (Instructions for entering time strings and Instructions for entering templates). Defaults to empty.

The default amount of time, in milliseconds, that this coil will pulse for. This can be overridden in other ways, but this is the default that will be used most of the time. Default is 10ms, which is extremely weak, but set low for safety purposes.

default_pulse_power:

Single value, type: float(0,1). Defaults to empty.

The power factor which controls how much power is applied during the initial pulse phase of the coil's activation. (Note that not all hardware platforms support variable pulse power.) See the section on default_hold_power: above for details. It will also used in rules.

default_recycle:

Single value, type: boolean (true/false). Defaults to empty.

Controls whether this coil should add a small delay before it's allowed to be fired again. (This is used on things like pop bumpers and slingshots to prevent "machine gunning.")

This is a boolean setting because it's implemented differently depending on the hardware platform used. See the documentation for your specific hardware platform if you'd like more control than what's available with the straight on/off settings.

default_timed_enable_ms:

Single value, type: time string (ms) or template (Instructions for entering time strings and Instructions for entering templates). Defaults to empty.

Help us write it!

This section is unwritten or needs an update or edit. Can you help write it? Get your name in lights and geeky pinball bragging rights! Hit the magic sparkly wand to the right of the title to see this page source on GitHub. Then add/edit and submit your change. It's easy!


disable_events:

List of one (or more) device control events (Instructions for entering device control events). Defaults to empty.

Disables this coil (meaning that if it's active, it's shut off).

enable_events:

List of one (or more) device control events (Instructions for entering device control events). Defaults to empty.

Enables (holds on) this coil. This requires that allow_enable is true or that a default_hold_power or max_hold_power setting is configured.

max_hold_duration:

Single value, type: time string (secs) (Instructions for entering time strings). Defaults to empty.

Help us write it!

This section is unwritten or needs an update or edit. Can you help write it? Get your name in lights and geeky pinball bragging rights! Hit the magic sparkly wand to the right of the title to see this page source on GitHub. Then add/edit and submit your change. It's easy!


max_hold_power:

Single value, type: float(0,1). Defaults to empty.

This controlls the maximum allowed hold power for this this coil. While default_hold_power sets the default for all enable calls on the coil this defined the upper limit. If this is not set MPF will use default_hold_power. Usually you can omit this setting.

max_pulse_ms:

Single value, type: time string (ms) (Instructions for entering time strings). Defaults to empty.

Maximum allowed pulse time for this coil. If set, MPF will raise an error if any code tries to pulse the coil for more than max_pulse_ms.

max_pulse_power:

Single value, type: float(0,1). Default: 1.0

Set the maxium pulse power. If pulse is called on the coil without any parameters default_pulse_power is used.

platform:

Single value, type: string. Defaults to empty.

Name of the platform this coil is connected to. The default value of None means the default hardware platform will be used. You only need to change this if you have multiple different hardware platforms in use and this coil is not connected to the default platform.

See the Mixing-and-Matching hardware platforms guide for details.

platform_settings:

Single value, type: dict. Defaults to empty.

Dict of platform specific settings. Consult your platform documentation for those settings.

psu:

Single value, type: string name of a psus: device. Default: default

Specify to which power supply unit this coil is connected. This is used for power management. In some cases, MPF can deliberately delay coil pulses to prevent too many coils from firing and drawing to much current from your PSU.

pulse_events:

List of one (or more) device control events (Instructions for entering device control events). Defaults to empty.

device control events format.

Default: None (Note that if you add an entry here, it will replace the default. So if you also want the default value(s) to apply, add them too.)

Event(s) that pulse this coil (at its default_pulse_ms and power settings).

pulse_with_timed_enable:

Single value, type: boolean (true/false). Default: false

Help us write it!

This section is unwritten or needs an update or edit. Can you help write it? Get your name in lights and geeky pinball bragging rights! Hit the magic sparkly wand to the right of the title to see this page source on GitHub. Then add/edit and submit your change. It's easy!


console_log:

Single value, type: one of the following options: none, basic, full. Default: basic

Log level for the console log for this device.

debug:

Single value, type: boolean (true/false). Default: false

See the documentation on the debug setting for details.

file_log:

Single value, type: one of the following options: none, basic, full. Default: basic

Log level for the file log for this device.

label:

Single value, type: string. Default: %

A descriptive name for this device which will show up in the service menu and reports.

tags:

List of one (or more) values, each is a type: string. Defaults to empty.

Special / reserved tags for coils: None

See the documentation on tags for details.


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results