Diverter firing at ball start

34 views
Skip to first unread message

Greg Sealby

unread,
Sep 19, 2019, 9:43:54 AM9/19/19
to MPF Users
I have a diverter that is firing on ball start.  I seems to fire on the enable event, which reading through the doco should not happen.  Here's my log:

2019-09-19 20:39:11,644 : INFO : EventManager : Event: ======'diverter_top_diverter_enabling'====== Args={'auto': False}
2019-09-19 20:39:11,644 : INFO : EventManager : Event: ======'diverter_top_diverter_activating'====== Args={}
2019-09-19 20:39:11,644 : INFO : coil.c_left_orbit_deflector : Enabling Driver with power 0.25 (pulse_ms 25ms and pulse_power 1.0)

This is what I have in my config:

diverters:
    top_diverter:
        activation_coil: c_left_orbit_deflector 
        type: hold
        activation_time: 3s
        activate_events: 
            - shot_hd_right_orbit_hit
            - seq_shot_sp_super_jackpot_right_orbit_hit
            - shot_skill_shot_right_orbit_hit
            - shot_orbit_right_hit
        enable_events: ball_started
        disable_events: ball_ended
        targets_when_active: playfield
        targets_when_inactive: playfield

I can see the ball_started event fire, but none of the  other activation events are logged (which is expected as the ball is still sitting in the plunger lane).

Is there something missing from my config?

mike wiz

unread,
Sep 19, 2019, 11:40:37 AM9/19/19
to MPF Users
I have 2 diverters.  Mine are working correctly.

Here is my config if it helps.

coils:
  c_orbit_gate:
    number: 2-15
    default_pulse_ms: 15
    allow_enable: true

diverters:
  orbit_gate:
    activation_coil: c_orbit_gate
    type: hold
    activation_time: 2s
    activation_switches: s_gate_top_right
    deactivation_switches: s_left_orbit
    enable_events:
      - orbit_gate_enable
      - mode_skill_shot_starting
    disable_events:
      - mode_skill_shot_stopping
      - orbit_gate_disable
    debug: True


Greg Sealby

unread,
Sep 19, 2019, 11:11:33 PM9/19/19
to MPF Users
Thanks Mike.  I thought adding allow_enable like in your config might fix it, but same result unfortunately.  I might swap mine over to enable/disable on modes like you have to see if that makes a difference.  

jabdoa

unread,
Sep 20, 2019, 1:17:39 AM9/20/19
to MPF Users
Your config looks good to me. Should work that way. I will try to reproduce it and fix it if i can.

Jan

jabdoa

unread,
Sep 20, 2019, 8:53:24 AM9/20/19
to MPF Users
I created a minimal testcase for your diverter and it passes for me on dev. However, it seems to be broken in 0.52.x

git bisect identified this commit as a fix for the test: https://github.com/missionpinball/mpf/commit/d25be13a8b8c44e928c0827dafb8c656aab8c67b

Easiest fix for you would be to upgrade to dev. We can also backport it to 0.52.x.

You can run this using "mpf test your_test.txt":

coils:
    c_left_orbit_deflector:
        number:
        allow_enable: True

diverters:
    top_diverter:
        activation_coil: c_left_orbit_deflector
        type: hold
        activation_time: 3s
        activate_events:
            - shot_hd_right_orbit_hit
            - seq_shot_sp_super_jackpot_right_orbit_hit
            - shot_skill_shot_right_orbit_hit
            - shot_orbit_right_hit
        enable_events: ball_started
        disable_events: ball_ended
        targets_when_active: playfield
        targets_when_inactive: playfield

##! test
mock_event diverter_top_diverter_enabling
mock_event diverter_top_diverter_activating

# start game
start_game

# diverter should enable but not activate
assert_event_called diverter_top_diverter_enabling
assert_event_not_called diverter_top_diverter_activating

jabdoa

unread,
Sep 22, 2019, 7:03:22 AM9/22/19
to MPF Users
Backported the fix to 0.52.7.

Jan

Greg Sealby

unread,
Sep 22, 2019, 7:32:22 AM9/22/19
to MPF Users
Thanks Jan, much appeciated.

Greg Sealby

unread,
Sep 23, 2019, 6:13:52 AM9/23/19
to MPF Users
I tested this tonight and this version has definitely resolved my issue.  Thanks again Jan ...you're a legend.
Reply all
Reply to author
Forward
0 new messages