09/05/2019 at 07:11 •
Rebuilt the lot of it. Done. Worked.
Put it through its paces, wide open, stalled, brake.
Going from wide open, to stalled, to wide open caused the forward mosfets I tested to fail shorted.
However, I did something wrong which ultimately invalidates my test. I never hooked up the return path for the forward schottky diodes. As such the only return path for the 'power off' spikes went through the body diodes instead and they are not really fast enough to handle them.
I was debating if I should hook that return path up to the charging input on my BMS, power output on the BMS, or directly to battery - and bypass the BMS. I never decided.
Time to pack up here so I'll have to replace those mosfets in a day or two.
<EDIT>I believe my testing methodology itself was the source of my eating mosfets here!
If I'm right, my BMS is triggering when I stall the motors, and my test used the relative ground of the battery and not the BMS for the gate voltage.
So.. my gate voltage would go from a comfy 3.8v to a fatal -35v... if/when the BMS starts tripping as the BMS actually interrupts the ground when it trips.
The BMS isn't supposed to trip until 100A, but that is another issue.
Thanks to @Bharbour for his suggestions on the issues I've been having here. It's hard to help without a schematic or pretty much any measurements, but he gave it a shot.. :)
09/03/2019 at 07:22 •
After a fun day with the family, this evening I went about replacing the under-rated transistors I had driving my braking mosfets with some BC337 ones. They have a more respectable 50v CE voltage rating and should work well.
I was offline and never bothered to check the datasheet for them. It's an NPN BJT transistor.. how hard can this be.
Cue the smell of atomized silicon and motors spinning out of control.
<insert expletives here>
Stupidly try the other channel...
<insert more expletives here>
Later, go read the actual datasheet. The 2N3904 has an EBC pinout. The BC337 has a CBE pinout. I built it with my transistors wired in backwards.
<insert even more expletives here>
I've now blown more power mosfets in the last week than I have in at least the last 5 years and I do terrible things with them. Then again, I usually don't just 'wing it' when the power involved could easily vaporize my wiring.
The main problem here is a combination of arrogance, the complete lack of much of my equipment, and the tiny form factor I've forced myself into. Keeping with my goal of fitting everything within the board cross section, the power section needs to fit in a rectangular cube 3/4x3/4x3in including connectors and the minimum space I need for the mosfets consumes most of that. So.. bench testing has been pretty much non-existent.
It works on paper. It physically fits. I just need to stop screwing up now.
I'll be rebuilding the power section again tomorrow. Good thing I keep a bin full of power mosfets and transistors around..
09/02/2019 at 06:00 •
It was all going so well. I tested forward and brake for both channels and it was working perfectly.
That is the magic smoke being released from the left braking mosfet. It was quite the event and I can tell you that mosfet never gave up.. it was positively glowing before I cut power. Perhaps I should have actually included the fuses in the test. :)
Somehow it seems to have taken the two drive mosfets with it during its demise. So it seems I will need to rebuild half of my board here to fix it. Ugh.
I have since discovered that the 2N3904 transistors I picked to drive my braking P channel mosfets have two different ratings online. One group is rated for 40v, the other for 60v. My battery voltage maxes out at 42v, so can only assume I have the cheaper ones. I am driving the P channel via a voltage divider to keep the gate voltage within the max Vgs of my mosfet here, so I'm basically left with that.
Currently rebuilding it with spade connectors, and seeing if I have some higher voltage rated NPN transistors here. Cross your fingers.
08/31/2019 at 02:22 •
Long weekend. Let's do this thing...
08/27/2019 at 04:19 •
For the motor control, I'll be using a half H bridge. I'm controlling each motor separately, so that's two of them.
A half H bridge will give me 'forward' PWM and 'braking' PWM.
Basically I'm using the circuit used in this article, with a capacitor across the supply, and an added schottky diode across the 'forward' PWM mosfet. I'll get to that bit in a moment...
I've been thinking about how I could implement regenerative braking.
The normal problem with implementing regenerative braking is that your motor voltage has to be higher than the supply voltage to actually put power back into the supply.
A DC motor will spin at a given RPM for a given voltage. To have a DC motor do regenerative braking would mean you would have to be going down a serious hill or switch in a boost convertor to raise the motor voltage above the supply voltage during braking.
Or... maybe not.
I've been toying with the idea of using the inductance of the motor itself as a DC-DC boost convertor. The idea works like this.
I'll short the motor with the braking mosfet, briefly. This will create a high current across the windings of the motor. The windings are basically a big inductor. When I stop shorting the windings that inductor current will still want to flow, and the voltage across it will spike. The motor is already connected to battery + and has a path back to battery - through the 'forward' power mosfet body diode. Add a decent sized capacitor across the supply rails to soak up and smooth out those spikes and... viola. Regenerative braking with one extra component, but it would suck.
The normal mosfet body diodes are slow to conduct, and have a voltage drop of 0.6-1.2v. So... I add a schottky diode in parallel to the normal body diode of the 'forward' mosfet. Schottky diodes are much faster to conduct, and only have a voltage drop of 0.2v.
There are a lot of questions I'll need to answer to make this work well though and there is going to need to be some experimentation. I'll need to see how fast the 'inductor' decays to time how often I need to short it, how fast and for how long I need to turn on the braking mosfet, will I still need to be applying power to keep the field up for the windings, how will commutation affect the inductance, and will my BMS even allow power to be fed back into it... to name a few.
The good news if it doesn't work at all, I'll still have power and braking with the same circuit :)
08/12/2019 at 17:21 •
Please welcome @Morning.Star to the project!
I gave him a basic framework of my thoughts on the lighting and control code and he is graciously going to lend a tentacle towards making it actually work.
I got all the libraries needed loaded for the remote on an Arduino mini, but there is not much room left for anything else. Wish him luck..
08/08/2019 at 06:29 •
No real time to work on stuff today, so I did a quick thingy. I added the grip to the top deck cover.
I could have just bought some grip tape (even in clear) for like $10 and been done with it, but you know me... why do anything the easy way.
First I tried heating sand to 500C and then sprinkling it on the polycarbonate. It did nothing and brushed right back off. So I started over with the bright idea of then heating it with a heat gun.
Heat, sprinkle, turn on the heat gun... blow away the sand. :) I laughed at myself.
So.. I gave up and did it the 'normal' way.
Wet sanded the cover with 1000 grit,
Sprayed it lighty with polyurethane and sprinkled it with sand.
Then it got two more heavy coats about 45 min apart.
Tomorrow it will bake in the sun all day.
08/07/2019 at 08:09 •
Been going down the road of building the remote and trying to fit everything on an Arduino Pro mini 3.3v 8Mhz. It's not been going well. I can fit all the libraries I need, set everything up for communicating, and establish a loop, but then there is not much room left for logic and actually doing stuff like drawing to the display.
I've been toying with the idea of just rendering everything on the mountainboard CPU (Blue Pill) and then streaming just the raw content of the framebuffer to the remote display. I think that might actually work pretty well with my 128x32 monochrome display as the the whole framebuffer fits in 4096 bits. Even at the lowest data rate for the NRF24L01 module, that means I can still get 60fps. Sending the whole content also means missed frames wouldn't matter much.
I found the commands I would need to dump the internal display buffer and pipe it over. I would run all my drawing commands on the STM32 which would modify the local buffer, and then on every transmission from the remote I send those buffer contents back. The remote becomes a dumb terminal.
Then I killed my first Pro mini when a fleck of loose solder shorted two pins near reset.
I think I might undervolt a Nano and be done with it. Alas, the Blue Pill is a little too big to fit in the controller.
Speaking of the Blue pills, I flashed a bootloader! Not sure it works yet as I believe I need to do the D+ data line resistor swap thingy on this one. It doesn't show up via lsusb when I plug it in. :(
08/01/2019 at 13:46 •
I repainted the bottom cover as I didn't like how my slots for the lights turned out. In the process of removing the paint, the polycarbonate got a haze on it that I never got rid of again. Polishing it would leave a coat of wax on it that I wouldn't be able to remove with what I have on hand, so I left it that way. I can come back to this later when I have more fresh polycarbonate to play with.
The battery was installed and wired up to the BMS. After some sparks flying and a close call touching an adjacent cell with the soldering iron tip, all of the balancing wires got a spacer of heat shrink tubing to protect the can of the lower cell from shorting to my folded nickel strips.
Power delivery is via two 12 gauge stranded wires in parallel which should allow me to draw 40A without heating. The 1.0C rating of these batteries is about 2500mAh, so for a 40A draw, that would put my 5 parallel cells discharging at 3.2C. That should be a pretty comfortable rate for them.
The heat sink got drilled and tapped with M4 screw holes in the corners for mounting, and M3 holes for the six mosfets which will be providing the motor control. This will give me independent control over each motor utilizing two N channel mosfets in parallel for forward, and one P channel (with an NPN transistor driving it) for braking. I've also included a pair of external schottky diodes to make coasting/passive braking regenerative. Active braking will just dump the power as heating of the motor windings, but I don't believe it will be used much anyway. The heatsink also got a slot cut with a wood router to make it fit better close up to the truck. That was really dangerous... and I would not recommend trying it.
07/30/2019 at 00:24 •
Routed out the pockets for the receiver (I have yet to build), BMS system/charger, heat sink/mosfets, wires, etc... It's not very clean, but it is inside the board, so...
Good thing Ryden is not that heavy. I'm running out of board here beyond what the covers will provide in stability.