View Single Post
Old 02-12-2019, 12:56 PM   #3374 (permalink)
thingstodo
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by MPaulHolmes View Post
I did CAN last year, and got it working, and added it onto the newer boards, but I haven't included it since I wasn't really sure what to do with it. I had one board that sent a can throttle message to another board, and then spun a motor, but wasn't sure what to do beyond that. Also, i didn't know the proper format for anything. It was just a made up packet structure. I wasn't familiar with "can to computer" stuff or whatever, and just wasn't sure what to do, so I haven't really gone anywhere with it.

Is there a specific format that things should be sent? And where does it get sent to? And is there a device that sends things to the controller?
I don't believe that there is a specific 'format' to follow.

From Jack Rickard's postings (EVTV.me) on CANbus, the general idea is that the standard packet is 8 bytes. You can split them up into whatever groups you want. Some bits, some bytes, some words.

I would expect that you would accept a command packet with ... maybe :
- rotation forward as a bit
- rotation reverse as a bit
- regen enable as a bit
... and the other 5 bits to be assigned later

Maybe the next 6 bytes split up into 12 bit numbers ... for a speed setpoint, a torque setpoint, a braking setpoint, and a spare setpoint?

That leaves one 8-bit bye as spare at the end

Taking the info that you already generate for status and putting it into the 8 byte format ...
8 bits of status, showing forward rotation, reverse rotation, regen in progress , maybe accelerating, decelerating, and at speed/torque
Present speed in rpm, 0 - 4096 (or maybe rpm / 2 if you need to go over 4000 rpm), torque current 0 - 400.0 for the 0 - 4096 counts, regen current ... and a spare?
The last byte could be a status/fault code ...

You can also use multiple packets. So one packet could be setup information .. like the inductances for the motor, accel and decel rates, throttle range settings, and anything else you can think of

@jackbauer - any requests? Does it make sense to match something that Tesla or some other manufacturer already has so that third party displays work?
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!
  Reply With Quote