I moved. Thus there was a delay in making Sox.
After moving, I was running some tests on the servos to see if I could control all 12 through the raspberry pi forming Sox's core. During this, I ran into a problem. Sox would twitch the servos, and then suddenly stop. After some digging, Sox was pulling too much power for the servos, dropping the main 5V line too low for the pi to run. This would cause Sox to abruptly shutdown, and in one case crash the card to the point I had to load in a complete sd card backup (image) of Sox to restore him.
Due to this, I needed to find out how much power Sox needed, and then rebuild the entire power supply to supply this much power. This means I would lose the X728 battery supply Sox had as a pi hat, and replace it with something of my own design.
First, I removed Sox's battery pack, and then ran the test again, feeding Sox directly from my power supply. My power supply was set to 5V, matching the input of the Pi, making the test as similar as possible to the battery test. At 5V, Sox made the power supply go into shutdown mode when he moved all his servos. This means Sox drew more than 5 amps of current! No wonder the pi browned out!
After seeing this, I knew I had to change the master power supply voltage, and then step it down to feed Sox and the servos. I had a few buck boost converters lying around, so I connected 2 to the power supply, one for the servos and one for Sox. I did this as I did not want Sox's 5V line to depend at all on the servos, and also my buck boost converters were only rated for 3A each. I dialed each one to 5V output, and then connected their respective load and turned everything on at the power supply.
As I still had the goal of powering Sox via USB, I increased the voltage in line with the standard USB-C Power Delivery voltage level of 5, 9, 12, 15, and 20V.
Sox did not work properly until I set the power supply to 12V! At this point, it was drawing close to 3 amps when the servos moved. This is 36 watts (W) of power Sox is consuming!
\r\nI knew I wanted to have some wiggle room, so I decided to build everything to 5A power level at 12 V to be sure voltage drops along the wires will not be a major issue. At this point, I ordered parts to power Sox at 12V. A couple days after I ordered, I realized I forgot one thing. Sox is to be battery powered! Looking quickly, I saw that the closest voltage for battery packs for what I need is 12.6V, meaning I would have to modify everything, and some of the parts I ordered will not work at this higher voltage. I also realized that I need to have the input voltage on the USB be higher than the battery pack voltage so Sox can be charged, and not need the batteries removed to do so.
At this point, I spent days trying to figure out a decent power supply system. Eventually, I found a 3S (3 series) battery charger board, allowing me to connect 3 of my 18650 batteries originally in the X728 power hat and reuse them in the new power supply. The battery charger board I chose was a FTVOGUE Battery Protection Board 3S Lithium Battery Charging Board 12V 40A Lithium Battery Charger Protection Board BMS PCB Board with Balance Charging. This was found on Amazon for $11 CAD, and had all the features I needed within it.
Now that I had a new battery bank, I needed a more powerful buck converter for my servos. Due to being at 12.6V, and my servos only taking a maximum of 6V, I could just use a buck converter, ignoring the boost part. The biggest challenge would be finding a buck converter with a large enough current capacity. After more searching, I found a DROK DC-DC High Power Buck Voltage Regulator Board 5-40V to 1.2-36V 12V 24V to 5V 12A Adjustable Step Down Volt Converter Module Battery Power Supply Transformer for Car Vehicle Adjustable Power Supply LED Lights, also from amazon. This cost $16 CAD.
Now that I got power figured out to feed Sox and his servos, I needed to find out how to charge the batteries. Looking through RC car forums returned how to charge their unprotected batteries, but mine were protected so that did not work. Over the course of several weeks, I realized there is no one selling a battery charger designed to work with batteries in place, act as a UPS, and charge the entire pack using the same wires for input and output voltage. I found ones for 4 wires required, I found ones that would trickle charge them, I found ones that would charge them all in parallel, but nothing for 3S in series. I was thinking how do ebike hobbyists make their bikes, but their stuff exists, at 48V and higher.
Eventually, about to give up, I turned to Reddit. Suspecting massive blowback, I posted in 2 locations, in case one decided, like Stack Overflow and sisters, that it's dumb, I'm dumb and they are superior, posting a link to a forum that closed 10 years ago.
Holding my breath, I actually received real help! During discussion, a Constant Current Constant Voltage buck converter came up. This is functionally identical to what I need for Sox! It takes in a higher voltage, steps it down, but most importantly,. has an ADJUSTABLE current output that it WILL NOT EXCEED!
Finally with my answer, I bought the CC/CV buck converter, also from amazon. It was called DROK DC Buck Converter, 5.3V-32V to 1.2V-32V 12A Adjustable Power Supply, 5v 9v 12v 24V 30V 32V Step Down Voltage Regulator with LCD Display Volt Transformer Reducer CC CV for RV Solar Panel Golf Cart and cost $30 CAD. It could put out to 12A if needed.
One final issue existed, how do I turn off the CC/CV voltage converter if Sox is plugged in too long? I do not want to overcharge Sox, nor do I want to just rely on the Battery Management System mentioned earlier. Again, turning to Reddit, I found that no thing exists to do that, but with an arduino nano and the spare voltage current sensor I ordered, I could make it exist. This uses a IRLZ44N mosfet to break the negative rail and kill the downstream that way. It also contains a voltage regulator to power the nano and the sensor, and supporting capacitors and resistors to make it all work. This post contains its writeup. If you make it, I am not responsible for it. This is an info site, not an approved engineered system. Make at your own risk!
I then attached the USB-C Power Delivery load controller, set it to 20V, and tested it.
IT WORKED! Sox now no longer browns out, and with a maximum of 20V at 5A input, or 100W of power, compared to the 36W he drew before, Sox now has technically UNLIMITED POWER!
Comments
Log in to add a comment.