Gooser: a 4-in-1 Lepton derivative

Finally placed the JLC order after making a bunch more edits.

  • Changed net names on each copy of the 14mm section so I can run DRC on the 8-motor version without getting a ton of errors.
  • Discovered that at some point early on I moved the left side pin header down by 0.1mm but forgot to move the right side one to match, so the holes were slightly off when copy-pasted, putting them too close to some traces and vias.
  • Added thermal reliefs on the connector ground pins. I don’t like setting the copper area to spoke mode because I do want the capacitors to have maximum conductivity even if they are a little tougher to solder, but there’s no need to suffer on the connectors. To solve it, I temporarily change the pad net names when rebuilding the copper areas to leave a clear space around them, and added traces to cross the gap.
  • Added a voltage divider on the back for the main bus voltage. It’s not connected to anything, but can be wired over to the ADC12_IN10 pad to allow voltage monitoring.
  • Copied input area onto the right side of the board, so when cutting them in half I’ll get two full-featured ones. This involved removing the extra pin header from the right side to avoid pinching the input rail width, but I had no particular plan to use it anyway.
  • Extended motor wire pads by 2mm, similar to how I did on past versions. They’re easy to sand off if desired, or can be cut off before manufacturing by moving the board outline. This allows using two 14mm long capacitors per motor and bending them down to lay over the mosfets. Previously there was just barely enough room, but would have been difficult to get the tip of the soldering iron on the pad without touching the capacitor.
  • A few minor grounding improvements.
  • Added timer/current sense information to the silkscreen.

I got a stencil this time, after finding that you can specify a size smaller than the full sheet, and if <200x200mm, the added shipping cost was only $4. Though the stencil itself was still rather pricey at $14 with the recommended electropolishing option for 0.5mm pitch.

Now I just have to make up my mind what all components to buy and how many motors worth…



1 Like

The boards have arrived! I only have enough mosfets for one motor right now, but that’s all I need for testing. I’ll order a bunch if I can ever make up my mind which ones to buy.

Anybody have an opinion whether I should use 30V or 40V mosfets with 24V power supply? The difference in resistance is about double, but still half that of my old friend SE3082G. 1.2mOhm for the 30V JMSL0302AU-13, 1.7mOhm for 30V BSZ0901NS (same ones used on Antun’s DriveShield), and 2.7mOhm for 40V AGM403AP.

I think the SMM4F26A TVS diode from ESC1 can only protect the 40V ones since it breaks down at 28.5-31.5V, and is still not 100% safe with 42V clamping voltage. But I think ESC1 has 35V ceramic capacitors, so maybe that’s ok? The next lower SMM4F24A looks like it would provide some protection for 30V mosfets while still being (I think) safe to use at 24V supply voltage, but would need 40V mosfets for full safety with 39V clamping voltage. And still not fully safe unless I use 50V capacitors, which I’d rather not since they’re huge. 35V can fit two 470uF per motor bent down over the mosfets, whereas 50V would need one big one per motor on the back side of the board to avoid blocking either the connectors or motor wire pads. Maybe 50V ceramics and 35V electrolytics would be safe enough? On the theory that the ceramics will charge up quickly, but the electrolytics will suppress typical transients before charging above 35V. But maybe something like a hoverboard motor could still kill them.

I’d also appreciate any opinions on the JMSL vs. BSZ0901 for <18V applications. JMSL is marginally better in terms of resistance and price, but Infineon is a more well known brand and it feels like a waste not to buy them while they’re on sale. Maybe I’ll just get some of each.




2 Likes

Assembly complete! CPU is programmed and running, so I will proceed with testing the drivers next.

First I cut the board into a dual and quad. In the process I learned why JLC says no copper in the V-cut area… broke the tip off my only V-bit trying to cut .5mm deep all at once, and after regrinding it and taking .1mm passes there was a terrible burr of copper I had to chisel off before the board would lay flat to cut another groove from the other side. I’ll try a downcut mill next time.

Making the copper bars was moderately difficult. Started with 2mm wire, hammered flat, annealed, bent the corners, hammered flat again, annealed again, refined the bend, filed the inner corners sharper, and then sanded flat on coarse diamond stone. Technically it only needs to be flat on one side, but it looks nicer without the oxide coating from annealing. Accidentally cut the bottom side copper bar a bit shorter than intended, but no big deal.

My notecard with rolled masking tape to hold tiny capacitors is still serving me well.

I didn’t use the stencil since most of my components are pulled from GooserCS and SimpleFOC Stepstick and have solder on them already, so the stencil would give too much.

I had more trouble than usual with components blowing away from the heat gun, but eventually got them all wrestled into place. Also got my first tombstone. 0402 capacitor stood right up. But no problem to shove it back down with tweezers.


