Close

Front Lights module assembly

A project log for Electric mountainboard with CAN bus + Android app

Mountainboard with BLDC motors, open source drivers, CAN bus communication, custom Android application and cool lights.

lukeLuke 06/27/2017 at 15:220 Comments

It's time to fire up the soldering iron and assemble some electronics.

Front Lights module is supposed to be mounted in front of the board and provide light, so that others can see me after dark (and I can see what's in front of me as well, cool).

My idea for this module is to create closed-loop current control system using buck coverter and MCU.

The MCU would measure the current flowing through the LEDs and adjust PWM duty cycle to achieve required current. I hoped that maybe I'd be able to implement model predictive control (MPC) (using DMC - Dynamic Matrix Control). Of course predictive algorithm would be an overkill in this application, but would be a pretty nice educational excercise.

So far I've assembled the circuit and tested it in open loop mode (no current measurement, just setting pre-programmed PWM duty cycle).

FL module in open-loop mode

Code is available on GitHub: https://github.com/Lukaszm94/Eboard_FrontLights

Currently open-loop brightness control is implemented, as well as blinking modes. Now I need to modify Control Unit software, so that front lights brightness and blinking mode can be changed via mobile app.

Discussions