On/off inputs from CAN?

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

On/off inputs from CAN?

Postby MWPau » Wed Feb 15, 2017 8:06 am

Hi all,

Is there a way to use on/off inputs from "can receiving" type data?
I would like to use a CAN switch panel to enable/disable antilag, table switch, etc, etc.

Thanks.
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
MWPau
Experienced MS/Extra'er
 
Posts: 348
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Postby dontz125 » Wed Feb 15, 2017 5:05 pm

Sure! Take fuel table switching as an example. You need to turn 'Fuel table switching' ON, then set 'Switching input source' to Hardware. In the drop-down box, in addition to all the physical inputs on the MS3, you'll also find CANIN1-8. These are input pins on the CAN device. Obviously, you also need to configure the CAN device and the MS3 CAN section in TS.
dontz125
Super MS/Extra'er
 
Posts: 3539
Joined: Mon May 11, 2009 7:14 pm
Location: Scarborough, ON

Re: On/off inputs from CAN?

Postby jsmcortina » Wed Feb 15, 2017 5:07 pm

I think the OP is after a way to use the generic "CAN Receiving" to listen out for standard CAN messages and set that data into "CANIN". That's not presently possible, though doesn't sound too difficult.

James
I can supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33984
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: On/off inputs from CAN?

Postby dontz125 » Wed Feb 15, 2017 5:29 pm

Alrighty then ... Unless I'm misunderstanding how this works, it IS do-able, but it's a 4-window process.

1) Set up CAN Receiving to receive info for 'Local variable / channel' CANADC01; details for that is left as an exercise for the student :lol:
2) Set up Generic Sensor01 'Sensor - Source' as CANADC01; use 'RAW' transformation
3) Set up Loop1 (in Programmable On/Off Outputs2) to activate when Sensor01>1000, hyst 100 (assuming a Turn On = Going High)
4) Set up Fuel table switch as above, except the Input pin is set to Loop1

Thoughts?
dontz125
Super MS/Extra'er
 
Posts: 3539
Joined: Mon May 11, 2009 7:14 pm
Location: Scarborough, ON

Re: On/off inputs from CAN?

Postby racingmini_mtl » Wed Feb 15, 2017 7:08 pm

jsmcortina wrote:I think the OP is after a way to use the generic "CAN Receiving" to listen out for standard CAN messages and set that data into "CANIN". That's not presently possible, though doesn't sound too difficult.

James

If you do have a look at this, it might be a good idea to do it in such a way as to cover all the polling groups defined in ms3_can.c so that the code can receive broadcast CAN messages (standard CAN and not Al-CAN) instead of polling for the data. These would be raw data that is treated the same as the current polled data.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 8012
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: On/off inputs from CAN?

Postby MWPau » Wed Feb 15, 2017 10:32 pm

dontz125 wrote:Alrighty then ... Unless I'm misunderstanding how this works, it IS do-able, but it's a 4-window process.
1) Set up CAN Receiving to receive info for 'Local variable / channel' CANADC01; details for that is left as an exercise for the student :lol:
2) Set up Generic Sensor01 'Sensor - Source' as CANADC01; use 'RAW' transformation
3) Set up Loop1 (in Programmable On/Off Outputs2) to activate when Sensor01>1000, hyst 100 (assuming a Turn On = Going High)
4) Set up Fuel table switch as above, except the Input pin is set to Loop1
Thoughts?


That might work, but :shock: :lol: .
There really should a better method than that.
Thanks for giving it some thought though :)

racingmini_mtl wrote:
jsmcortina wrote:I think the OP is after a way to use the generic "CAN Receiving" to listen out for standard CAN messages and set that data into "CANIN". That's not presently possible, though doesn't sound too difficult.
James

If you do have a look at this, it might be a good idea to do it in such a way as to cover all the polling groups defined in ms3_can.c so that the code can receive broadcast CAN messages (standard CAN and not Al-CAN) instead of polling for the data. These would be raw data that is treated the same as the current polled data.
Jean


Yes, that's correct James.
And Jean... it would be perfect if that could be the case.
I know it'll take some extra effort (probably quite a bit more), but really CAN inputs should also have a default value, and a timeout.

Same goes with outputs too for that matter... fan control, fuel pump control, etc all over standard can bus packets.
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
MWPau
Experienced MS/Extra'er
 
Posts: 348
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Postby pit_celica » Fri Feb 17, 2017 10:49 am

It might be a good idea if you posted the CAN switch panel you plan to use with the related CAN Comm doc for this product. If they use a standard CAN frame (like J1939), maybe MS could use it more easily.

Sam
pit_celica
Master MS/Extra'er
 
Posts: 631
Joined: Tue Jul 18, 2006 3:12 pm

Re: On/off inputs from CAN?

Postby MWPau » Sun Feb 19, 2017 1:42 am

It doesn't exist because i haven't made it yet ;)

J1939 is a standard, but its not "the" standard, and there is no need to over complicate CAN coms by using such systems (the MS CAN bus command/packet format is a good example).
Keep it simple like most other aftermarket ECUs do. An address (11bit or 29bit), and 8 bytes of packed variable data, or a shorter packet of on/off value bits.
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
MWPau
Experienced MS/Extra'er
 
Posts: 348
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Postby sturgeo » Sun May 07, 2017 4:38 am

Did you get any further with this?
sturgeo
MS/Extra Newbie
 
Posts: 17
Joined: Sat Aug 21, 2010 8:44 am
Location: Northants

Re: On/off inputs from CAN?

Postby MWPau » Mon May 08, 2017 7:56 am

Nope.
I'm hoping its on a MS3 firmware to-do list somewhere, but the lack of response means i'm not holding my breath.
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
MWPau
Experienced MS/Extra'er
 
Posts: 348
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Postby sturgeo » Tue May 09, 2017 2:16 am

I've got a CAN controller & transceiver on the way to use with an Arduino, will be using 11bit addresses and standard frames to keep it simple.
I'll be using it primarily for analog control inputs (boost table blend for example) however it'll be nice to free up some of the Digital Ins on my MS3X.
My idea was to send specific values (255/0 for on/off) and use dontz125's 4 way method, not sure on the overheads this'll create but being able to set this up directly in the "CAN Receiving" tab would be advantageous.
sturgeo
MS/Extra Newbie
 
Posts: 17
Joined: Sat Aug 21, 2010 8:44 am
Location: Northants

Re: On/off inputs from CAN?

Postby Suprazz » Wed Jan 03, 2018 6:28 am

Best looking and most advanced CAN-bus gauge
Toyota Supra 7MGE, 7M-GTE and 1JZ-GTE Plug and play ECUs: http://www.perfecttuning.net
Serial to Bluetooth or Serial to WiFi
DIYAutotune Canadian, EFI Source and ECUMaster reseller!
Suprazz
Master MS/Extra'er
 
Posts: 411
Joined: Mon Jan 22, 2007 7:58 pm

Re: On/off inputs from CAN?

Postby MWPau » Sat Jan 06, 2018 6:54 pm

MWPau wrote:Nope.
I'm hoping its on a MS3 firmware to-do list somewhere, but the lack of response means i'm not holding my breath.


I'm glad i didnt :lol:
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
MWPau
Experienced MS/Extra'er
 
Posts: 348
Joined: Thu Mar 03, 2011 6:24 pm


Return to MS3 Development

Who is online

Users browsing this forum: No registered users and 0 guests