CAN Lighting Board Firmware

 

Introduction

This document describes CAN lighting board firmware. Check out the sub-pages and warg-internal documentation for more information.

Project Repo:

Sys Arch:

EE Top Level: Lighting Boards

POC

  • @Anthony Luo Software architecture & Board firmware

  • @Folarin Fatola (Unlicensed) LED Drivers, Lighting Control, & Board firmware

  • @Nick Armstrong CAN Drivers, Ardupilot Communication, & Board Firmware

Architecture

See Central LED control architecture and Single-Board LED Control for more detailed description. At a high level, there are 3 layers of control.

  • System level control is dictated by ardupilot (+ the pilot).

  • Board level control is handled by the primary controller.

  • LED level control is provided by each boards MCU.

This allows us to break our system into a few categories:

  • LED Driver

  • Board Lighting Controller

  • Central System Lighting Controller + Ardupilot Communications

Note that the boards will set different LED’s for each command domain depending on the drone state. Certain drone states will also enable certain command domains immediately (i.e.: landing lights).

Milestones

These are very brief. Who knows what we do with them.

M1 - Basic Functionality - F24 EOT

Achieved using REV3 lighting boards

LED Control

LED Boards light up & are controllable colour.
Individual LED’s are controllable via Software.
Controllable LED brightness scaling

Board Control

Synchronization between all board-LED’s possible (i.e. fade all together)
Strobe functionality achieved (either main WHILE loop or timer interrupts)
Receive CAN communications & set colour appropriately.
Basic LED command domains

Central Control

CAN Communication with ardupilot possible
Communication (any packet) between LED boards possible (can be on unique bus)
Set colour and/or brightness over CAN (can be on unique bus)
Enable command domain over CAN (i.e. turn strobe on/off).
If possible - turn strobe ON when we receive ardupilot messages, otherwise turn it off.

M2 - “Advanced” Lighting Control - Ideally ready for COMP

To be achieved using REV4 lighting boards

LED Control

State reporting
HSL/HEX conversions available

Board Control

Understand / retain position of board on drone
State reporting
Receive SYNC messages & re-synchronize to Central Controller
Receives “flight / ground / landing / emerg / off” flight states
State machine for flight / ground / landing / off, including standard LED configurations for each domain in each state.
Emerg search light functionality if NO can message’s received after timeout.

Central Control

Integration level

M3 - Stretch Goals for future

This probably includes at least another spin of a special central control node. That’s not so bad because we could have one node on each warg drone and then all the warg drones can have lights that sync with each other. pretty hype.

 

 


OLD / archive

Introduction

The purpose of this document is to describe the plan for writing the firmware for the lighting board LED Board Rev 2. The board is planned to be used for competition drone for the AEAC 2025 competition Lighting Integration 2025.

The firmware for this project can be found in this Github repository: GitHub - UWARG/efs-can-lighting: Firmware for WARG custom lighting board, communicate to Arudupilot over CAN bus..

Background

After conduction some research, we found that Ardupilot is capable of supporting LED DroneCAN peripherals DroneCAN Setup — Copter documentation. We also found that DroneCAN can send a LightCommand message that can provide RGB data of the LED color.

Plan

The plan is to read and decode the LightCommand message and light up the LED’s based on that data in the messages.

Setup a Simple CAN Node

The goal of this step is to setup a simple CAN node that listens for the heartbeat message from Ardupilot.

Request and Receive a LightCommand Message

  • TODO: Add to this section of the plan

Parse LightCommand Message and Interpret Data

  • TODO: Add to this section of the plan

Set LED to Requested Color

  • TODO: Add to this section of the plan

Contributors

  • @Folarin Fatola (Unlicensed)

  • @Mihir Gupta