the first thing i would do is take the seat off and check that all battery connects are good,paying special attention to the ground side.i would disconnect the aftermarket controller and continue riding until this problem is resolved or it arises again before continuing any further repair or diagnosis. process of elimination this will be first assuming no codes are stored. strictly one mans assumption.