ElectricMotorcycleForum.com

  • November 25, 2024, 04:35:38 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: 1 [2]

Author Topic: canbus (technical)  (Read 3638 times)

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site
Re: canbus (technical)
« Reply #15 on: November 06, 2017, 01:41:20 PM »

(I've waited a while until I had the time to go look everything up properly before replying to this thread.)

I would summarize the kill switch safety concern as a lack of fail-safe consideration in the design.

Fail-safe principle: https://en.wikipedia.org/wiki/Fail-safe

Any safety mechanism should have fail-safe considerations built in.

For example, the Sevcon Gen4 controllers have switch concepts built in like FS1, deadman, and seat switches.
- FS1 locks out the throttle, and helps implement an interlock when switching between forward and reverse modes.
- A deadman switch to lock out drive mode and engages a brake (which they recommend against for highway vehicles).
- A seat switch can also lock out drive mode / throttle operation.
- Wire-off detection for the throttle which the 2015+ Bitron throttle probably supports more directly than the older

According to https://en.wikipedia.org/wiki/CAN_bus, CAN is a serial "multi-master bus", meaning that more than one node must initiate a transfer.

The choice to route the kill switch (and the kickstand switch to a lesser extent) through the MBB means that an MBB deadlock or livelock prevents activation of the interlock.
- The design flaw is in requiring an active element of forwarding a signal from the MBB to the controller.
- The cutout switch should just have been a digital signal to the controller; I can't think of a critical reason for the MBB to be directly in the loop.
- One could argue why not make it sort of a DPDT switch to send signals to both at once in case the MBB needed to react as quickly as the controller, but that does introduce another unnecessary point of failure.
- I'm guessing that Zero engineers felt that the Sevcon couldn't manage the shutdown itself for some reason (where the MBB would have been notified by the controller of the event secondhand).
- Maybe there was a decision based on information we don't have (technical or political), but no real answer is going to be satisfactory.

Now, this is relevant to anything we discuss doing on our Zero's systems!
- As is now clear, downloading logs in drive mode is a heavy batch operation and we can easily advise against this.
- However, the category of live telemetry operations by calling the MBB directly is inherently risky (and I've heard hints about that as a direct experience).
- Complicating matters, we can't test this without putting the bike on a (dyno?) stand and trying polling rates and backoff strategies while trying to operate the bike at various RPMs.

In short, live telemetry will require a careful mix of tuning polling rates against the data volume requested; so more signal values will require a lower polling rate. And it's likely that one would want to batch the requests or something and only let one telemetry app operate at a time (as in: don't run the OEM app concurrently with any other telemetry app).

It just occurred to me that perhaps the instrument cluster only gets sent messages for values it's configured to display. So, it's hypothetically testable that one could reduce the load on the MBB for another telemetry app by selecting values to display on the dash that are configured to update less often. Maybe.

It's rumored that 2017+ model years' MBBs are more robust (with faster CPUs and larger RAM capacities), but running out of buffer or I/O dispatch capacity or such on a small board could still happen. Also, I'm gathering that every year's MBBs have different physical connectors which precludes any reasonable retrofitting for older models.


I have no answers to this, but it seems responsible to spell out the implications. I've updated the MBB section a bit for this:
https://zeromanual.com/index.php/Unofficial_Service_Manual#Main_Bike_Board
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

Electric Cowboy

  • Hero Member
  • *****
  • Posts: 605
    • View Profile
    • Miller's Premium Brand Electrons : YouTube
Re: canbus (technical)
« Reply #16 on: November 07, 2017, 04:53:55 AM »

Only way I know to saturate the bus is to pull logs. I don't know if you can do that while riding, but I would not recommend it anyway. Focus on riding while riding ;)

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1639
    • View Profile
Re: canbus (technical)
« Reply #17 on: November 07, 2017, 05:31:49 AM »

Only way I know to saturate the bus is to pull logs. I don't know if you can do that while riding, but I would not recommend it anyway. Focus on riding while riding ;)

Oh, is that what happens when I try to send BMS logs to email and then it takes forever and then fails?  I've never tried to ride while pulling logs, I've only done it when parked and charging.  Doing it while riding *does* sound like asking for trouble.

Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: canbus (technical)
« Reply #18 on: November 07, 2017, 06:38:43 AM »

I've watched the OBD port while trying to get BMS logs. LOTS of canbus errors.
Logged
2016 Zero FX, 2014 KTM 1190

anton

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: canbus (technical)
« Reply #19 on: November 07, 2017, 11:53:26 AM »

Pulling BMS logs (especially if you have firmware bug that results in ~1 hr download time) can definitely saturate the bus. Generally producing a lot of output over OBD port (logging for example) will result in messed up throttle response. I've experimented a lot with what works and what doesn't and MBB seems to have a concept of signal priority -- eventually it will respond to your inputs and when it does, everything seems to work fine. However if you let it "idle" (no inputs being sent to MBB), there's going to be a delay between your input and how bike reacts, sometimes as big as 1-2 seconds. Do take a note though, during normal usage this isn't something you have to worry about. Bluetooth communication isn't affected by this at all though, that doesn't seem to lock up MBB.
Logged

Shadow

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1085
  • 130,000mi electric since 2016
    • View Profile
Re: canbus (technical)
« Reply #20 on: November 07, 2017, 12:42:47 PM »

Only way I know to saturate the bus is to pull logs. I don't know if you can do that while riding, but I would not recommend it anyway. Focus on riding while riding ;)

Oh, is that what happens when I try to send BMS logs to email and then it takes forever and then fails?  I've never tried to ride while pulling logs, I've only done it when parked and charging.  Doing it while riding *does* sound like asking for trouble.
There's a theory that a lot of data is being transferred but not written out, especially if you've had any ride-through faults. I may be misunderstanding this it could be a simple bug. However if what I heard applies, then if you have a ride-through fault there's a lot of data that not even the dealer can access, or that is what it sounded like was being explained to me. So having many ride-through faults in this theory would mean a huge quantity of data and making the transfer take a long time.
Logged

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1639
    • View Profile
Re: canbus (technical)
« Reply #21 on: February 19, 2019, 12:02:08 AM »

> ... Bluetooth communication isn't affected by this at all though, that doesn't seem to lock up MBB.

That makes a lot of sense, since bluetooth (I think) is a slower protocol.
Logged
our knowledge about Zeros collects here: https://zeromanual.com/

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1639
    • View Profile
Re: canbus (technical)
« Reply #22 on: June 07, 2019, 12:46:32 PM »

Logged
our knowledge about Zeros collects here: https://zeromanual.com/

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1639
    • View Profile
Re: canbus (technical)
« Reply #23 on: August 27, 2019, 12:27:05 AM »

Looks like lower cost Linux-based hardware is now available.

https://copperhilltech.com/blog/lowcost-doityourself-can-bus-to-wifi-bluetooth-ble-usb-rs485-gateway-based-on-raspberry-pi-zero/

Indeed, now even cheaper.

I was able to successfully control charging units with this setup this past weekend:

1. rasperry pi zero wireless with headers $14, e.g. https://www.adafruit.com/product/3708

2. waveshare rs485 can hat $14, e.g. https://www.waveshare.com/rs485-can-hat.htm

3. high endurance micro-sd card, $11, e.g. https://smile.amazon.com/SanDisk-Endurance-microSDHC-Adapter-Monitoring/dp/B07P14QHB7/

items needed you may already have, no cost assigned:

And of course you need the usual Raspberry Pi

micro-sd cable (you probably have one)

5V 2A+ usb power supply

And to set up for wifi connectivity, etc:

micro-USB OTG keyboard, or OTG adapter and standard keyboard

mini-HDMI connection to a TV or monitor



Logged
our knowledge about Zeros collects here: https://zeromanual.com/

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1639
    • View Profile
Re: canbus (technical)
« Reply #24 on: August 27, 2019, 02:23:28 AM »


[/quote]Good info; thanks!
OK, that said, speaking as a computer scientist I find this a bit confusing. "digital protocol" sounds like: I say ABC to you, you reply BBC to me, I say XYZ, you reply "WTF." On the other hand, a 120 ohm resistor is hardware, which is a specific implementation of a protocol. Could you clarify?  Thanks in advance!
[/quote]

https://www.ixxat.com/technologies/all4can/can-news-blog/can-news-blog/2017/09/22/rs485-vs.-can

OK, so I think I can describe more clearly now that I've read that link, that canbus uses RS485-style physical layer, and implements packetization and prioritization and error detection on top of it.


Logged
our knowledge about Zeros collects here: https://zeromanual.com/
Pages: 1 [2]