On/off inputs from CAN?

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Post Reply
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

On/off inputs from CAN?

Post by MWPau »

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.
dontz125
Super MS/Extra'er
Posts: 4200
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: On/off inputs from CAN?

Post by dontz125 »

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.
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: On/off inputs from CAN?

Post by jsmcortina »

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 repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
dontz125
Super MS/Extra'er
Posts: 4200
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: On/off inputs from CAN?

Post by dontz125 »

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?
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: On/off inputs from CAN?

Post by racingmini_mtl »

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
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Post by MWPau »

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.
pit_celica
Master MS/Extra'er
Posts: 682
Joined: Tue Jul 18, 2006 3:12 pm

Re: On/off inputs from CAN?

Post by pit_celica »

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
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Post by MWPau »

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.
sturgeo
MS/Extra Newbie
Posts: 21
Joined: Sat Aug 21, 2010 8:44 am
Location: Northants

Re: On/off inputs from CAN?

Post by sturgeo »

Did you get any further with this?
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Post by MWPau »

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.
sturgeo
MS/Extra Newbie
Posts: 21
Joined: Sat Aug 21, 2010 8:44 am
Location: Northants

Re: On/off inputs from CAN?

Post by sturgeo »

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.
Suprazz
Master MS/Extra'er
Posts: 499
Joined: Mon Jan 22, 2007 7:58 pm
Contact:

Re: On/off inputs from CAN?

Post by Suprazz »

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!
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: On/off inputs from CAN?

Post by MWPau »

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.
sturgeo
MS/Extra Newbie
Posts: 21
Joined: Sat Aug 21, 2010 8:44 am
Location: Northants

Re: On/off inputs from CAN?

Post by sturgeo »

MWPau wrote: I'm glad i didnt :lol:
I'm glad i'm no further along with this project and haven't gotten to this stage yet :D
I have got some spare arduinos again now though, might hook up the MS3X to the JimStim & CAN circuitry to test the principal.
Post Reply