Posted on Leave a comment

Battery Cycle Testing with Python, and E-Load, and Power Supply

A  lot of electronic loads (my Rigol DL3021A included) have a built-in ‘Battery Test’ function, either on the front panel or able to set up through the load’s accompanying software (See here for an overview of my lab hardware). This works fairly well if you’re just trying to run one cycle, but when trying to run multiple cycles you need to control the charging cycle as well. Keysight has the BenchVue software which allows coordination of multiple instruments together in drag-and-drop scratch-like scripts, but to get the full control over the cycles and parameters, you’ll want to control your instruments over SCPI with Python.

I’ve been wanting to test out some LG MJ1 cells for upgrading an old NiCD drill battery, and figured I’d take the opportunity to write a basic battery cell cycling program that I’ll be able to expand on in the future.

Before we dive into specifics though, I will preface with mentioning that I am not a firmware of software programmer by trade or by schooling, only out of necessity and interest – I can write code that works, but is not optimal. I know there’s a lot that could be done better and/or cleaned up in the code. If you want to contribute, send me a message and have a look at what I’ve got on Github!

Program Features

Basic GUI

While I am fairly familiar with command line tools, its always nice to have a GUI. Python makes that super simple with TKinter and EasyGui. A simple, linear flow of operations through popup windows is easy to implement, but in the future, having a full-featured program would be nice. A few images of the GUI screens are shown at the bottom of this post, but are not all that impressive – just the basic options provided.

Storing Test Settings to JSON Files

The settings for each charge and discharge cycle can be stored to a JSON file for easy recall for future tests.

Choosing Test Equipment

When setting up a test, it is good to be able to choose whatever equipment is available to you. The program has been set up to select whichever instrument series and visa resource is available to you.

While SCPI commands are supposed to be standard between equipment, there are a fair number of differences across different models for the more obscure features such as remote sense, front panel lock, and other such features. They often use different SCPI commands to activate these features, so I created a python class for each instrument will all the command specific to that instrument.

Multiple Test Choices

There have often been times where running different cycle types have been useful. There are multiple options for different types of cycles built in:

  • Run a single cycle at a set voltage, current
  • Run multiple cycles with the same settings for a set number of times
  • Run multiple cycles with 2 different settings for a set number for each cycle type and test cycles (e.g. discharge at 5A, charge at 2.5A for 1 cycle, then discharge at 10A, charge at 5A for 9 cycles, then repeat 5 times for a total of 50 cycles). This can be helpful for degradation testing and measuring capacity with a standard cycle at fixed intervals.

Storage Charge Option

Every test setup will ask if you want to charge the cell to a storage level as well. Leaving cells discharged after a capacity test can accelerate the degradation of the cells, and can lead to increased dendrite growth causing latent failures in the cells. Charging back up to a storage voltage (around 3.7V for li-ion cells) is always a good idea.

Data logging and Discharge End Detection

The discharge is finished when the cells reach a defined voltage in the test settings. The monitoring of this end condition can be improved quite a bit from the current implementation.

The data (voltage at current) is measured from the eload and power supply at the interval defined in the test settings. It compares these measured values to the end points, as well as logs them to a csv file. With this method of logging at a fixed interval and comparing to setpoints, we will over-discharge the cell at the end of the cycle if the actual voltage of the cell reaches the setpoint at the middle of an interval. I hope to improve the algorithm to attempt to match the curve of the cell during discharge, and predict the time that the cell will pass the threshold. Then turn off of the electronic load at the calculated time instead of waiting until the next measurement interval.

 

Data

Now for the interesting stuff. This has allowed me to do some long term cycle and degradation test for the Solar Car battery modules for the University of Waterloo. Eventually I’ll get around to making a proper summary of that data, but for now here’s a few cycles that I’ve done on some of the Samsung 25R cells I’m using to replenish an old NiCd power tool battery pack. They look pretty similar except for different state of charge at the start of the tests due to some other testing I was doing. These graphs are all spit out of another python program which also summarizes results such as capacity in Ah and Wh, final charge voltage, actual minimum discharge voltage, and max cell temperature if there was a thermistor also attached.

It is interesting to note that all the cells seem to still drop in voltage during the rest period after the discharge. I expect there may be some leakage current in the power supply or eload that is drawing them down – a problem for another day. For now, I’ll make sure not to leave them sitting overnight.

Posted on Leave a comment

Standing Desks from Frame kit and Plywood

About a year ago while working from home, I decided it was time to invest a little bit in my setup and get myself a standing desk. This page goes through a few of the decisions I made along the way and the general process I followed to build one.

Options

