Driver switch CAN

Support forum for users of the M1 Tune

Driver switch CAN

Postby chuckk on Fri Feb 14, 2020 2:30 pm

Hello guys,

Question regarding driver switch input. Lets say we have the input ressource via CAN.
CAN 0 offset 0
CAN 0 offset 2
CAN 0 offset 4
CAN 0 offset 6

I have my keypad buttons configured into my PDM (Message 0 with channels from 0 to 7) to send the activation to the M1. No I am not using the keypad directly with the M1.

The only time my driver switch status will activate is if I select offset ''2'' or ''4'' and use channel ''2'' or ''4''. Those are the only offsets I can activate my driver switch from toggling ''On'' or ''Off'' my keypad. The input voltage goes to 0.256V. If I choose to use lets say my channel ''0'' from my PDM, and use offset 0, it only changes from ''0'' to ''1mV''.

If I select offset 2 for example (and change my button to Channel 2 in PDM manager), it works.

And is there a way to see more than just 0.256V ?

Thanks for your help, I suck at this.
chuckk
 
Posts: 19
Joined: Sun Sep 30, 2018 1:15 pm

Re: Driver switch CAN

Postby AdamW on Fri Feb 14, 2020 7:06 pm

The M1 "generic CAN" inputs are assumed to be 16bit values representing mV. The PDM only sends out 8 bits and the standard message sends out a 0 for off and a 1 for on. So 1mV for on would be the correct/expected result.

There may be easier hacks, but this is how I would do it:
In the PDM set up a counter like this pic - this is just used to generate a constant value of 255 (ie fill up the second byte).

Image

Then you will set up the PDM CAN output message like below always using the same constant in the odd-numbered channels (LSB):

Image

In the M1 the keypad button 1 will be received as input CAN 0 Offset 0, keypad button 2 will be CAN 0 offset 2.
If I have it right (A big ?? here), your M1 input will read 255mV for off and 511mV for on. This should be enough to allow the threshold & hysteresis to work.
Motorsport Electronics Ltd.
AdamW
Pro User
 
Posts: 265
Joined: Wed Nov 16, 2011 10:08 am

Re: Driver switch CAN

Postby chuckk on Fri Feb 14, 2020 11:14 pm

Great ! I will give that a try !

Thanks a lot, it is much appreciated
chuckk
 
Posts: 19
Joined: Sun Sep 30, 2018 1:15 pm


Return to M1 Tune

Who is online

Users browsing this forum: No registered users and 4 guests