Living in big city is great, but it also has some downsides - long commute time is one of them. To solve that problem I decided to build skateboard with electric motors. But I wanted it to have wheels big enough to ride over small curbs and holes + it needs to look awesome. So here I present to you- electric mountainboard.
The board has quite a few electronic devices on board. Motor controllers, power switch, control unit, rear and front lights drivers tied together with mighty CAN bus. Designing and bulilding of those devices was pretty demanding - they have to handle high currents, occupy limited space and endure humid environment with temperature varying from -10C to 40C (or more).
Motor controllers (VESC)
You might've heard about VESC project. VESC is an open source ESC for BLDC motors. Firmware and design files (KiCad, yay!) are available, so everyone can assemble one of those. I decided to use VESC mainly because it has current control mode (i.e. throttle position is interpreted as desired current, not rotation speed) and cool communication interfaces that can be used to read data from controller during operation (such as current, temperature, rotation speed and many more).
Using this controller was also a bit of a challenge for me - soldering 0603 SMD components, beefy D2PAK-7 transistors with huge ground planes and DCA package with ground pad below the chip.
VESC can run with constant current of around 60A, so proper heatsinking is necessary. The VESC project itself does not cover this, so I had to come up with my own design. Slightly modified (height shortened) heatsinks with ribs were used, attached to MOSFETs cases with thermal glue and secured by 3D printed mounts. I also designed capacitor mount to hold additional capacitor (used to reduce voltage spike during rapid current draw changes).
Power Distribution Board (PDB)
One of the common problems in electric vehicles is proper power supply filtering. Drivers can quickly change current that is drawn from the batteries (they can also charge the batteries during braking). Another problem is wiring - power wires are thick and no ad-hoc solutions can be used (batteries can easily deliver over 500A when shorted, so one have to be really careful). To properly handle aforemendtioned issues I designed additional PCB that I called Power Distibution Board (PDB).
The board can be populated with 5 2200uF capacitors and it has cutouts for 4mm gold connectors (so that I can disconnect the wires when I need to).
Drivers Unit Controller (DUC)
Another device inside drivers case is called DUC, but I should've can it simply rear lights controller, because it mostly does just that. Shortened schematic is shown below. It uses STM32F042K6T6 to receive CAN messages (SN65HVD23 CAN transceiver). The rear lights modules are controlled by constant-current LED driver (Polish design, called PI14V2). The board also has transistor that can be used to control fans (which are not mounted at the moment).
Rear Lights (RL)
To improve safety a bit (and to make the board look more fancy ;) ) I created Rear Lights module, which consists of 9 LEDs. I chose LED model and count so that one module draws around 200mA @ 7V (so around 1.5W).
Power Switch (PS)
One of the requirements that I set for this project is being able to turn the board on with one flick of a switch/button. This greatly simplifies board usage on day-to-day basis. To achieve this goal I had to design a proper power switch. I decided to go with N-channel MOSFETs. They introduce slight ground potential difference between Control Unit and devices inside drivers case, but thanks to CAN bus that't not a problem! I used 4 IRFS7530 MOSFETs (same as in VESC), which have typical Rds of 1.15 mOhm. One afterthought is that four transistors are a bit of an overkill (they don't heat up at all during normal board operation (~30A)), but thanks to that the voltage drop (and power losses) is smaller.
Power Switch also has cutouts for 4mm gold connectors to connect battery wires and wires that deliver power to drivers unit. I also added balancer connectors to create 16Ah 6s2p battery pack (from two 6S 8Ah Li-po batteries). Those connectors are also used during charging.
Ignition switch is also connected to this board. The switch controls Q6 transistor, which is used to deliver power to Control Unit.
Control unit (CU)
Control Unit is used to communicate with a mobile device (via Bluetooth), measure battery cells voltages and control Power Switch. It can also control display on top of the case (not assembled yet).
Constant current LED driving again, but this time I decided to go with my own constant current driver (controlled by MCU).
Firmware/SoftwareChibiOS is used on all devices with a MCU (VESC, CU, DUC). It simplifies firmware development and provide many useful mechanisms.
One of VESC advantage is that operation parameters can be accessed via CAN bus. But by default VESC sends limited information over CAN bus (eRPM, current and duty cycle). I wanted to have access to all important data - current, temperature, voltage, drawn load and so on. To achieve that I had to modify CAN status thread function, so that now all interesting data is sent over CAN bus.
Drivers Unit Controller
One interesting feature that I implemented is setting rear lights to 100% duty cycle (without blinking) when the board is braking (so when current is negative). Duty cycle and blinking mode (when the board is not braking) can be set via Andorid app.
I wanted to be able to log board operation parameters while riding, so that I can later see (for example) how drawn current changes over time. I decided to go with a mobile app that receives data via Bluetooth and saves it to CSV file. The app was created with my friend as a project for 'Java programming' course.
I used Autodesk Inventor to design all mechanical components. Most of the parts are 3D printed.
I used MBS Comp95 board as a base, together with Vector truck, Tri-Spoke hubs and T3 8" tyres.
Power transmission is achieved via chain. Chain gear is mounted to hubs using long bolts and dedicated spacers. Currently I use 40 and 10 teeth gears, which result is max speed of around 26km/h.
After many hours and a lot of iterations I ended up with pretty solid 3D printed mounts and so far they work great. I used FEM analysis to improve my design.
As the board can flex quite a bit, I had to design clever battery case mount.