You may notice there’s solder on the back side M1 mosfet pads… that’s because I soldered them over there first, and had to pluck them off and reinstall in the correct location. I also forgot the VDRV snubber. I tried to solder it on with the iron, but failed due to heatsinking of the ground pad (on a related note, the thermal relief on the programming connector ground pad was wonderfully effective). But it’s non-essential, so I’ll leave it off for now and add it along with the mosfets for the other motor later.

Soldering the copper bars was a challenge for the heat gun. The second one came out ok since I pressed it down firmly before heating, but the first one had a gap under it because I could only melt portions of it at a time, so it never self-leveled. I eventually managed to get it down by combination of hot air blower and soldering gun. But for the 8-motor board, I will definitely need an oven.

At first I thought I’d go the traditional toaster oven route, but after a bit of research people seem to struggle with insulating them well enough, so I think I’d be better off building a smaller enclosure from scratch. Aside from that it’s just a heating element, temperature sensor, solid state relay, and arduino to control it.

Failure. Phase A mosfets burnt instantly upon connecting the battery. No visible damage to the package, but a small orange flame and plenty of smoke, and solder obviously melted since some squeezed out from under one of them. 0 resistance on all their pins, so power to ground, outputs, and gates are all shorted together.

Thankfully my standard procedure is to plug and unplug quickly, and if nothing bad happened then plug it in and wait to see. So no further damage during the half a second or so of burning aside from the capacitor also losing a leg. It may have still been alive, but they’re cheap enough I just tossed it and soldered on a new one.

I removed the burnt mosfets, though they had apparently welded themselves to the PCB copper and wouldn’t come off without a bit of pulling, which peeled the copper up from the fiberglass.

The remaining mosfets seemed to be ok, so to verify that it was not just a solder short or other undetected anomaly, I plugged it in again (even more briefly this time) and got the same result on phase B. Smoke and solder squeezed out from under one of them. No flame though, and the capacitor was only slightly warm so I think it’s ok.

No idea what the problem is yet.


UPDATE: Removed all mosfets so I could probe the drivers without anything blowing up. Only low side B was welded to the PCB copper this time, but high side B is also internally shorted. Two good mosfets left for further testing.

The drivers are receiving proper PWM inputs and outputting inverted waveform on the low side, so that confirms it is properly configured for 3PWM. High side gates are all flat at 5.7V (running on 7.4V lipo). Unsure if that was just due to having the mosfets disconnected, I reinstalled the phase C high side mosfet, and it remains the same. So it seems the high sides are on enough to conduct (though not properly boosted by the bootstrap), and whenever the low sides switch on via PWM it short circuits and dies.

The M1 driver inputs and outputs are all the same, so it seems unlikely to be a bad driver or soldering problem. I’ve double checked that the wiring is identical to GooserCS (which is still working fine with mosfets transplanted from Lepton). Not sure what to try next.

UPDATE 2:
Confirmed on Gooser3 that DRV8300 should output boosted high side PWM even without mosfets. The only difference there is that it’s configured for 6PWM, but since the low side signals are the inverted ones, I doubt that would change the high side behavior.

Swapped out the M0 driver on Gooser4 with a different one since I couldn’t think of anything else to try, and no change.

This is maddening.

UPDATE 3: I installed the driver I removed from Gooser4 onto Gooser3 (still without mosfets) to verify it would behave the same as the other, and it does not. The inputs are all being driven properly by the CPU, but the low side outputs are chaotic, mostly 0V but frequent blips up to 6-7V with no regular period. Phase A high side is flat 6.2V. Phase B high side is about the same but slightly ripply. Phase C high side has blips like the low sides, but with the floor slightly above ground. The blips also show up on the BSTC pin, but in that case the floor is the 7.4V battery voltage.

I wish I had some new DRV8300’s to test with. The ones I’ve been using were pulled from GooserCS with the heat gun so they shouldn’t be heat damaged, but these unpredictable results indicate otherwise. I’ve been painstakingly checking for solder shorts between every pair of pins and every pin and ground, so I’m fairly certain that hasn’t been a problem. It’s possible the ceramic capacitors have been heat damaged after so many reflow cycles, but I don’t know any way to test that except for replacing them with new ones, and again I only have others pulled from GooserCS.

I’ll buy one complete set of components from Mouser and start fresh.

UPDATE 4:
Nope. Removed both drivers and their their capacitors, and the one mosfet I still had on the board. Installed the brand new driver and capacitors in the M1 slot, and the old mosfet to see if it would make any difference compared to the other phases. Same behavior as before. High side outputs always on but not boosted, and low side outputs giving proper inverted PWM.

