Telemetry Board


DescriptionVehicle data collection and wireless transfer
Target releaseMSXII
Epic

ELEC-64 - Getting issue details... STATUS

Document owner
Project leadsKarl Ding
Team membersAleksa Bjelogrlic (Unlicensed)

Goals

  • Wirelessly relay vehicle telemetry data sent on the CAN bus to the laptop device in the chase vehicle
  • Provide GPS positional data via a GPS receiver (that the microcontroller communicates with over either UART or SPI)
  • It should "just work"

Background and strategic fit

The proposed approach was originally inspired after a realization that having a working real-time telemetry system would be really useful for the race. Our previous "telemetry system" involved the driver periodically radioing back sensor data displayed on the vehicle dash to the chase car. The main purpose of this system is to provide the individuals in a chase car with real-time data that will help monitor performance of the solar car. This will allow team members to adjust our race strategy accordingly.

We wish to have a real-time telemetry system that allows us to gather data from the solar car and transmit it via wireless link to an external client (in a chase car). This information will be provided by sensors and a dedicated telemetry board, which will be transmitted to a remote laptop in the chase car. Optimum path and usage plans can also be created using the transmitted data, to optimize performance from the car and solar panels.

The telemetry system allows us to monitor performance through stored and real-time data (including battery voltage and current, the vehicle power consumption, the power generation from the solar panels, the temperature of the cells and battery pack, the vehicle speed and location, the faults and status signal from the controller, and GPS). In addition, having telemetry data allows us to tailor our strategy, and ideally recognize potential issues and trigger alerts before they become serious issues. Since data will be retained (ideally forever), we can also use this data to identify where improvements can be made in future designs.

The goal is to offload as much work to the more powerful desktop client as possible, so that essentially the telemetry board on the car simply wirelessly streams CAN message data out.

Assumptions

  • The client will be on a laptop in the chase car
  • Most of the data-processing will occur on the more powerful device (in the chase car)
  • The telemetry board will sit inside the car, and listen on the CAN bus

Requirements

#TitleUser StoryImportanceNotes
1On-board message/data storageThe telemetry board should log any messages it sends onto a SD card. The on-board telemetry system should be capable of storing at least a day's worth of data (a day seems to start at ~9 and ends at 5, so 9 hours of driving?).Must Have
2Withstand operating temperaturesIf we're planning on attending WSC (where vehicle interiors have been known to exceed 50C), we should ensure that at minimum, our electronics can operate at 60C.Must Have
3GPS locationThe telemetry board should also be able to identify the location of the vehicle via GPS.

4Real-time data

Critical information should be presented in real-time. Battery pack data (voltage, current, temperature, state of charge) should be real-time.

It would be nice to have motor controller and MPPT data presented in real-time.

Must Have
  • Battery pack data
    • Voltage
      • Minimum Cell voltage
      • Maximum Cell voltage
    • Current
    • Temperature
    • State of Charge
  • Motor controller data
    • Voltage
    • Motor Current
    • Motor temperature
  • Maximum Power Point Tracking (MPPT)
    • Array Power
  • Status
    • Current cruise control value
    • Current limits

Server

The server will expose a websocket, supporting bi-directional communication between the server and a laptop computer. This allows us to implement server to the telemetry board communication in the future (if we want to say, inject CAN commands or something). Ideally, this will also run on the Raspberry Pi Zero, and be lightweight enough with no major dependencies. The reason for the websocket is to allow us to push data to the telemetry client as it arrives. This points to something like golang, which can be compiled, and runs fairly efficiently on the Pi.

Since the server must run on both the Raspberry Pi Zero and the laptop computer, at the moment we will not consider some log stream abstraction (like Kafka/RabbitMQ), due to the resource overhead they will impose. Should the requirements change in the future (or the throughput of the system calls for it, which seems unlikely), we will deal with that, and perhaps look at using a "real" database instead of SQLite.

In addition, the server should be decoupled from the data ingestion logic, so that if we decide to, say, put the telemetry server directly on the CAN bus, it's only a matter of rewriting the "connector" that feeds into the server.

Routes

The websocket will be pushed data directly as it is received. Any requests to the routes will hit the database, allowing the telemetry client operator to "explore" historical data. The server should also provide routes for the client to look at historical data. Here's an outline of the routes, they will be covered in detail later (this list is probably incomplete0.

  • GET /api/v1/batteries
  • GET /api/v1/batteries/{id}
  • GET /api/v1/motorcontrollers
  • GET /api/v1/motorcontrollers/{id}
  • GET /api/v1/mppts
  • GET /api/v1/mppts/{id}
  • GET /api/v1/messages
  • GET /api/v1/location?time={timestamp}
  • /ws/

Command Line Interface/Configuration

The command line interface should provide:

  • -port: specify the port the webserver runs on (and provide a sensible default)
  • -fake: randomly generate data (for testing)


Questions

Below is a list of questions to be addressed as a result of this requirements document:

QuestionOutcome
How much space do we need to store the CAN data?
Are we planning on implementing a new protocol on top of the CAN bus?Yes. The motor controllers will have their own network, and "our" CAN network will communicate with the motor controllers via an intermediate board that "translates" messages to the motor controller manufactor's specifications. See CAN Message Protocol for more information.
Filesystem vs treating the SD card as a binary blob?

Not Doing