Sep 22, 2021

James Laumeyer

For several years now and at the hands of several interns Boca Bearings has been trying to get a functional electric go cart. And for a multitude of reasons things have just never quite come together to make for a reliable machine. The story of my trials with this machine thus far are scarcely different from the interns prior to me, though with any luck the saga of the BBEGC, Boca Bearing electric go cart, is drawing to a close.


As was discussed in previous blogs when I took on the BBEGC it had two main problems, a bad battery pack, and a bad motor controller. As the motor that was mounted was a brushless motor we first attempted to use a brushless controller to swap in for it though the problem was getting KV values off of a part that was designed to work with a specific controller and had poor documentation. As such this rout was quickly labeled a fools brand by my associates and I, thus we decided to go with an equivalently powered brushed motor that we had in the shop for ease of programming. The next problem was the cheap motor controllers that we attempted to use these started literally exploding on us under high load. So the decision was made to go with  a 60v 300Amp motor controller from basic micro. While this is an expensive solution at $500 a pop the support and robustness of the controller made it a compelling solution, even if the turn-around time is longer than we would like on orders and repair.


Now my first attempt to use this controller to control the BBEGC was an abysmal failure that ended up breaking over a thousand dollars’ worth of equipment. And while some people might try and brush a failure like this under the rug I think it is more important to go over how and why things failed like they did.


Looking back the simple reason for the failure was simply put, a rushed job with corners cut to save time in testing. So let's take a moment to go over just how and why that happened. To start the layout was done in rush way. It was a rough setup for proof of concept on the table and as such there was no circuit protection or insulation over the conductor of a kill switch and the lack of insulation on the kill switch ended up being the downfall of this test. After a successful run with the analog input and the motor I went to go turn off the motor controller and shutdown the system. Unfortunately when I went to go unplug the battery connectors to put everything away the live side of the kill switch got bumped making contact with one of the motor terminals on the controller, and while the motor controller is robust time and time again it is explicitly stated in the manual not to swap the power and motor leads or power and ground leads, which this did. In turn this sent 48v through the motor controller and into the laptop I was using to program it, letting out the magic smoke from both devices. Upon further investigation it was pretty clear that mosfets in the motor controller had fried and that at the very least the battery in my laptop was shot, causing this to be a very costly accident both financially and in the time setback. Thankfully after speaking to someone att basic micro we were able to ship the motor controller back and have it repaired, though we also ordered a second one as a backup.


While this first attempt was in every way a failure, half of failure is what you learn from it. So let's take a moment to go over what we learned and how this was rectified in the second attempt. First we have the primary cause of unmounted and uninsulated leads that were asking to cause an accident. To fix this an electronics box was made to give all the electronics a hard mount location where they can’t be moved around and inadvertently cause a short. Additionally all wires going into the box now go through a cable gland to provide some strain relief if pulled and the exposed leads on the kill switch have been covered by rubber insulating boots to prevent accidental shorts. Second there is the addition of the safety circuitry to allow for a soft start of the motor controller and give current protection in the event that the system spikes unexpectedly for whatever reason. This was done as per the diagrams in the manual and this far seem to work as intended. Third preventive measures that hadn’t caused a problem yet but looked like they had the potential to cause issues in the future. These preventive measures include upping the wire gauge to a minimum of 10ga throughout the inside of the box in order to mitigate the risk of an electrical fire, and making sure every wire that went in and out of the box had a plug connector of some sort so that when moving things around the box could be its own entity to allow for ease of testing and trouble shooting. Fourth the external control now uses a modified Ethernet cable to send signal to the controller allowing for a cleaner control system as opposed to a bundle of speaker wires that was previously used to send the signal. Finally to avoid destroying another expensive machine Mark and I refurbished a couple of older office computers that were destined for the waste pile. To do this we swapped the failing hard drives for a cheap SSD and added a Wi-Fi card, additionally on one of the machines the power supply was failing causing system stability issues. Luckily I had a spare working power supply from a machine I had previously gutted so I just popped that in fixing that issue. All told this refurbishment took about $50 worth of parts and both ensured that another expensive machine wouldn’t get accidentally destroyed in the event of another accident and stopped a mostly operational machine from becoming E-waste because a couple parts were worn out.


Once all these things had been implemented and the controllers had arrived it was time to work on test two. To start I double checked everything to make sure I had power running to all the right place and that the system itself would not immediately fry itself when I connected power. After confirming that everything appeared to be correct, it was time to get into the control system. There are a number of ways to program this controller and each method has its pros, cons, and scenarios where they are better suited over the other options. Now I am by no means a strong programmer, I know enough Arduino and MATLAB to get the job done most of the time but I am not strong in it at all, so in regards to programming I tried to make this thing as simple as possible. Luckily the main control interface supplied by basic micro is a fairly user friendly GUI so making a profile for your battery use case is really simple as long as you take the time to look-up the operational limits of the equipment you have. For this project I made two profiles one for a 22v LiPo battery and another for a 48v LiPo pack, this was done because the 22v charge fast and are fairly tame as far as the power curve having a peak amperage delta around 50amps under full load. The 48v pack on the other hand is a little more beastly giving us significantly more power but it has a peak amperage of around 150-175amps under full load. And for those who are less versed in electrical terminology that means the peak 48v batteries were peaking at about 8400W of power to put that in perspective that is about the equivalent of running 4 industrial table saws at once. And even though the average operating current of each of these batteries was only about 25amps it’s rarely the constant current that kills electronics but rather the extreme spikes that do bad things to the system. That is why even though our initial cheap controllers where rated for 40amps at 50v when the break was applied or the system was slammed into reverse there would be essentially a hammer of two opposing currents that would literally blow the traces off the board and that is why we have such a high headroom with our basic micro controllers, to handle the electrical hammer that has been devastating in the past. With this in mind the 22v profile is more for initial testing because while it can still kill electronics if wired incorrectly, it will likely do less damage to the lower current capabilities; while the 48v profile is active use since it gives more power.


Now for the initial programming I had tried to do it using an analog input with a linear potentiometer as the main control system as this would have just been a simple no code plug and play system. This worked with the 22v batteries and the 48v batteries on 75% charge. However when the 48v batteries where charged to 100% capacity the system was not happy. This is due to the analog system having some robustness issues at higher power ratting that I was warned about. To fix this some Arduino code will be used to send a refined signal to the motor controller from an input device. As of now this has not been completed so that will be gone over in a future blog.