speeduino icon indicating copy to clipboard operation
speeduino copied to clipboard

Add support for RusEFI CAN Wideband based on STM32F042

Open dynfer opened this issue 1 year ago • 7 comments

This PR allows the use of the CAN controller created by the RusEFI project based on the stm32f042 and stm32f103. The module works on ID 400 and can be further expanded for example to enable the heater once the engine is running.

dynfer avatar Dec 11 '23 21:12 dynfer

I would also recommend at least checking the valid bit. I'm not sure if Speeduino has support for "this sensor is present but currently not working" or not, but blindly reading the lambda field without first checking validity (at least to set lambda=0 or something) could have unexpected behavior.

mck1117 avatar Dec 12 '23 10:12 mck1117

@mck1117 what is the expected range of the controller? 0.5 - 1.4?

dynfer avatar Dec 12 '23 10:12 dynfer

This is somewhat compatible with AEM CANbus protocol it should probably be mentioned somewhere?

rusefillc avatar Jan 01 '24 20:01 rusefillc

This is somewhat compatible with AEM CANbus protocol it should probably be mentioned somewhere?

Yes we discussed this already with @noisymime to make it more general to allow for easier use of other CAN wbo solutions like AEM or EcuMaster.

Also thanks for pointing out the typo and case mismatches.

dynfer avatar Jan 01 '24 20:01 dynfer

This is somewhat compatible with AEM CANbus protocol it should probably be mentioned somewhere?

No, it isn't. That protocol was abandoned in favor of the current one.

mck1117 avatar Jan 02 '24 01:01 mck1117

I made some small changes to this so that it can be expanded to other module in the future (IE the rusEFI module is just the first and only in the list, but others can be added when written).

One thing I did come across when looking at this though is that the check for the CAN msg ID is separate from the other CAN reads, which makes me wonder what happens if this is on a bus that has many other messages on it.

If there is already another msg waiting in the CAN buffer, the check for id's 0x190 or 0x192 will always fail. At best it will mean that the O2 signal is not read until the next 30Hz cycle, at worst they may never get read.

Has this been tested with other CAN devices broadcasting or on an isolated bus only?

noisymime avatar Jan 11 '24 23:01 noisymime

@mck1117 do You recall the update rate of the controller? 50hz?

dynfer avatar Jan 12 '24 22:01 dynfer