Page 1 of 1

Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 04, 2017 1:43 pm
by methods
Hey guys...

As fechter always says... "one test is worth a thousand opinions"

In short:

Sevcon Gen 4
5K pot throttle (or even hall throttle)
Built in NO micro switch

We have 3 major events to detect and protect against

1) Low Votlage on Throttle signal
2) High Voltage on Throttle siginal
3) Unexpected voltage on Throttle signal

Low and High are handled through the settings in the DCF
We can detect an open or a short. This is known

QUESTION: Return to Zero settings

Since our throttle has a micro switch in it (RIGHT....??) we have an interlock mechanically tied to our throttle position.
If the interlock is open, at no time, should throttle voltage be less than 0% or more than 10%
This would indicate that either the micro switch is broken or that an external voltage is applied to the throttle (thru electrolysis or abrasion)

If the microswitch is closed... any valid throttle input is allowed.

Ok.. so for safety... we can now avoid 3 base cases but not one outlier case:

Open = detected
Short = detected
Throttle closed = ignore voltage (in neutral)

What of the following case:

1) We have been riding... this is not "at startup"
2) Throttle is released, micro switch open, bike is in FWD (assume microswitch is FS1...)
3) Stray voltage gets onto the throttle line. Say... 5V... so 50% of available torque... so... A LOT
4) Rider cracks throttle, micro switch closes


A) Bike instantly applies the 5V throttle signal resulting in a heavy lurch (my experience)

B) Bike requires a "return to zero" on the throttle voltage before allowing advance (the behavior we desire)


Some folks dont have a throttle switch for FS1... they have a separate switch on the bars
Users forget to set this bar switch... and activate throttle (induce voltage) at a time where there should be no voltage
This may or may not have caused an error... I do not see this error in my testing
So.. at some point... what should be an error condition... was masked

Every throttle MUST have a micro switch
Any voltage on throttle SHOULD be logged as an error... or at a minimum... require a return to Zero... but even a return to zero does not protect against a non DC injection voltage

SO... any time throttle voltage reaches a value over say... 20%... when the interlock is open... a real deal error should be applied to lock up the bike


Anyone want to work on that proof with me?

The goal here is to ELIMINATE "black boxes" that OEM's work into bikes to secure IP around a design.
There is no need for a black box on an engineering bike
There is a need for total and complete throttle safety
There are a billion settings in Sevcon... one of them... I bet... forces a return to zero on the throttle voltage

Input welcome
It will go with our documentation set on our Engineering Release
(we are letting our Sevcon harness go out into the wild in a week or so here... throttle safety... is something we will assure with the community before release)

NAH I dont make money on this lol... I work my ass off... assume all the risk... and hope people dont die.
That said... we are releasing to the wild... and I am not budgeted for test.. so I need some help to keep on schedule

Otherwise... days into weeks, weeks into months, months into years...
I wont release a design which is unsafe.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 07, 2017 7:48 am
by jonescg
I just put a 200 ohm resistor on the 5 V and the 0 V. That way the inverter will know when it sees the wiper short to ground or to 5 V.
I assume you can set the analogue inputs for chopped and WOT?

Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 07, 2017 10:00 am
by methods
That safety is built in, resistance in the 10s of k.

Return to Zero behavior for "enable" is what I am trying to turn on.
I will search the DCF...

Steady state (not Startup)
FS1, FWD, or both are open
50% throttle applied... Via Electrical fault
FS1 and FWD are closed

Looking to force a return to 0% throttle before torque.

From phone...


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 11:04 am
by methods
Not it... but inching closer....

Looking for the bit (no pun intended) which insists that a sequence be:

All other bits cleared (FWD, FS1, Other)
Throttle now checked for return to zero (inside of a WINDOW... so... ARBITRARY percentage window)
proceed if so, otherwise lock until return

Yep... Racers would totally mask this out... but if tuned correctly.... its what you want.
IF not tuned correctly... not what you want

ParameterName=Sequence Fault Mask (set bit to ignore input during sequence fault check)
;SEVCONFIELD EEPROM=misc.seq_flt_mask

Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 11:18 am
by methods
So on a naive search (the kind that happens on a phone, at lunch, half distracted)...

The only instance of the word Sequence is 2918

In there we see some interesting things... which can help us back out what the DLD is doing.

Sorting by BITMASK=0x
Your parsing machine produces the following (You have a parser for this RIGHT? oh... doh... you are hand searching??? lol...)

