Paralleling Motor Cutoff Switch

Joined
Jan 19, 2022
Messages
81
I have a grin tripwire switch that I want to wire in parallel to one ebike controller and two arduino nanos.
The tripwire has two wires (no V+) that must be signal and ground.
So when I hook them into the controller I think there will be controller voltage on the signal wire.
If so, I'll need to pass the signal through a 5v to 3.3v level shifter before attaching to the nano's digital input pin.
In this case, when the tripwire is pulled the voltage on the nano's pin would go to zero, indicating a motor cutoff.
Am I thinking straight on this?
 
First...what function does the ebrake on the controller activate? Is it regen braking or is it motor shutdown? Do you need to change that behavior from the built-in mode?

Next, do you want the nano to do the shutdown of the motor (by ceasing throttle input to the controller, or otherwise altering controller behavior, perhaps for individual controller behavior changes rather than both identical at same time), or control the braking of the motor?

If so, you probably don't want to connect the tripwire to the controllers at all.



Is the tripwire using a reed switch, or a hall sensor, or a typical momentary switch?

All work the same basic way, grounding the controller's built in pullup resistor voltage when active, leaving open circuit when inactive. But the hall sensor requires (5v typical) power to operate, and only grounds down to around 0.8v, while the other two are "hard" grounds and require no power.
 
Right now I have one ebrake motor cut-off switch wired to the front controller and one wired to the rear.
(I didn't want a four brake lever bike:)

The front wheel uses regen braking.
I put the grin tripwire (hard grounding) on the front brake lever so I can cut off the rear controller with the front lever;
eliminating all chance of the rear motor powering during a regen event.
There is no change to either controller on brake function.

One nano controls front throttle, one rear. That's their only function.
(When a nano throttle control is turned off with a switch, the respective controller functions with normal throttle and PAS systems.)

The nanos use a PID controller with a calculated setpoint based on bike inclination and roll.
The feedback to the PID is the actual power as read from the cycle analyst logging stream.
The output of the PID is the throttle voltage.

During a braking event, the PID will see the decrease in actual power and try to give more throttle to bring the power back to setpoint.
It won't have any effect while the brake is activated but as soon as the brake is released, there will be a power surge.
The ebrake signal into the nano will be used put the PID in manual mode and have it's setpoint track the actual power.
When the brake is released, the controller will be returned to the auto mode and there will be a "bumpless" resumption of power application.

So to make this work, I need to multiply the motor cutoff signal from the tripwire by paralleling the signal wire to the rear controller and the two nanos...
 
Last edited:
I finally got the bike to a point i could power it up. I tested the voltage across the two motor cutoff wires: 0v. I touch the wires together and the controller recognizes it as an ebrake. I'm back to square one as I don't have a similar detection circuit for the nanos :(

So I went ahead and attached the tripwire leads to the controller leads and at least have a rear motor cut-out when the front brake is pulled. I'm going to cut into the brake cable of the front motor lever and grab my nano signals from there. It's a three wire brake with 5v+ and should work just fine through the level shifter...

Update: The front brake cable surgery went good and inside were three wires:) (Red, black, green.) The signal wire was at 3.25v until the lever was pulled and fell to 0v on activation. The signal being below 3.3v meant I didn't even need a voltage level shift to protect the nano so I just paralleled the green wire with the digital inputs to the nano.

It's really kinda embarrassing not being able to parallel the 2-wire cutoff switch. I need to find a controller schematic of the circuit...
 
Last edited:
Back
Top