I am 100% stumped. If anyone can help, I would be forever grateful. Otherwise it’s back to the drawing board again, and hope I don’t step on whatever landmine I stepped on this time.

The drawing board it is, then!
Gooser5 - Platform for creating and sharing projects - OSHWLab

At least I’m getting faster. Two days and I think this one is ready to ship. Routing was very much easier this time due to having 50% more space.

This version is based on Gooser3 so I’m back to 6PWM and 3-channel current sense and stacking two 4-motor boards on top of eachother. And thanks to the single mosfets taking more horizontal space and less vertical, I was able to get the CPU on the top layer so JLC can do all the difficult assembly.

No buck converters this time, but I’ll probably make a version with them later.



UPDATE:
Had the idea to see if I could fit the larger 3V regulator from Lepton, and I can if I move its capacitors to the back side. But it’s only rated for 100mA despite its higher 500mW thermal rating, which is right on the line of being enough, and 500mW is not enough to allow joining it with a 10V driver supply anyway, so I’ll stick with the little one.

The only thing that really bothers me about this design is these pinch points in the VS areas:


If I go down to 2 channel current sense, I could eliminate the leftmost sensor and shift the middle one left to clear up more space. But will the increase in conductor area outweigh the loss in efficiency from lower current sense accuracy?

UPDATE 2:
And here is what it looks like. Undecided which to go with. Another option would be to move the mounting holes outside the white lines so the top left and bottom right sensors can be moved over. That would make the minimum-width version of the board less user-friendly, but might be worth it.

1 Like

As usual, I’ve gone totally overboard optimizing this thing. I went to place the order yesterday, but apparently JLC’s US shipping network has gone down in the trade war and I’ll have to pay $23 for UPS, so I decided I’d better add the buck converters now rather than validating the basic design first. That led down a long series of revisions, ultimately resulting in the left-side input area becoming somewhat superfluous.

My original intent was to have power input on the left and bucks in the upper right, above where you would cut off for single-motor. But it seemed like a waste not to add some input holes in the otherwise empty lower right. However the aux header encroaches on the ground path, and the path to M0 on the top layer is entirely blocked by the bucks, so maximum battery current will be limited when using these input holes (I think high motor current at low RPM will still be ok, only circulating in the mosfet areas). So I left the original input area too, and added two more options for positive input.

To solve the mounting hole conundrum from before, I did move them outside the white lines, but also added a second set of mounting holes on the white lines but spaced 50mm in the y direction. My robot needs the original 46mm spacing, but this provides an elegant solution for minimum-width boards too.

I’ve also positioned the ground input holes where they can serve as mounting holes when cut to single-motor size. I moved the programming connector out of the way as best I could, but the corner slightly overlaps the ground hole pad when soldered on the top side of the board.

Amusingly, the central area turned out to be tileable after all. The 3V regulator and SDA/SCL pins are on the opposite side of the board from the aux header, so those lines had to get most of the way across anyway. That just left VDRV, and it was able to get through the sparse lower left area with little difficulty.

I added a ferrite bead for the analog supply, after seeing it in the B-G431B-ESC1 datasheet.

The last thing I need to do before ordering is to try a stencil making technique I saw on youtube. It would be great if I can avoid wasting money on stencils for failed designs or shipping after validating. But it’s not that much wasted money, so if it’s too much trouble making them myself I’ll order it.



1 Like

Adventures in stencil making:

The method in that youtube video is nowhere near as easy as he makes it look. I struggled at every step.

  1. Flattening the aluminum: Rolling it backward worked best, but it still gets ripples in it that take a lot of fiddly bending back and forth to get reasonably flat.
  2. Removing the coating: Acetone was going to take a very long time and a very large quantity. Wet sanding with 320 grit gets it done in a reasonable amount of time, but then requires polishing with micromesh that takes a few more minutes.
  3. Processing the image: I ended up exporting .svg from EasyEDA, opening it Blender, using that to resize the pads, and taking screencaps to get it into printable format. Rendering to a file would surely work better, but I’ve never actually done it before since I’ve never done any artistic modelling in Blender.
  4. Printing: This was not too difficult. Print a dot in the center of a paper, then tape a piece of transparency film centered on that dot, and print the pattern in the center so it lands on the transparency film. However I did hit the masking tape once, resulting in a bit of a mess. Apparently toner does not stick to blue tape.
  5. Transferring the toner: Many attempts and I never did get a fully clean peel. I suspect a thinner material peels off better. My transparency film is pretty thick. What seemed to help the most is putting a sheet of thin silicone between the film and sticky note to distribute pressure better, and dragging the tip of the iron across it repeatedly to really focus pressure on every point.
  6. Touchup: I filled in the blotchy areas as instructed using a Sakura Microperm pen and sharpie marker, and filled the edge area using a large alcohol marker instead of using tape like in the video so I wouldn’t have to risk bending it when peeling off. But none of the ink resists acid very well compared to the toner.
  7. Etching: I tried 1 part muriatic to 3 parts peroxide, and peroxide with citric acid and salt. Both were able to dissolve aluminum, but sitting for an hour made little progress, and even constantly agitating it with a toothpick it takes over 20 minutes to get through, and then it’s very uneven. Nowhere near the level of bubbling seen in the video. Just slow fizz.