Throttle direction
Inch Fwd
Inch Rev
Belt Fwd
Belt Rev
Belt Stop

K... no bits missing.... up to

1 2 4 8
1 2 4 8
1 2 4

11 bits
Whats the 12th bit? Unused I presume... Moving on

First we understand what each and every one of those masks accomplishes.
Where those bits are set in DVT... if they are exposed in DVT

Yep going at it sideways...
Always this way

Breadth and Depth

Scan the full document (overwhelming)
Depth Charge Randomly (quasi-random)
Search on some key words - depthcharge
Back to the top... make sense? Nope...
Review other materials
Ask for help (Masked... not an option...)

lol... More fun this way.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 11:20 am
by methods
Throttle direction


Inch Fwd
Inch Rev



Belt Fwd
Belt Rev
Belt Stop


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 11:31 am
by methods
Slide #6

DVT, DCF's, DLD's and understanding the big picture....

A word of caution

So... you are using DVT as your portal to the Sevcon
DVT simply passes thru a DLD and, as far as I can tell, has no knowledge of the DLD behavior

DVT parses a DCF
It shows you whatever the last software programmer happened to parse out
It exposes the same things you can search for using any parser

We are limited to what is dictated by the behavior of the DLD
The DCF can influence this... branch it... guide it... mask it... steer it... but only within the confines of what is hard coded into the DLD

DLD compatibility going forward and backward
Hardware compatibility across decades

Oh wait... thats like 20 slides... and nobody cares.

What I would not give for a graphical representation of the DLD
A mapping
Even if its some gnarly compiler output... like LabView does... just permutating thru every branch...

We seek the portion that decides the final AND gate
What must be in place... what check boxes must be marked... in order to apply torque

In there... we seek the requirement that a throttle return to zero-window...
Or in better words...
That torque can not be applied in a Step function... so an alternate way to address it... is rate of change of torque at time Zero

THAT we can control
Based on Speed

Below 1MPH
I want to see an allowable rate of change... which is super smoothed out... such that if a throttle step is applied... that it does not result in rubber marks on the ceiling

I have seen this.
It has implications on perceived throttle response and performance
Its a way to go about it. Ack... tuned way

Ok... I can meet requirements in this way

Above a few MPH I dont really care if throttle punches on harder than expected
Its really at Zero RPM that I am concerned
Its the SURPRISE I want to eliminate... where things are still... and instantaneously they lurch

That breaks stuff.... so to some degree its obviously already managed

Reverse engineering
Sigh... knowing someone has already solved it... but in an indirect way... so we have to go backwards and forwards walking thru the logic and reason... to find the bits to fiddle... to apply the controls we want.

Yea... it works

Buy a Kelly if you are not following me... unless you want to pay a methods.... to solve riddles... or you like to solve riddles yourself.
This is a solved riddle but a fun one.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 1:17 pm
by methods
Arbitrary map pulled from our repository
ArbitraryMap.png (21.49 KiB) Viewed 945 times
(ack... work stuff... to be continued)

Anyway - note the performance at 0RPM
Its a major trade-off and not the spot where I want to deal with adversarial throttle injection


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 1:36 pm
by methods
So... thats not the spot we will deal with it.

Rate of change would be a spot where we could do it
How many 1000RPM per second it is allowed to accelerate

But... those are across the board settings... and I only want to affect response at 0RPM

Step Function (Throttle goes from 0% to X% instantly)
Impulse Function (Throttle blips)
Steady State Function (How that PID stuff second-orders into the ride)

Yea... yea... PID loop tuning

I want another interlock on throttle, an interlock already existing unmasked, or some way to say... (what I said above)

WHICH... is that the bike will never "take off" in the event that a switch is flicked...
Should be easy enough.

With a throttle switch in place... we can isolate the single failure I want to isolate... which is "voltage injection on the throttle line"
So easy to filter out. Why is this not in 32 font on the front page of DVT?

Should I make the truth table for it again?
There are not that many permutations... of intended and unintended throttle input.

Fist... is accepting... that mechanical rotation of a throttle... MUST have a switch at 0%
Without that... we steer off into the weeds.
I would not even support throttles without a switch

Just ask anyone who has lost control of 10 or 20 horses.... drag you right across a field.
No room for error here... even an error that is highly unlikely to happen

Will be compiling these results and approaching Sevcon soon... so that they can tell me... "No problem... we already have that feature... why did you not just ask"
(Best outcome)