When I started looking it to getting a standing desk, I broke it down into 3 solutions:

1 – Buy a Complete Desk Frame and Top: this is fast but more expensive

2 – Buy a Desk Frame and Build a Desk Top: fairly quick and less expensive, you only need to cut down a finish a desk

3 – DIY Everything: more time to design and build and might be cheaper in the end

I went for option 2 – I bought a desk frame since I found one fairly cheap and wanted to have a standing desk in a reasonable timeframe (within 2-3 weeks). I built the desktop since I wanted to still be able to call the desk my own and I wanted to make it as big as possible to fit in my space at home – so I wanted a custom size.

Being someone that likes having a lot of desk space, I decided to make 2 desks and configure them in an L-shape. This gives enough desk space for multiple monitors, notebooks, and some electrical equipment. As I’m still in university and moving around a bit, having 2 desks made it easier to reconfigure for different living arrangements. In the 3 different locations I’ve had them set up since building them, they’ve been able to fit without issue.

Once built, I got the desks setup in my basement with dual monitors and some electrical equipment.

I should mention – I would not describe myself as an woodworker by any means, so take my suggestions with a grain of salt.

Making the Desk Tops

In my opinion, the cheap IKEA desktops are not worth it – they’re just veneer on chipboard, and are not very sturdy. Building your own gives you a much sturdier, solid piece of wood.

I bought a 3/4in thick piece of 4’x8′ maple-finished plywood from Home Depot for about $75, cut it down to the sizes I wanted for my 2 desk pieces, rounded the edges with a belt sander with 50 grit sandpaper, then sanded the edges with 120, then the whole thing with 220 and 400 grits. 400 grits at this point was likely not worth it, just got

I also made a cutout with a hole saw and a jigsaw in the middle of the desk at the back as an easy passthrough for cables.

Sealing the Desk Tops

For the protective coating, I used a Varathane water-based polyurethane sealer and stain in one, and did 4 coats of it with a light sand with 400 grit sandpaper in between coats. I picked the water based sealer since from what I read, it was pretty easy to work with – doesn’t stink, and dries quickly. From the quick research I did, oil-based stains and finished are generally harder to work with, and not worth the time for beginner woodworkers.

I did all that sanding/staining in my backyard over the course of 10 hours or so (with 2 hours between coats). Overall, the process was fairly easy, just required a bunch manual labor when sanding – which I was happy to get some exercise from.

Choosing A Desk Frame

I purchased the cheapest electric sit-stand desk frame that I could find. I figured they were all pretty much the same and likely come out of the same manufacturing plants anyways. At the time I made these, this was a $240 frame from PrimeCables.ca, which I  bought 2 of for my 2 desks. These are pretty sturdy (they do wobble a bit if they are at the standing height and you’re doing some heavy erasing) and have a huge range of adjustment. Super easy to assemble, and easy operation with simple up and down buttons.

Assembling the frame and the desks was fairly straightforward, and screws to the desk top with with 8 wood screws. I just screwed them directly into the plywood as I’m not expecting to need to disassemble it much, but using screw-in threaded inserts is also a good option to get slightly more permanent threads.

Posted on

New Lab Setup – Rigol and Electro-Meters

A few months ago, I started to be on the lookout for some better test equipment – an oscilloscope, multimeter, electronic load, and power supply. These would allow me to create a few projects that I’ve been thinking of doing for a while and didn’t have the right tools to get started. I had grown tired of borrowing equipment from various places and wanted a set for myself that I could use whenever I want.

Before we move on, a huge thanks to Electro-Meters for helping out with the equipment upgrade! I reached out to Electro-Meters, the local distributor for Rigol equipment, and they were willing to provide a discount in exchange for mention on these project logs and images of the products being used in my projects over the next little bit. They were great to deal with during the whole process! Check out their selection of equipment here.

What equipment to buy:

I do quite a bit of work with batteries, so having a power supply and electronic load to charge and discharge the batteries is a must. These are also super helpful for testing power distribution circuits and DC-DC converters. A multi-channel power supply (or 2 power supplies) was a requirement as I often find myself wanting to charge a battery and do something else at the same time.

A good DMM was also on the list as I need one that I can trust. I was getting tired of using the cheap handheld ones and trying to guess at what the voltage or current actually is. A few reasons for the upgrade from handheld to bench meters are below:

  1. For batteries, even a few tens of millivolts difference can make the difference between them being fine to connect in parallel or if they need to be balanced first.
  2. Keep other instruments in calibration. A 5.5 digit meter would have been good enough for typical battery or hardware debugging, but a 6.5 digit is even better for keeping power supplies in calibration.
  3. Fast measurement speed – when you’re testing voltage on 100 batteries, the fast measurement speed (Ability to change the NPLC count) of a bench meter makes everything a lot faster.
  4. Automating testing with a Python over SCPI. This enables automatic testing such as generating the efficiency curve of a DC-DC converter under different loads through a single python script. Remote sense inputs on the PSU/e-Load or extra DMMs are required to eliminate cable loss from the measurement.