After that I thought about buying a laser, but it would be expensive and stinky and a lot of trouble, just to make plastic stencils.

Then it occurred to me, there’s no need to match the exact shapes of the pads. Solder paste will flow when melted, so I can just use the CNC to drill a bunch of holes to get roughly the correct amount of paste, and call it a day.

My method of generating the g-code is a little cumbersome, manually typing all the component positions into a C++ program rather than processing the CAD files directly. But for the small things I do, it would be a lot more trouble writing the file processing code.

Here are the first test subjects. Many mistakes were made, and hole sizes need adjusted and/or more holes added, but I think it will work. I could also buy a 0.3mm end mill and try routing slots for the QFN pins, but I think drilling two 0.4mm holes per pin will work just as well (I only have one hole per pin on these, and it looks too small).

Drilling does leave some small burrs, but they sand off easily.

Another advantage of this method is that I don’t have to strip the coating off the soda can aluminum, except for a small spot for Z probing which needs electrical contact.

Masking tape and superglue seems best for workholding, but requires heat to melt the glue at the end, which results in some nasty fumes, and causes the tape to leave residue that has to be cleaned off with solvent.

So with this technique in hand, I ordered Gooser5 and Stepstick MAX22213 without stencils. JLC has gotten their direct line shipping network back up, but it was still $15. And I may have to pay another $15 import duty when it arrives. The UPS option allows paying it upfront, but I figure I’ll see if it goes through without any trouble, and if not then I’ll use UPS in the future.

Praise the Lord, I have voltage output! I haven’t connected a motor yet, but by past experience, anything that makes it this far will work just fine.

What an insane journey it’s been. Almost a year of doing the same thing over and over and getting different results every time. I wish this had given me a clue to get Gooser4 working, but aside from being configured for 6PWM, it’s exactly the same. And 3PWM works fine on GooserCS, so that’s not the problem.

It arrived like normal without having to pay any import duty, so I will continue using JLC’s “global standard direct line” shipping.

I went ahead and made the stencils. The one for stepstick worked great thanks to its small size, while gooser was moderately successful. The stencil isn’t 100% flat, which results in paste getting sucked underneath when it springs back up. I used a toothpick to clean up the excess. Next time I’ll try putting out a big wad of paste and swipe it across once instead of scraping a small lump around repeatedly.

To maximize my chance of success, I assembled it with new driver and capacitors and mosfets. The MCU and current sensors are the ones I had on Gooser3 (which were originally pulled from GooserCS), which can be tested without risk of explosion while powered by the STlink.

Now I need to order components to assemble more of them, but there seems to be a shortage of DRV8300DRGER. LCSC, Mouser and Digikey are all out, and none expected for at least 3 months. There are a few on ebay, but they’re not cheap.

I also still can’t decide which of the mosfets to buy from post #82.

I’ve been making slow progress. Still not spinning in foc_current mode yet, but I think it’s just a matter of parameter tuning at this point. I’m using the flux observer which is more finicky than a regular sensor setup. I’m fairly confident that the hardware design is all good.

I decided to use this board on my milling machine spindle, with the hope that it can handle higher current than the B-G431B-ESC1. Cut it in half to reduce the size a bit, since I only need one motor.



I added copper bars and ceramic capacitors on the back, and electrolytics on the front, with their legs going through holes in the bars to serve as pins to improve the mechanical strength of the solder joints. Close to 2000uF total, which is probably overkill, but the power supply wires are fairly long so it may need it. Heat gun and soldering iron together works well for the copper bars.

I had some soldering problems with the current sensors, but all are working now. The readings are sinusoidal when running in open loop, though phase A gives ~5% higher amplitude signal than the others, so I’m just using phases B and C for now. The d/q noise level seems to be consistent throughout the rotation, so 3 sensors may be superfluous anyway.

1 Like

It was indeed just a matter of hunting for the right phase_inductance to get it to spin.

But today’s main testing procedure was to hold still in open loop angle mode and observe the variation in readings at various current levels and oversampling.

256x oversampling gets the noise down to ~1%, but can only run at 10.4KHz. The main loop runs at 17KHz with one motor, so 128x is better, and still only around 2% noise (higher current has higher noise in milliamps, roughly proportional to the total current). 64x is around 3% noise, and is the most you can use with two motors. 32x is ~6.7%.

