motor cycle "safety system" - how to implement?

Your chance to introduce yourself and your vehicle
Post Reply
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

motor cycle "safety system" - how to implement?

Post by mi-hol »

To avoid accidents and damages motor cycles need to have a "safety system" consisting of the follow components

- ignition switch (on or off state)
- engine shut-off (kill) switch (on or off state)
- neutral gear switch (on or off state)
- clutch switch (on or off state)
- side stand switch (on or off state)
- tip-over switch (on or off state)

Only a certain combination of these switches in on or off condition will enable Starter switch to allow for starting engine.
From engine running state any change of this combination must kill a running engine.
1) How would logic for such a "safety system" be implemented (i.e. LUA script)?

None of above mentioned switches is named as such in rusefi/firmware/controllers/sensors/sensor_type.h
2) How would I define these sensors names?

Thanks
Michael
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: motor cycle "safety system" - how to implement?

Post by AndreyB »

I'd say two Lua improvement would be needed: auxilary digital inputs (could be hacked with auxilary analog inputs as a work-around) and lua-controller ignition cut similar to current lua-controller ETB disable.

Once those are added, you would read digital inputs and disable ignition per your logic.

Not related to sensor_types.h
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: motor cycle "safety system" - how to implement?

Post by AndreyB »

AndreyB wrote:
Mon Jan 02, 2023 10:49 pm
lua-controller ignition cut similar to current lua-controller ETB disable.
Done https://github.com/rusefi/rusefi/commit/a19a7120df6e713299b5d722f78eb8884bbf11dc
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

Re: motor cycle "safety system" - how to implement?

Post by mi-hol »

AndreyB wrote:
Mon Jan 02, 2023 10:49 pm
Lua improvement would be needed: auxilary digital inputs
Shall I create an issue for this feature?
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: motor cycle "safety system" - how to implement?

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
nmstec
contributor
contributor
Posts: 124
Joined: Tue Oct 05, 2021 9:02 pm
Location: Vancouver

Re: motor cycle "safety system" - how to implement?

Post by nmstec »

OEM bikes: kick stand must be up, or clutch applied to crank. Must be in neutral. Tip over only 85*. Kill switch should kill main ecu power (Unless canbus, in this case shut off fuel pump, injection, and ignition).
"Dave B. 5:03 PM
Mark is an ass but by far the most potent combination of knowledgeable ass, smart ass, get it done ass and determined ass. and his ass consistently puts in time."

-Dave B, Hero, Tuner, and probably has a car.
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

Re: motor cycle "safety system" - how to implement?

Post by mi-hol »

AndreyB wrote:
Mon Jan 02, 2023 10:49 pm
Not related to sensor_types.h
for "ignition switch (on or off state)" I searched https://github.com/rusefi/rusefi/blob/master/firmware/controllers/lua/generated/value_lookup_generated.md
and https://github.com/rusefi/rusefi/blob/master/firmware/controllers/lua/generated/output_lookup_generated.cpp

and found:
isIgnitionEnabled
Enable ignition - This is default off for new projects as a safety feature, set to "true" to enable ignition and further ignition settings.

but none of the example scripts is using "isIgnitionEnabled".
Any hint where to look?
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: motor cycle "safety system" - how to implement?

Post by AndreyB »

Those are from https://rusefi.com/online/view.php?msq=1349&dialog=injectorConfig and similar ignition dialog.

Tool-tips were wrong I've just wiped those out.

https://github.com/rusefi/rusefi/wiki/Lua-Scripting#getcalibrationname has an example

Code: Select all

getCalibration("cranking.rpm")
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

Re: motor cycle "safety system" - how to implement?

Post by mi-hol »

Apologize, but none of the answers above makes sense to me.
Did you maybe want to reply to a different question ?
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

Re: motor cycle "safety system" - how to implement?

Post by mi-hol »

As the topic was resolved on Slack here is the summary:

the text "isIgnitionEnabled
Enable ignition - This is default off for new projects as a safety feature, set to "true" to enable ignition and further ignition settings."
is plainly wrong and was removed, such a function NEVER existed in LUA
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

Re: motor cycle "safety system" - how to implement?

Post by mi-hol »

nmstec wrote:
Tue Jan 03, 2023 4:37 pm
OEM bikes: kick stand must be up, or clutch applied to crank. Must be in neutral. Tip over only 85*. Kill switch should kill main ecu power (Unless canbus, in this case shut off fuel pump, injection, and ignition).
Thanks for reply, in the meantime I found that the safety system is actually implemented independent of ECU.
This removed the requirement to implement it via a LUA script.
Tornado.Electric.Safety.System.png
Tornado.Electric.Safety.System.png (57.96 KiB) Viewed 5375 times
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
Post Reply