Page 1 of 1

motor cycle "safety system" - how to implement?

Posted: Mon Jan 02, 2023 9:59 pm
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

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

Posted: Mon Jan 02, 2023 10:49 pm
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

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

Posted: Mon Jan 02, 2023 11:09 pm
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

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

Posted: Tue Jan 03, 2023 11:24 am
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?

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

Posted: Tue Jan 03, 2023 11:25 am
by AndreyB

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

Posted: Tue Jan 03, 2023 4:37 pm
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).

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

Posted: Thu Jan 05, 2023 12:02 pm
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?

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

Posted: Thu Jan 05, 2023 12:25 pm
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")

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

Posted: Thu Jan 05, 2023 1:55 pm
by mi-hol
Apologize, but none of the answers above makes sense to me.
Did you maybe want to reply to a different question ?

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

Posted: Thu Jan 05, 2023 5:01 pm
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

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

Posted: Thu Jan 05, 2023 5:09 pm
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 6212 times