CAN message gain

Post Reply
User avatar
Peter
Posts: 310
Joined: Fri Dec 14, 2018 9:07 pm
Location: North West Lancs, UK
Been thanked: 8 times

CAN message gain

Post by Peter »

HI Forum. Is it possible to set a divider in the gain area when mapping a CAN message ? I am transmitting 'Turns' to use for odometer but would like to divide the Turns value by 422 so Turns increments by 1 every 1/10th mile. Fingers crossed its possible :-) Thanks. Peter
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: CAN message gain

Post by EV_Builder »

Cant the receiving party do that? makes perhaps more sense because they know the ratio?
If i understand correctly what you want you also would need something like a counter so when you have sended the message you reset to zero and next time you send the delta, not?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
Mojave
Posts: 29
Joined: Tue Dec 03, 2019 9:50 pm
Location: Los Angeles, USA

Re: CAN message gain

Post by Mojave »

Peter wrote: Sun Jul 11, 2021 10:41 am HI Forum. Is it possible to set a divider in the gain area when mapping a CAN message ? I am transmitting 'Turns' to use for odometer but would like to divide the Turns value by 422 so Turns increments by 1 every 1/10th mile. Fingers crossed its possible :-) Thanks. Peter
Couldn't you use (1/422) as the gain? i.e. use a gain of 0.0023697 (that's 1/422) as the gain?
User avatar
Peter
Posts: 310
Joined: Fri Dec 14, 2018 9:07 pm
Location: North West Lancs, UK
Been thanked: 8 times

Re: CAN message gain

Post by Peter »

Thanks for the ideas. I can indeed divide the CAN by 422 in software but was trying to reduce the loop time on my Arduino.
Post Reply