It looks like around 15A is the maximum continuous current without cooling. Possibly more. I need to test with a bigger motor because the copper bars were still comfortable to touch after running for a couple minutes, but the motor was pretty darn hot, along with the wire pads on the board. I’d like to see if that was primarily heat bleeding back toward the driver from the motor, or if the PCB copper around the current sensors will limit it to 15A.

30A is fine for a few seconds, so the full range of the current sensors is usable. Though with 3 sensors, it’s actually possible to measure 15% higher current by excluding the sensor closest to its sine peak and calculating it from the other two currents, giving up to 35A of usable phase current with a bit of headroom to spare for signal noise. Similar to how space vector PWM can use 15% higher effective voltage than sine modulation due to two of the waves always being <87% of the highest one.

Here it is with power wires soldered to the copper bars, and servo tester wires to the aux connector. 5V to the 3V regulator input, signal to SCL, and ground. Apparently there is a short between the red and yellow wires here, which had me running in circles all day thinking the GPIO registers must not be configured correctly.


I couldn’t actually see the short, but I moved the yellow wire to the neighboring SDA and that fixed it. After zooming in on a photo I’d taken before, I think I can just make out where one strand of the wire frayed out and crossed the gap.

Time waster #2 was calling the wrong InlineCurrentSense constructor because it uses NOT_SET for unused pins, but NOT_SET is defined as a floating point literal, whereas the pin arguments are int.

Here it is installed on the mini-mill.


I’m not sure why, but it has a different sound than the B-G431B-ESC1 when running. A little quieter, which is good since that was my main reason for changing from a standard drone ESC in the first place. But still a bit uncomfortable above 2000RPM. And unfortunately it seems to be causing voltage spikes or something that shut off the power supply if I set the current limit above 10 amps and harass the motor. So as it stands I’m no better off than I was before. Should I add even more capacitors? Or try to tune the current PID? I’ve always just left it at the default values since I don’t know how to judge whether it’s good or not. The readings from getDCCurrent and getFOCCurrents do seem to be pretty chaotic, with DC current having spikes up to 1.5x the current limit if I slow it down with my hand.

Big news! It turns out Gooser4 works after all!

I still haven’t ordered components because I couldn’t shake the feeling that it may be a waste to buy a bunch of the 48-pin STM32 and SMD electrolytic capacitors, and my hesitance has paid off.

  • Begin TLDR

I never tested both mosfets on the new DRV8300 because previous tests indicated that it would blow up before I could learn anything new. But I came up with a way to safely test it. The 3 cases I’ve tried before are:

  1. DRV8300 transplanted from GooserCS, all mosfets of M0 soldered on the board, all phases commanded to output 0V. The phase closest to the power input burnt. After removing those mosfets, repeated the test and the next closest to the power input burnt.
  2. New DRV8300, and only one lowside mosfet installed. Received good signal from the driver.
  3. Only highside mosfet installed. No signal on the gate pin (flat line at medium voltage regardless of input to the driver).

So presumably the lowside mosfets were 100% on when it burnt, meaning the highside was active when it shouldn’t be. So I thought if I command maximum voltage instead, then even with both mosfets on the board, lowside will always be off. Then I can gradually step down the commanded voltage until the lowside comes on briefly and see if the high side gate does anything.

Each step, I’d quickly plug and unplug the battery and check the temperature to make sure it didn’t heat significantly, and then plug it back in and check the gates with the oscilloscope.

It was around 7.33V out of 7.4V when I got a tiny blip of output to the lowside gate, and with it came a longer blip to the high side gate, boosted and everything. So I gradually stepped down more and more. No heating, clean gate pulses and output pulses, working just as it should. Now I need to get the other 4 mosfets on it and try with a motor.

  • End TLDR

It’s still a puzzle why I had two pairs of mosfets blow up during my tests with the transplanted DRV8300. If it was a soldering error I’d expect it to only be one, but it probably was both, considering how many non-fatal soldering problems I’ve had on Gooser5. It’s actually what inspired me to do more testing on Gooser4 today, since I no longer had confidence that my previous test results weren’t confounded with soldering errors.

I’m not sure if there is a lesson to be learned from all this. I would say don’t trust test results acquired with reused components assembled by a noob, but the bad mosfets on GooserCS already taught me not to trust test results acquired with new components professionally assembled.

Another wonderful day of success :slight_smile: Soldering went well, aside from one current sensor needing a touch with the iron to complete the connection on its power and/or output pins. All mosfet outputs good. Testing with an RCTimer 5010 and my usual 2S lipo, STlink to supply 3V, and FTDI for communication. Open loop first, followed by closed loop velocity using flux observer.