I wish to see this emphasized as a baseline... and thats a side project.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 1:40 pm
by methods
And yes...

Unless the bikes I have tested were Engineering...

There are more than a few out in the wild...
That if you apply full throttle....
And then you bump out of Drive....
and then you bump back into drive...
Step-function the throttle.

Just tested it on the bench the other day.
Admittedly it was not under load... so perhaps there are some rate of change limitations around loading...

Likely... which is why folks should never test this stuff freewheeling
Only test in a loaded scenario!

As... with this "super advanced stuff".. its not just mosfets turning on and off anymore.
Lots to control behind the curtain.
Freewheel response is weighted at 0%... and loaded response is weighted at 100%

Sigh... off to work on the dyno... that bastard scares the shit out of me.
I want a longer CAN wire so I can work from the next room over :shock:

Laugh if you want. 50hp exploding all over the place is serious shit.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 1:45 pm
by methods
FYI... I am killing time over here.
Day got derailed by a development.

Should be over at Calfee Design wiring up a bike (parts are int)
Excited to get that done.
Engineering bike... clean one... :D

I realized that I have been dragging my feet over the throttle interlock stuff.
Trying to sort out the full argument in my head
Either there is a problem or not
Its either solved or not

I only want SUPER SAFE vehicles out there.... when we step out of ebike range (1hp to 10hp) and into big boy power (10hp to 100hp)
Anyone dealing with more than 100hp is an insane person.

Un frigging believable what 100hp of Electric is capable of.
Like... a supercharged Honda pegged at 6000RPM with straight cut gears.... CLICK

Uh oh... didn't hear it coming...


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 2:00 pm
by methods
Drew it on the board.

Went over what I remember from talking with folks who were developing this stuff back in the day.
Back in the day throttles with a built in switch were... I guess... not as available as they are now.

Some major developers moved forward on a Magura type throttle - No switch.
If you draw my arguments on the board.... and you dont have a throttle rotation switch... the argument does not stand.


Without a rotation switch... Sevcon can not tell the difference between a VALID and INVALID throttle voltage input.


We must have a throttle switch... and with this switch... WE CAN ELIMINATE THE FAILURE MODE OF ADVERSARIAL VOLTAGE INJECTION.

See... :D

Am I making sense yet?


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 2:19 pm
by methods

I have a free hour.
I am going to draw up the formal proof and present it.

I am just DREADING calling Sevcon after all the negative feedback I have heard from guys in the field.
Sure... fools call Sevcon all the time... so they cant have a $250k/yr Wizard answering the phone.
I totally understand that it is a major burden to answer unknown calls.

That said... Guys who I RESPECT... as SHARP operators... have reported unsatisfactory interactions while trying to affect change.

Most of this stems back to the business model of Sevcon
Basically they are a black hole of information... an any information propagated is in the hands of those who covet (except Thunderstruck EV... GO THUNDERSTRUCK!!!)

At National Instruments we have figured out how to solve this...... :idea:

Tiered Support

If you call NI (National Instruments) out of the blue you get a meathead on the phone (ok... that was rude... you get a GreenHorn on the phone... a Jr Engineer)
They can get most people out of a pinch... but... its not AMAZING support. Its hit and miss

NOW... if you pony up... and get DevSuit (agree to pay for support)
Then... when you call National Instruments... they roll out the red carpet.

Immediately you get a bad-ass engineer on the phone.
A seasoned and skilled expert.
Sr. Engineers as far as I can tell

People who "get it" instantly... are "on it" quick...
You report a bug to them... changes are made by COB.

Where... if you try to do this thru a greenhorn... eh... maybe in a week things get sorted...

I use both tiers of support depending on my level of need.
I have found that trying to punch thru lower tier support is never fruitful.

I save my Bug Reports for Top Tier Support.... and if I am drunk on Saturday night making prank calls about running refrigerators and Prince Albert in a can... well... thats when you call first tier support... right?
(thats a joke)


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 2:20 pm
by methods
Hey... we all have to put in our time as Meatheads.
Thats how you graduate to BrownHorn


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 08, 2017 3:44 pm
by methods
Report.jpg (89.72 KiB) Viewed 1007 times

Ah man... really?

Sigh... Ok... I am heading to the climbing gym then.
Gotta burn off nervous energy in a way that involves physical activity

I still have THIS going on in my shoulder
ShoulderSmall.jpg (23.33 KiB) Viewed 1007 times
But I have been going to physical therapy and the lady there (who climbs!) gave me the green light to start top-roping again.
Maybe go easy on boldering.