Last but not least, an entry-level 4-channel oscilloscope can help debug the majority of bugs that may be encountered during bringup of a new board.

What brand to go with:

I wanted to go for some reliable equipment that wouldn’t break the bank but would also last a while and be fairly capable entry-level equipment.

I didn’t have much confidence in any of the cheap Aliexpress-style brands as I had seen way too many teardowns of them and don’t trust the quality. While it is often stuff that can be fixed pretty easily (noisy fans, cables too small, not enough mains isolation), I didn’t want to have to deal with it and wanted this equipment to be a tool and not a project.

Here in North America, Keysight equipment is generally regarded as some of the best test equipment, but it gets pretty expensive. A 6.5 digit multimeter would set you back about $1500.

I’ve used several BK Precision electronic loads and switching power supplies in the past, and have no complaints about them. They are solid pieces of hardware, and work great, but still a bit too expensive for me.

Rigol and Siglent are generally regarded as entry level test equipment, and they make a great product for the price, but on my student budget it was still a bit expensive.

The other reason I was swayed towards Rigol equipment was the reports of it being easily hackable through the activation codes to unlock extra accuracy and bandwidth capabilities. A few guides linked for the Oscilloscope here and the e-Load and power supply here. As most of the guides online mention, it was pretty straightforward to make these upgrades.

Models:

I purchased the following equipment at a discount from Electro-Meters:

  1. Rigol DS1054Z 4-channel Oscilloscope (Upgraded with protocol decoding and 100MHz bandwidth)
  2. Rigol DL3021 Electronic Load(Upgraded to DL3021A)
  3. Rigol DP832 3-channel Power Supply (Upgraded to DP832A). Remote sense is not available on this model, but having the DMM handy makes accurate measurements easy.
  4. Rigol DM3068 6.5-digit Multimeter

After upgrading the Electronic load and power supply, the characteristic color screens (as opposed to the single color displays on the non-A versions) were shown after a reboot. When you consider the added accuracy, they are a pretty good deal.

I’ve been spending some time setting up the SCPI commands to interface with these a get a full battery cycle test going, and will make a post for that soon.

Posted on Leave a comment

JLC PCB Assembly Service – First Time User Review

Overview

JLC PCB started an assembly service a while ago and I’ve been hoping to design a PCB to use it at some point. I started designing a PCB a while ago – the schematic went quick and then kind of forgot about it for a few months. The PCB is a 64 channel Data Acquisition Unit meant primarily to measure a large number of thermistors, but can also be used as a general digital I/O board.

Board Details

The board is not too complicated – pretty simple, but I wanted to try out a few different things, as well as making it as easy as possible to make and program. I used some chips with varying packages – QFN, TSSOP, and some 0402 passives. I chose a 4-layer board to keep it easy to design and have dedicated power and ground planes for easy layout. I chose ENIG as the board finish mostly because the gold just looks really good. I also put the A2D logo in the corner of the board in copper (remove the soldermask in this area) and kind of wanted this in gold.

As the design software, I used EasyEDA – not because I wanted to use it but because I didn’t want to spend the time to create all the component libraries in Altium. Its also really well integrated with LCSC (a chinese component supplier) and the JLCPCB order service (they are pretty much the same companies just different names for different divisions I think).

I ordered 10 boards with the following specs:

  • 150mm x 100mm outline
  • 4-Layer
  • 1-oz copper
  • ENIG finish (Electroless Nickel Immersion Gold)
  • Green Soldermask (required for the JLCPCB Assembly Service)

Quality

The Good

  1. The price – total was around $170 all shipping and import fees to Canada included
    • $65 for the boards
    • $53 for components and assembly
    • $23 shipping via DHL
    • $28 DHL import charges on arrival
  2. Really nice board finish – silkscreen, soldermask, and ENIG finish looked great!
  3. Boards worked – no shorts, etc.
  4. Assembly quality was great – no issues here 0402s and TSSOP packages were great! (QFNs were out of stock so I had to order those from Digikey and assemble it myself).
  5. The boards came packaged really well. I only have components on 1 side of my board, and they packaged them back to back and wrapped in the pink antistatic bubble wrap.