This setup is incredibly quiet. Holding it in my hand, I can feel slight vibration from the PID, but it becomes absolutely smooth and silent when commanded to go faster than the voltage limit allows. I didn’t go above 1000RPM, but it’s still fascinating to see something spin so fast without hearing anything.

Next I’ll hook up a bigger motor and do some current testing.

UPDATE: As expected, the maximum continuous current is 15A. 20A quickly gets too hot to keep my finger on it, but setting back to 15A it’s able to cool down to a moderately uncomfortable temperature again. 16A heats more slowly, but still gets too hot.

There doesn’t seem to be any bottleneck. Temperature is pretty close to equal all over the power area, and drops rapidly as you move away from there. Even the short distance to the battery terminals is much cooler, since the battery current is very small compared to motor current when not spinning. The other end of the copper bars is only a bit warm. I thought they’d conduct heat better than that.

2 Likes

Conclusions from the latest testing:

  • Capacitors don’t help with voltage spikes.
  • What does help is ramping velocity to avoid applying torque in opposition to motion.
  • Voltage limit > 6.5 causes skipping (maybe CPU speed?)
  • Flux observer is giving me wonky current waveforms.
  • 2 current sensors is all you need.
  • The default current PID values are good.
  • Actual no-load RPM is ~1.5x motor voltage x kv. This means you can only reach 87% of power supply voltage x kv, even with SpaceVectorPWM.

Now that my milling machine has Gooser5, I put its old B-G431B-ESC1 on my lathe toolpost mini-spindle, which has a modified RCTimer 5010.

It had even more trouble with voltage spikes shutting off the power supply than Gooser5, which is surprising since I never had any trouble with it on the mill with its larger Racerstar BR4114. Maybe because the mini-spindle’s bearings spin more freely, so the mill was dissipating energy through friction instead.

Both of them now run in torque mode with target = motor.current_limit, and use motor.voltage_limit to control speed, with changes ramped at 20V/s so it slows down gently (previously I was changing in 1V steps instantaneously). No more problems until I get above 6.5V, at which time both of them start skipping and can spike the power supply. Coincidentally the electrical RPM is about the same on both, and this is about 24 updates per electrical revolution, so that may be the minimum needed for flux observer to work.

I tested the ESC1 with and without a 2200uF capacitor, before and after adding the voltage ramping. It doesn’t seem to make any difference at all, so apparently the 210uF of onboard ceramics are all it needs. I have 330uF of ceramics on the Gooser5, so its electrolytics were probably superfluous too.

Next I set off on a campaign of current waveform plotting on the mill’s Gooser5 running Racerstar BR4114. I wanted to see how my plan to sample the two current phases farthest from their sine wave peak compares to sampling all 3 phases, or only having 2 current sensors. The shape of the waves is nearly identical in all cases. Dynamically selected phases is actually the worst because it introduces a small spike at each sector change, although this may disappear with amplitude calibration. When running open loop at 30rad/s, my phase A sensor is giving ±10.8A, phase B ±10A, and phase C ±9.8A.

Open loop gives fairly clean waveforms. 20rad/s is trapezoidal (ignore the artifact at the first vertical line), 30rad/s sinusoidal, and 50rad/s looks like the SpaceVectorPWM waveform, but gets the same thing when running with sine modulation so I’m not sure what that’s about. It’s possible the shape is affected by the balance between speed and voltage limit, but I didn’t think to test it at the time.

The dark gray vertical lines are 60 degree boundaries, blue is phase A, green phase B, red phase C, and light gray is currentSense.getDCCurrent().



And here are the wonky waveforms of closed-loop flux observer running at 35rad/s and 100rad/s. 100rad/s is hard to even see the fundamental frequency anymore, yet it runs fine up to 430rad/s. Not sure what to make of this. I’m fairly certain it’s not due to my noisy current sensors since it’s so consistent. I also tried 16x oversampling compared to 64x on these plots, and it only added a bit of high frequency noise, no change to the wave shapes. I also tried playing with the current PID values and wasn’t able to improve it. I’d like to see what it looks like with a position sensor, but I don’t care quite enough to set it up. I’ll test that on the lathe’s hoverboard motor when I get a Gooser5 on it.


And for comparison, here is 35rad/s with sensor C disabled. As you can see, the red wave shape calculated from the other two is nearly identical to the measured one above.

Now that I’ve done some real-world testing with Gooser5, I could see where it needed a few improvements.

  • Changed to 2 channel current sense instead of 3, as I had considered back in post #85. Minimal difference in testing, and this way is $1 cheaper per motor, simpler ADC code, and the mounting holes can be spaced 46mm and board size reduced by 4mm.
  • Switched around some ADC channels so both motors use ADC1 for phase A and ADC2 for phase B (simplifies ADC code).
  • Renamed the phases so they match the timer 1,2,3 pin order rather than the DRV8300’s phase names (initializing the driver was unnecessarily confusing).
  • Changed to 0603 capacitors on the back for the current sensors, for easier hand soldering.
  • Moved reset pullup to top layer.