Sevcon work got sideswiped today as I am on-call to try and expedite some mission critical stuff.
As soon as business is done for the day... I will be climbing 4 stories.

as an aside...

SchindlerEngineering went on a pretty sketch outing where we tied off to some unknown rebar and dropped down a cliff.

Errr... we are buying one of those Screw-In auger type deals to tie off 20' back from the cliff where the dirt is soft and stable.
I tried pounding a 3' long screwdriver into the ground once and... eh... handle popped off :shock:

Nothing like losing your rope half way down.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Nov 22, 2017 7:45 am
by jonescg
I spend most of my time bouldering because I typically arrive at the climbing gym after work with a backpack containing some shoes and an empty lunchbox. It's just easier, and my skills are so far from where they need to be I might as well ease back into it. At least I'm not trying to do it with a busted shoulder :shock:

From reading the posts above it looks like you're making some progress on the throttle. It seems like it should be a fairly basic setup in the VSM, but Sevcon being Sevcon, you might as well put a message in a bottle and send it out to sea. I love my Rineharts.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Dec 04, 2017 8:18 am
by jenwu
Hi! How did it go with your throttle? I'm experiencing a similar problem with my throttle and Sevcon gen4. I'm using a 10k pot and 12V supply from the controller. I can start the motor with FS1, Seat and FWD off and then I switch the seat followed by FS1 and FWD. The throttle is set to 0V at a start and then it starts to spin at around 0.5V. I'm using speed control and I can control the motor speed at high speeds but not below 1000rpm. When I turn the throttle to 0V the motor doesn't stop but spins at 1000 rpm. Did you manage to get your motor to stop? There are so many parameters to change in the software DVT, I've tried many of them without any luck. Please let me know if you have any idea of what the problem could be. Thanks!

Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Apr 14, 2018 10:04 am
by methods
Skimming back thru time...

At present - we are running POT throttles with a microswitch.
We run 10V and an inlilne resistance
There are failure modes for both Resistive and Hall throttles...

The microswitch is NOT rated for direct 60V off the sevcon
We sometimes run it off of that 60V in testing
(We have an avalanche rated mosfet buffer for that as well... to keep the HV out of the throttle... for "doing it right")

We feel very strongly about dead man switches, dead man cords, and multiple/compound/redundant safety systems

"Some kids came by the shop with a bike.
Bike had a bad throttle (sticky)
Bike fell over... running...
Non-revolutionist got his leg sucked in


All were lucky... and Craig (acting Safety Officer and a damn good one) jumped into the middle of a dangerous and evolving situation to hit the E-Stop in a situation that could have resulted in a lost leg.

Be safe retards


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Apr 14, 2018 10:07 am
by methods
As for motor control on a "Zero type" setup.

Due to the PID and order of magnitude
(meaning... there is not a direct 1:1 relationship between the throttle and the motor drive... and since the motor drive is on the order of 10's of KW...)

It is normal for something like a big Sevcon setup to ... eh... "display behavior"

Know what you are doing -
Or figure it out carefully

These things are NOT ebikes.

At no time should Ebike precedent be implied or used for eMotorcycle work.
There are closer to TWO orders of magnitude difference between them
It is not on a linear scale

Respect power.


Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Apr 16, 2018 2:43 pm
by thoroughbred
Emoto curiosity led me to join this group. I'm trying to find a path towards a silent trail bike. My first post was going to be "Stupid question, what happens when the throttle sticks?"

East coast USA woods riding is all about threading trails through hardwoods. Not much speed is possible in many places but one constantly modulates the throttle, brakes and clutch to control the bike. Arm pump and claw hand conditions set in at times if you ride hard enough, reducing your ability to control a twist throttle. Jerky throttle response also adds to rider fatigue.

I think I want a powerful motor but I also see the need to have a pretty sophisticated and safe throttle system, especially since there isn't a clutch to grab in a catastrophic moment. Glad to see you working on throttle related safety problems.

Re: Sevcon Gen4 - Throttle Interlock Sequence

Posted: Apr 18, 2018 10:48 am
by coleasterling
I didn't read this whole thread and can't at all help with the Sevcon programming, but the first thought I had was to run two throttle pots, one running up, one running down. They get checked against each other constantly and if one goes out of spec, error thrown. That's a standard method of running a throttle in formula student/fsae. You'd have to run a cable throttle to a box, though.