The Not-so-Good

  1. The sides of the board were a little rough – the panel removal left some material on the edges. Nothing that a bit of sandpaper can’t fix, and I can’t really complain for the price that the boards were.
  2. LCSC didn’t have some components in stock or low in stock, so I had to solder a few components myself after the boards arrived.
  3. There were some parts of the silkscreen that were cut off (the RESET at the top of the board). JLCPCB in the past used to be pretty good at catching things like this. I can’t fault them for this since it was my design mistake and I didn’t catch it.

Overall, for quick-turn prototype boards, I can highly recommend JLCPCB. Just make sure that you’ve designed your board and exported Gerbers properly – they will make exactly what you send them. The integration with LCSC makes it super easy to purchase components when you design it in EasyEDA but would require a litt

Posted on Leave a comment

Interfacing the 32-Channel ADG731 Multiplexer with the LTC6811 Battery Stack Monitor

Lots of people put guides online with simple steps to explain how to connect to and get data from ICs using a development board. Usually, the process in pretty simple. But for more complicated ICs, you’re not always that lucky. The first connection often takes some debugging. This is not a ‘simple guide to connect devices’ but rather a more careful look through the datasheets and debugging that is not often documented online. Engineering often has times when you’re looking for a needle in a haystack – or that 1 line in the 100 page datasheet that explains your problem. This post aims to document some debugging, which is much easier when you know that datasheets are not scary and measuring stuff is fun!

As part of the Battery Management System for the Midnight Sun Solar Car team at the University of Waterloo, I have been working on getting the external communication interface of the LTC6811 Battery Stack Monitor IC to interface with a large number of thermistors. We need to measure 2 thermistors for every group of 25 parallel cells on our battery pack as well as 1 ambient temperature sensor for every 2 series groups. The many ambient sensors are placed throughout the pack in an attempt to quickly identify spikes in ambient temperature that could be indicative of a cell venting. This adds up to a total of 30 thermistors per LTC6811 chip, plus a thermistor on the PCB for the balancing resistors.

An image of the battery modules is shown below:

To measure all of these thermistors, the external communication interface on the LTC6811 was used to communicate with the ADG731 32-channel analog multiplexer. The output of the multiplexer connects to one of the GPIO pins on the LTC6811 to be read as an Auxiliary analog input to the chip.

Testing and debugging this interface turned out to be a little trickier than planned. As usual, the answer was in the datasheets.

Let’s first get a bit of background on the ICs.

LTC6811

Datasheet for LTC6811-1: https://www.analog.com/media/en/technical-documentation/data-sheets/LTC6811-1-6811-2.pdf
Many images in this document are from the datasheet.
The LTC6811 is a 12 channel battery stack monitor by Analog Devices. It features 12 independant cell measurement inputs, and dedicated cell balancing pins. Communication to the chip happens over SPI, or by using the LTC6820 ICs an isolated isoSPI interface can be implemented. Also present an external communication interface that can be used to send either SPI or I2C commands to external devices. This is the external interface that is used to communicate with the ADG731.

ADG731

Datasheet for ADG731: https://www.analog.com/media/en/technical-documentation/data-sheets/ADG725_731.pdf
Many images in this document are from the datasheet.
This device is a 32:1 channel analog multiplexer, control with a CLOCK, SYNC, and DATA signals. It mentions that the interface is compatible with SPI (but there is a catch here – read on). The mux has an internal shift register which shifts data in from the DATA input on the CLOCK signals.

When connecting it all up and reading the Auxiliary analog inputs on the LTC6811, garbage data was observed, and probing around with a multimeter proved that the pin was indeed floating. So it seems the ADG731 output was never enabled.
All the hardware connections were double-checked with a multimeter to ensure proper connections and no shorts. Still no output, so  attention was turned to the firmware. Looking through the driver that the team (UW Midnight Sun Solar Car Team) had put together for it, a missing Packet Error Code CRC calculation was found in the WRCOMM command, and the COMM register byte order mistake were both fixed. A logic analyzer was used to check the communication interface to ensure that the LTC6811 was actually outputting data at this point, and it all seemed fine (or so I thought). Note that the SPI decoder in this image is set to SPI Mode 2, which is what the ADG731 would be reading.

Time to do a deep dive into the datasheets

Two pieces of info were found that Identified the problem:

1: The LTC6811’s external communication interface operates in SPI Mode 3. This means that the clock idles high, and data is shifted out on the falling edge and sampled on the rising edge of the clock (https://www.analog.com/en/analog-dialogue/articles/introduction-to-spi-interface.html).

2: The ADG731 shifts data into the input shift register MSB first, on the falling edge of the clock.

From this information, the LTC6811 external interface is not directly compatible with the ADG731 since the data shift phase is opposite. The LTC6811 will be shifting out new data  as the ADG731 is reading the bus. Looking at the logic analyzer output above, it can be confirmed that different data is sent from the LTC6811 than is received with the ADG731.

Fixing the Communication

Looking at the waveform on the logic analyzer and double checking on the oscilloscope, I figured the clock signal of the LTC6811 SPI Mode 3 interface could be inverted to achieve a waveform that would successfully clock data in to the ADG731 Input Shift register in the correct order. Essentially, this would turn the interface into SPI Mode 1 for the ADG731.

A simple circuit using a transistor and some pull-up resistors could be used to achieve this clock inversion. I had some 2N3904s on hand, but no small FETs so I went with that. The LTC6811’s GPIOs are open-drain. Just to be sure, as mistakes are often made in small analog circuits, I fired up LTSpice and made the schematic to make sure I wasn’t out of my mind. The circuit simulated as expected and we got an inverted signal on the output.

This trace of the CLK line shows the rise times on the inverted clock are a bit long, but a less ancient transistor and an SMD footprint should make them look a little nicer due to the reduced parasitics. The long GND lead on the oscilloscope probe is also likely playing in to some of the error here. We do see the important parts though – we have 8 clock cycles to shift the data in, and they rise above the 2.4V logic high threshold of the ADG731.

Connecting up the logic analyzer once more, the output was now correct. Here, switch 5 of the ADG731 is activated. The SPI decoder in this image is in SPI Mode 1, which the ADG731 would read correctly.

Here’s an image of the test setup and probing – yes, its messy and eventually I’ll get some better tools and equipment to make this all neater – but for now, this is all there is:

Some useful data was finally received through the microcontroller. I had connected some thermistors and fixed resistors to the mux inputs and measured the correct voltage values.

Conclusion

The datasheet is always right. It often amazes me how much information is stuffed in there, and that they manage to get all the relevant information across without mentioning silicon structure of the chips or anything like that – block diagrams are all they need.

The external communication interface and GPIO Auxiliary input pins of the LTC6811 was used to successfully read 32 thermistors through the ADG731 analog multiplexer.

Posted on Leave a comment

Design and Build of Prototype Battery Module

For the Midnight Sun Solar Car Team (uwmidsun.com), I have been designing a building a prototype battery module. This module must fit in to the pack to be modular, safe, easy to manufacture, easy to assemble, and have low power loss.

This module will be a 24P 2S module, made up of a variety of materials and sections. This was made so that all of the access points for the terminals will be on the top of the modules and we will not need to reach any tools into the bottom in order to put the pack together.

Layer stackup:

  • Gusset Plates (red and black) and Fuse Board
  • Top Section:
    • Acetal Cover Plate (Laser Cut)
    • Electrical Grade Vulcanized Fiber (Fish Paper) Insulation (Laser Cut)
    • EMS Sigma Clad 60 Busbar (Water Jet Cut)
    • Nickel Strips (3D Printed Bending Dies)
    • Acetal Cell Holder (CNC Machined)
  • Cells and Aluminum Standoffs
  • Mirror Top Section for Bottom

Mechanical Considerations:

The module has an acetal plate on the top and bottom with pockets to fit the cells and hold them in place. In order to avoid relying on the friction between the cells and the acetal plates holding the modules together, there are aluminum standoffs connecting the plates together. M3 bolts go into the top and the bottom of these standoffs to clamp the pieces together.

Above the acetal plates, we have a laser cut piece of fish paper that is used to cover the busbar and provide isolation. And above that fish paper, there will be another acetal plate to provide extra isolation protection and a more durable module. Since the fish paper is susceptible to water damage, this will also help to minimize the water that the fish paper comes in contact with during assembly/handling.

The red and black pieces on top of the module are gusset plates that will support the vertical busbar connections that will connect the modules in series.

Electrical Structure:

We wanted to minimize the total resistance of the high current path in order to minimize the power loss.

The material of choice for the high current carrying busbars (eliminating superconducting materials from the options) is copper, due to its low resistivity. Unfortunately, due to this property, copper also is difficult to attach to the cells. Resistance spot welding – the most common and cheapest method of battery assembly for hobbyists – requires the material to have a high(er) resistance in order to generate the heat to weld the material together when passing current through it. To solve this issue, we are using nickel and stainless steel clad copper from Engineered Material Solutions (EMS). This allowed us to use a resistance spot welder to connect the cells and the busbars, as the stainless steel provides a higher through-plane resistance – with the copper still providing very low across plane resistance. The other downside of having the copper in the material is having a high thermal conductivity, which wicks the heat of the weld away. With our spot welder, the K-Weld, we were not able to get consistent welds on the 0.3mm thick EMS material for more than 10 consecutive welds. Because of these issues, we switched gears and threw some nickel strips in the design. These connect the cells to the busbars, and allow a low weld energy to be used. The lower weld energy also increases the safety of the cells because there is less electrolyte that evaporates (causing internal impurities and thus eventually internal shorts) inside the cell – this info came from a post on the electricbike forums (https://www.electricbike.com/introduction-to-battery-pack-design-and-building-part-3/). The power loss from adding the nickel strips in was calculated to be negligible compared to the power loss due to the internal resistance of the cells.

The votage taps for measuring the voltage of each cell come off of tabs on the busbar. These connect to fuses and resistors on the voltage tap breakout board. The resistors will help to limit the current in the case of a short and will help to spread out the heat from the balancing resistors. The fuses will blow if anyhting bad happens. This breakout board on the top of the module connects to the voltage taps through a Molex MicroFit connector for easy disassembly in case the replacement of a fuse is required. These connectors are protected against offset installation and ‘scooping’ which could connect the wrong cells to the voltage taps – a very important feature. Having the fuses and the connector on the board enables us to switch to a distributed BMS if we choose to in the future, having the voltage measurements happening at the cells instead of on a centralized Analog Front End (AFE).

Manufacturing:

This was the fun part where I taught myself MasterCAM to program the 2.5D double sided tool path to machine the acetal plates the hold the cells in place. The Haas VF2 in our university’s machine shop made light work of the acetal.

Water jet cutting the busbars from EMS Sigma Clad 60 and the making a 3D printed die for bending the nickel strips into shape.

The top and bottom acetal insulation plates were laser cut using the Epilog Helix cutter at the University.

Assembly:

The whole assembly process was thought through and designed into the part, so that it all went together fairly smoothly, save for 1 part. The holes in the acetal capture plates were made so that the cells fit snugly when inserted individually. The problem comes when you are trying to put 48 cells in at the same time. It took quite a bit of force provided by c-clamps and distributed with pieces of wood. Eventually it went together, but the holes on future versions will definitely be increased in size. The burrs on the waterjet busbars made it difficult to slide the terminal connectors on them, so we ended up soldering them on for this rev and will order thicker terminal connectors for future revisions. All the red and brown wires you can see coming off the cells are thermistor wires that we attached for thermal characterization of the battery modules.

And now we have our first finished battery module prototype! Stay tuned for the results of thermal characterization and further testing.

Posted on Leave a comment

Individual Cell Testing in Large Battery Packs

I have been very fortunate to be part of the Midnight Sun Solar Car Design Team at the University of Waterloo (uwmidsun.com). As the Battery Lead for our next solar car (MSXIV), I am responsible for designing, prototyping, testing, manufacturing, and integrating the battery.
This discussion/post/article/whatever you want to call it will go through some of the considerations when building a large battery pack for high performance applications including electric vehicles. This is not as critical for the performance of say a home-built powerwall from recycled cells, but from a safety perspective is probably more important in such an application as the cells may already be degraded (in invisible ways – pending internal shorts) from their first use.
Lets start off by posting a PDF of some research/literature review that I did a few months back to determine if individual cells should be tested for a solar car battery pack. The result of my evaluation is that basic individual cell testing should be conducted, but based on time frames, a full capacity measurement will not be done. If we had access to a highly parallel capacity testing rack (which I have had some ideas on building one – might come in the future) then capacity testing would be good to do.
Click the link below to download the PDF.
The testing was done with a Keysight B2902A SMU and a custom scale made with Phidgets hardware. Our goal was to be able to detect manufacturer defects that could cause cells to heat up or fail prematurely. To this end, we testing for DC and AC Internal Resistance, Self Discharge Current, and cell weight, and an estimate of capacity through differential capacity through the capacity ration.
A custom scrip tin Python was created to interface with both instruments and automatically collect the data into CSV files. The testing was completed in a short timeline (36 hours) and, we collected data for 1400 cells. The CSV files collected made up over 6GB of data.
To process the data, more python was used – if you can’t tell yet, I really like python, especially when tools like matplotlib and numpy make data processing super easy.
These will be following the guide I have outlined here:
Once we have processed the data, it will be used to identify outlier cells and match them in order to create and most balanced pack as outlined in the Individual Cell Testing Evaluation Guide linked previously.
With all of this data, we hope to create a battery pack that will power Midnight Sun XIV on its 3000km journey across the United States during the American Solar Challenge in the summer of 2020.
Written By: Micah Black
Project By: Micah Black
Posted on Leave a comment

Machining Acetal for 18650 Cell Holders

Please note that this is a quick writeup, and not intended to be an independent guide to machining or battery pack design.

I have been very fortunate to be part of the Midnight Sun Solar Car Design Team at the University of Waterloo (uwmidsun.com). As the Battery Lead for our next solar car (MSXIV), I am responsible for designing, prototyping, testing, manufacturing, and integrating the battery.

Our battery pack is made from 864 18650 style cells in a 24P 36S arrangement, for a nominal voltage of 131V and capacity of 10.8kWh. These 18650 cells are held in place at the top and bottom using acetal plates. In the image below, the acetal plates are the grey plates at the top and bottom of the cell supports.

The choice of acetal was made primarily because it is easy to machine, creating lots of chips and not melting too easily. After finishing the design in Solidworks, I imported it into MasterCAM 2020 where all of the toolpaths were created. This was my first real project in MasterCAM, but I am glad that I spent the time to learn the software as this opens up a whole new area of possibilities for manufacturing for future projects. Anyways, the part was designed so that no endmills smaller than 1/4″ were required, and could be milled using only 2.5D operations. The process was relatively straightforward, aside from getting used to all the different plane naming in MasterCAM. Because I had created this part to be machined, all the toolpaths were easy to pick out, though time optimizations could definitely be made. This round, I was only making 2 parts for the prototype module, but in a month or so that full production will be headed to the machine with much more optimized gcode.

The University of Waterloo has a Haas VF2 CNC Machine that students can use for design team projects, and is the machine that this part was created on. Again, it was a relatively simple process of setting tool offsets, setting the part zero, then loading the program.

After testing the sizes of the cell holes, we decided to go back over the holes and enlarge them to ensure a smooth fit into the slots and not destroy the PVC insulation while inserting or removing the cells.

From design to final product, this has been a huge learning experience for me, and I hope to continue to improve my machining skills in the future.

I’m looking forward to doing some lightweighting on this part for the final manufacturing run, but have learned a lot in the prototype process.

Written By: Micah Black

Project By: Micah Black

Posted on Leave a comment

DIY Laser Engraver Design, Build, and Control

For the last few years, I have had an idea in the back of my head that I want to build a laser engraver. Over a co-op term, I decided I would finally make that happen. I decided to take a different approach to this project than I have for other projects, I would make a complete design first, and hopefully remove all problems during the assembly by doing so. I was also not going to skimp on any safety features, namely a full enclosure, proper emergency stop switch, and ventilation + filters. Making the design first also made me want to add drag chains, a hinged magnetic lid, handles for transport, a removable laser head, and many other amazing features that I would not have implemented otherwise.

One of the reasons I decided to take this project now was that I recently learned about GRBL being ported to the ESP32 and some development boards available for purchase on Tindie. A Wi-Fi enabled laser engraver sounded like a great idea to me, so I bought some of the control boards, and some TMC2208 stepper drivers for silent motion that is backwards compatible with all other stepper boards. I had some NEMA17 steppers lying around from a previous purchase, and the laser is a 2.5W diode I had purchased from Aliexpress a few years ago in hopes of one day getting to use it.

Before printing all the parts for this, I upgraded my slicer to the newest Cura edition so I could take advantage of the Horizontal Expansion feature, which allows adding offsets for the amount of expansion that your printer has. It took a few test prints to get the correct values, but it was definitely worth it. The fan enclosures, electronics boxes, motor holders, and bearing holders all slide on the to aluminum t-slots very snugly, and will not be moving around unexpectedly.

The frame of the build is made with black anodized 2020 aluminum extrusion that I purchased from RobotShop, and held together with aluminum L plates and M5 bolts. This construction is way overkill for a laser engraver that does not have any horizontal forces on the moving head, but I decided to go for it anyways as it looks great and provides a great base for transport,  etc. The exterior dimensions of the frame are 500mm x 340mm x 140mm.

A slightly modified version of the traditional CoreXY belt system was used, keeping the 2 belts on separate planes instead of having them cross over at the end. This allowed to keep the belt paths clean and the overall size smaller. The rest of the motion system includes 8mm smooth rods, LM8LUU bearings, and GT2 timing belts and pulleys with integrated bearings.

The ventilation system is 2 low profile Noctua 92mm fans with a carbon filter in front of them. These fans fit perfectly between the upper and lower aluminum extrusions, and provide a decent amount of airflow even through the carbon filters – I would not have gone with cheaper fans, as they definitely don’t move as much air as these Noctuas.

Internal lighting was another feature that I felt necessary to include, so I used some waterproof LED light strips that I have from previous projects. This fits perfectly inside the t-slot aluminum extrusions, and provides great lighting on the inside.

The enclosure is made from transparent orange acrylic. I knew I wanted the engraver to be enclosed, but I also wanted to be able to see what the laser is doing without opening the lid. The laser has a blue / near-UV wavelength, and I have heard that orange acrylic tends to absorb light of this wavelength. While I never actually verified this, I can say that looking at the laser dot through the acrylic is definitely different that without. I had originally decided to go with some laser shielding sheet from JTechPhotonics but once I realized that would mean spending a couple hundred dollars for the amount of acrylic I had needed for the design, I decided to just use some normal transparent acrylic. That lead to another search for a reasonably priced supplier that brought me to plasticworld.ca, where I was able to get the acrylic and the glue that I needed for around $100, and shipping was only $25 which was also a steal. While I was designing it, I also added some black acrylic accents to make the build a little more appealing, which turned out great.

As for gluing the acrylic together, I did not want to take shortcuts here either. There is one universally recommended glue for acrylics, also known as acrylic cement, solvent glues, or plastic welding, the Weld-On 4 and Weld-On 16 glues, which melt the acrylic thanks to some methylene chloride, and chemically bond the sheets together. This essentially creates a single sheet of acrylic once it is cured.

On the electrical side, I implemented a number of key safety features. An emergency stop switch, a large rocker switch as the main power button, individual toggle switches for the lights, fans, and laser power, and of course a fuse. These are all contained in one box mounted on the aluminum extrusions and the other box includes the ESP32 GRBL controller and the laser driver board.

The laser bed can be dropped out from the bottom using thumbscrews. I made this using a 1/4″ plywood wasteboard, a thin aluminum sheet to prevent burning through the plywood, all enclosed with aluminum angles to protect the sharp edges of the sheet metal.

I’m super happy about how this build turned out, and how close it looks to the original model. I think that’s a testament to how much planning can help a project run smoothly.

The next steps on this project is to clean up the wiring a little bit, then start the final testing. I have already verified that the motion is smooth (and pretty much silent thanks to those TMC2208 drivers) and that the laser works. Now I have to put the two together, find an optimal federate, and then find some software that will allow me to engrave images!

The first tests on this machine were engraving squares and circle with G-Code I wrote myself. After a long process of focusing the laser, I got some amazing and consistent results. I wanted to use a vector graphics platform to control the laser, and found a laser tool for Inkscape from JTechPhotonics. It took a little while to get it properly set up and useable (partly because the X-axis on my machine is reversed and the GRBL invert axes settings don’t seem to be playing nice with the CoreXY system), but once that was complete, I had a fully functional laser engraver. The first image I engraved was my logo, of course, on the same test sheet I had been using for the squares and circles!

Project By: Micah Black

Written By: Micah Black

A bunch of pictures of the design and build process can be found below.

Posted on Leave a comment

Laser Cut Nerf Ball Shooting Lego EV3 Tank

For the final project of my 1A term in Mechatronics Engineering, we created a laser cut tank with the Lego EV3 kit (this was required) that shot Nerf balls, all to achieve a very special purpose: to remove the geese from the University of Waterloo campus.

There are lots of pictures of the tank below, and our design reports are attached as well, but I would like to highlight something here as well. Before going further, I would also like to give credit to my amazing groupmates Caleb Dueck and Lukas Wormald. This project was truly a group effort, and I could not have asked for better groupmates.

The treads are made out of laser cut 3mm MDF board. Using cutting a flexible pattern in to the wood, we were able to create a fully functioning tread. We attached both ends of the tread using 18AWG wire loops soldered through holes in the ends of the treads. The gears were made from This may not have been the best option for the treads, but it worked fairly well and was easy to do. The treads were not durable in the wet weather outside and one of them broke as it got wet and soggy.

The ball hopper mechanism was inspired by the design of paintball hoppers, and laser cut out of 3mm MDF. It worked very well at slow speeds, and was very repeatable. The top cover is attached with magnets and is removable in order to reload the hopper.

If we were given more time and resources, we would like to have made the balls fire faster and further using compressed air instead of a spring. However, the spring powered solution worked fairly well after some tuning, but would not fire as straight or as far as was originally planned for.

Using the Lego EV3 Robot kit was a requirement for this project, driven by the school, as these kits are easy to debug. If we were given more time and more freedom, we would have used an Arduino based platform instead, as this gives more expandability, power, and features.

The design report that we produced covering all the design decisions that were made is available here.

Videos of the robot in action can be found here.

Project By: Micah Black, Caleb Dueck, Lukas Wormald
Written By: Micah Black