And of course once I got started I changed a bunch of other stuff too.

  • Changed mosfets from BSZ0901NS to JMSL0302AU. Saves about $3 per motor, and BSZ is not recommended for new designs, and doesn’t really have any advantage aside from brand reputation.
  • Added an exposed copper trace connecting 3V to the encoder connector power pins. This can be cut and and solder a wire to LVin to give higher voltage on the connectors for digital hall sensors.
  • Changed low-voltage buck to output 4.67V instead of 4.3V so it can supply digital halls.
  • Changed to the larger 3V regulator from Lepton, which eliminates the need for the low-voltage buck for single-motor, though it comes at the cost of not being able to properly mount the programming connector on the top side (it will still work, just tilted up on the edge of the CPU).
  • Rearranged the aux connector so LVin can be joined to VDRV easily, and to solve a problem where HVin would get disconnected on minimum width single-motor boards.
  • Expanded the exposed copper areas to make SMD electrolytic capacitors fit better. This eats into the documentation area, so I had to move the timer pin numbers to the top silkscreen.
  • Increased the board width by 1mm on the right to give the positive power rail more copper cross section, and removed an HV_IN trace on Inner2 which gives the ground rail another 25% or so copper cross section. The left-side power rails are now unnecessary except in the case of mounting two boards face-to-face.

I really should have finished testing everything before making a new version, but missed my chance when LCSC got a few DRV8300 back in stock. Still couldn’t make up my mind what all capacitors to buy, and now it’s back to waiting. What still needs tested:

  • Buck converters
  • I2C and encoder pins (unlikely to have any problems)
  • Maximum current without copper bars
  • JMSL0302AU mosfets (unlikely to make any noticeable difference)

I did a few price checks for single-sided JLC assembly. 10pcs dual-motor is under $8 per motor, 30pcs quad-motor under $5 per motor. Small quantities of single-motor are the most expensive. 5pcs is $12.80 without bucks, $13.80 with HV buck, and $15.80 with both (but low-voltage buck is generally not needed for single motor anymore, thanks to the larger 3V regulator). 10pcs with HV buck is $10 per motor.





Gooser5 is finally verified fully functional!

I somehow forgot to buy the 51k resistors for the low-voltage buck feedback and vbus sense, but 1k and 4.7k gives a usable ratio for the buck (4.3V output rather than 4.6V), and I just left vbus unpopulated since I don’t need it, it’s highly unlikely to have any issues, and would waste 50mW if I use these lower value resistors.

I used the low-cost JMSL0302 on one motor and even-lower-cost AGM403P on the other three. I’ll be using this on my milling machine, so the low resistance of JMSL0302 is good for the spindle, and slightly higher resistance of AGM403P is a non-issue for low-current stepper motors.

I only populated two current sensors per motor, since I wouldn’t use the third anyway. I soldered copper bits across their pads to complete the connection to the motor wire pads.

Here is the setup with my stencil made from an aluminum can with CNC drilled holes for the pads. Double stick tape under the board, two spare boards to serve as spacers, and then fiddle the top and bottom tapes until it’s as flat as possible (still a small bubble in the buck converter area).

I laid the paste on thick, and took two swipes from top to bottom (my spreader isn’t wide enough to do it in one). Somehow it still didn’t fill everything. Maybe I need to gradually tilt the spreader down as I move, to be sure the paste doesn’t just stick to it and then get lifted away if I unintentionally tilt it up as I move. I held the bubble down and scrubbed at it a bit more until everything was filled. Came out clean enough that I didn’t have to do any toothpick editing.

After placing all the components, I wicked some Kester 186-18 liquid flux (one of the stickiest substances I’ve ever encountered) around them to hopefully help resist blowing away from the heat gun. It worked.

It turned out there was a bit too much solder on the 0.5mm pitch pins. I think my stencil holes are slightly too big. But they can be fixed with the soldering iron afterward.

I had to scrape off some solder mask on the back to make pads for SMD electrolytic capacitors. I used three 50V 220uF per motor, which is less than Valentine’s recommended 1000uF per motor on Lepton, but still more than I see most people using. I should have bought more 35V 470uF instead. I had forgotten that electrolytics can be pushed closer to their limit than ceramic and polymer.

