Skip to content

How to configure coils/drivers/magnets (P-ROC/P3-ROC)

Related Config File Sections:

To configure coils, drivers, motors, and/or magnets (basically anything connected to PD-16 board's driver outputs) with P-ROC/P3-ROC hardware, you can follow the guides and instructions in the Coils (Solenoids) docs.

(If you're using a P-ROC with an existing machine's driver board, like a WPC machine, then see the existing machine documentation.) If you are using the P-Roc with PDB drivers you can use the local drivers as number 0 to 31.

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 only specific thing you have to know for this platform is the number format:

number:

image

For PD-16-based devices, the numbering format is:

number: Ax-By-z

The "A" and "B" capital letters are required. (A means Address, B means Bank). The lowercase x, y, and z letters should be replaced with numbers to represent the following on a PD-16 driver board:

  • x : Board address (0-31)
  • y : Bank address (0 for A, 1 for B)
  • z : Output number (0-7)

Note

The output number is the logical number, not the pin number. For example, Output 0 is on Pin 1, and there is a key pin at 2 or 3. Check the manual for the exact mapping.

For example:

coils:
  some_coil:
    number: A0-B1-6
    default_pulse_ms: 30

Burst Switches as Local Outputs (P3-Roc only)

image

If you want to use burst switches as local outputs set DIP switch 1 to on on the P3-Roc. You can use those 64 output as direct outputs:

coils:
  local_output0:
    number: direct-0    # direct driver 0
  local_output20:
    number: direct-20   # direct driver 20

Make sure to assign IDs >= 2 to all PD-16 boards if you set DIP 1 (MPF cannot check this for you). Local outputs behave just like any other output on the P3-Roc. Hardware rules, pulse, hold, pwm etc. will behave exactly the same way.

You may also use outputs as digital_outputs. For instance, to control a motor driver circuit:

digital_outputs:
  motor_left:
    number: direct-5
    type: driver
  motor_rigth:
    number: direct-6
    type: driver

Note

You need at least Firmware version 2.6 to use burst switches as local outputs on the P3-Roc.

Warning

There is no electronic protection on the P3-Roc for burst switches (neither as local outputs nor as burst optos). Additionally, there are no drivers attached to the outputs and they cannot drive any pinball mechs. Make sure not to draw too much current out of those outputs. Also, any voltage above 3.3V or below 0V will irrevisibly damage the P3-Roc. Make sure you know what you are doing before turning this on. We advise to use PD-16 for normal playfield/mech drivers and only use local outputs with additional circuits (not directly).

Pulse time

The P-Roc, P3-Roc and/or PD-16 have the ability to specify the "pulse time". Pulse time is the coil's initial kick time. For example, consider the following configuration:

coils:
  some_coil:
    number:
    default_pulse_ms: 30

When MPF sends this coil a pulse command, the coil will be fired for 30ms.

Pulse Power

You can also set the power of pulses on your coil:

coils:
  some_coil:
    number:
    default_pulse_ms: 30
    default_pulse_power: 0.5

See the hold power section below for internal details about PWM times. With the P-Roc and P3-Roc it is not possible to use default_hold_power and default_pulse_power at the same time.

Hold Power

If you want to hold a driver on at less than full power, MPF does this by using default_hold_power parameter which works for all platforms. It can range from 0.0 to 1.0 and defines the time share the coil is on (0%-100%).

The P-Roc internally uses two parameters which determine how many milliseconds the coil will be on (pwm-on time) and off (pwm-off time). MPF will calculate those based on your power settings.

coils:
  some_coil:
    number:
    default_pulse_ms: 32
    default_hold_power: 0.5

When enabled, this driver will be pulsed for 32ms and then hold on at 50% duty which will convert to 1ms on, 1ms off, 1ms on, 1ms off and so on.

With the P-Roc it is not possible to use default_hold_power and default_pulse_power at the same time.

Recycle

You can set recycle time to your coil to prevent it from overheating by repeated pulses. The recycle time is not configurable on the P-Roc but you can turn it on or off (default on). Default recycle time (called reload in the P/P3-Roc) is 64ms.

This is an example:

coils:
  some_coil_with_recycle:
    number:
    default_pulse_ms: 32
    default_recycle: true
  some_coil_without_recycle:
    number:
    default_pulse_ms: 32
    default_recycle: false

What if it did not work?

Have a look at our troubleshooting guide for the P/P3-Roc.


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