Warning

This is the dev documentation for an unreleased version of MPF!

This is the documentation for MPF 0.54+, which is the “dev” (next) release of MPF that is a work-in-progress. Unless you’re specifically looking for this version, you probably want to use the version of documentation called “latest” which is for the latest released version of MPF. That documentation is at docs.missionpinball.org/en/latest.

Motors

Related Config File Sections
motors:
digital_outputs:
switches:

Config

In this example we configure a motorized drop target bank which can move up and down with two position switches.

switches:
  s_position_up:
    number:
  s_position_down:
    number:

digital_outputs:
  c_motor_run:
    number:
    type: driver

motors:
  motorized_drop_target_bank:
    motor_left_output: c_motor_run
    position_switches: !!omap
      - up: s_position_up
      - down: s_position_down
    reset_position: down
    go_to_position:
      go_up: up
      go_down: down
This example is tested to be valid MPF config. However, it is not integration tested.
switches:
  s_position_up:
    number:
  s_position_down:
    number:

digital_outputs:
  c_motor_run:
    number:
    type: driver

motors:
  motorized_drop_target_bank:
    motor_left_output: c_motor_run
    position_switches: !!omap
      - up: s_position_up
      - down: s_position_down
    reset_position: down
    go_to_position:
      go_up: up
      go_down: down

The motor can run continuously and drives a camshaft which moves the bank up and down. MPF will figure the position using two position switches s_position_up and s_position_down. To enable the motor we use a digitial_output c_motor_run which maps to a driver. On reset the bank moves down and can afterwards be commanded using the events go_up and go_down.

The following is an example to drive the slimer in Stern Ghostbusters:

switches:
  s_slimer_home:
    number: 8-1
  s_slimer_away:
    number: 8-2

digital_outputs:
  c_slimer_motor_forward:
    number: 8-3
    type: light
  c_slimer_motor_backward:
    number: 8-4
    type: light

motors:
  ghostbusters_slimer:
    motor_left_output: c_slimer_motor_forward
    motor_right_output: c_slimer_motor_backward
    position_switches: !!omap
      - home: s_slimer_home
      - away: s_slimer_away
    reset_position: home
    go_to_position:
      slimer_home: home
      slimer_away: away
This example is tested to be valid MPF config. However, it is not integration tested.
switches:
  s_slimer_home:
    number: 8-1
  s_slimer_away:
    number: 8-2

digital_outputs:
  c_slimer_motor_forward:
    number: 8-3
    type: light
  c_slimer_motor_backward:
    number: 8-4
    type: light

motors:
  ghostbusters_slimer:
    motor_left_output: c_slimer_motor_forward
    motor_right_output: c_slimer_motor_backward
    position_switches: !!omap
      - home: s_slimer_home
      - away: s_slimer_away
    reset_position: home
    go_to_position:
      slimer_home: home
      slimer_away: away

The slimer motor can move in two directions using two digital_outputs c_slimer_motor_forward and c_slimer_motor_backward which map to lights in Spike. The switches s_slimer_home and s_slimer_away are used by to determine the current position. To command the slimer use the events slimer_home or slimer_away.