Soldering them was a bit of a struggle for the heat gun, and they look like they could have used some more solder, but it’ll do. I had hoped it would be possible to do them with a soldering iron so more people would be able to order single-side assembly and do the back side at home, but I think not. I didn’t actually try it, but I doubt you’d be able to get it to melt with so much heat sinking, and even if you could it would be a challenge to keep the capacitor from sliding around. Might work if you warm it up on a 3D printer heat bed to reduce the temperature difference. Even just soldering the connectors was a lot easier when I warmed it up with the heat gun first.


After some testing, it looks like the JMSL0302 mosfets (30V, 1.2mOhm) can handle 10 amps continuous without cooling, and AGM403P (40V, 2.7mOhm) can handle 8 amps. This is using the getDCCurrent function (the individual phase currents are a bit lower), and my finger as a temperature probe. So heavy copper bars are highly effective, since I got 15 amps when I tested with them before. I was planning to remove the large soldermask openings in the next version, but it might be worth trying stacked copper bars and SMD electrolytics after all.

EDIT: Copper bars do nothing! Apparently BSZ0901 mosfets are much better than JMSL0302, despite similar datasheet values.

I was annoyed at the idea of losing 1/3 of my usable spindle torque, so I desoldered 3 of the capacitors, scraped some more solder mask, added some copper bars (about 1x3mm) and soldered the capacitors back on top of them. 10 amps remains the limit before it gets uncomfortably hot to touch.

4 Likes

To anyone reading along: Am I a clueless noob for using two different buck converters rather than two copies of the same one configured for different output voltages? They’ve always been a “black box” to me, but I think there’s no reason to use the larger XL1509-ADJE1 for the gate driver voltage.

It has higher 2A current capacity than the LMR14006YDDCR’s 600mA, but if I’m calculating correctly, 3x3mm mosfets typically have around 25nC gate charge, so to charge and discharge 6 of them at 25KHz PWM frequency should be 25nCx2x6x25000Hz=7.5mA per motor. I think Valentine only chose it because it’s a JLC basic part, but if I’m paying an extended parts fee for LMR14006YDDCR anyway, it will be cheaper to use two of them since they can both use the same inductor, eliminating one extended part.

It also looks like I could squeeze in a CAN transceiver at the cost of slightly increasing the minimum single-motor board size and crowding the -V input hole for dual-motor. But should I? It will add another dollar and extended parts fee and fabrication and testing cycle. And Gooser is designed for having the drivers centrally located near the power source, whereas CAN is most beneficial when the drivers are located near each motor with long wire runs communicating to them. But there’s nothing stopping people from distributing single-motor Goosers around a robot, so maybe it would be worth having.

Hi Antun and Dekutree64, sorry if this is a bit out of scope for this post:
I recently received a custom board using a stspin32g4 and the SE3082G FETs from JLCPCB using their assembly service. The high side FETs are non functional and I stumbled upon your post mentioning issues with the SE3082G.

What i have tested so far:
Diode test from source to drain on high and low side. High side shows open and low side gives reasonable results. Tested on 5 boards so in total on 15 FETs same results. 3 of the boards have not been powered up so I don’t believe it is because I have fried the FETs.
Measured gatedriver signals which all seem reasonable. Clean edges with proper dead-time. However the high side FETs never conduct with Vgs=12V.
Desoldered a FET and applied Vgs of 12V and measured between source and drain with my DMM showing an open connection.

All this leads me to believe that i have received boards with faulty FETs. I wanted to hear if these observations match what you experienced and if you contacted LCSC/JLC? If so what was their response?

Thanks in advance

Yep, that sounds like the same bad batch. I sent an email informing them of the problem and asking to get a new reel so I could order more, but received no response, and the remaining stock hasn’t decreased much since then.

I never found any substitutes with the internal drain-source connection, but now that I think about it maybe we could use the kind with two independent mosfets like AGM303MNA and make the connection externally:


The diagonal trace is 0.6mm wide, with about 0.3mm clearance to the pads, and the copper area would reduce the heating even further (hopefully without causing any soldering problems). The left and right sides are reversed from SE3082G, but that results in better layout for the ground via area compared to having it crammed between the two gate lines.

Update on SE3082G:

I contacted LCSC who investigated the issue. Turns out the manufacturer has changed the MOSFET to no longer have the internal Drain-Source connection between the two FETs.

So I guess this answers the question about what happened with batch number “230822”.

Extremely annoying but somewhat fixable with a wire from pin S1 to D2, at least in my design since i left pin 1 NC.

I am simultaneously running a customer complaint case with JLCPCB hoping for at least a partial refund.

Datasheet on LCSC has been updated. I will urge JLCPCB to quickly do the same

I believe I have looked at almost every dual N-channel mosfet with the correct footprint on LCSC but unfortunately I too have not been able to find a substitute with drain-source connected internally.

3 Likes