Wow, thanks @kvk! I’ve had far less thorough reviews from some companies I’ve worked at! You pointed out a few things I totally forgot to look at, and in some cases (capacitor footprints!) would have gone to copper, so thanks very much. I’ve addressed each point below:
R4 etc is 20mOhm, guess that is a typo
Yep - typo a copy and paste error on my part, I’ll change that to around 5 Ohms, it’ll be a placeholder anyway, but 20m is very misleading so I’ll change that.
D1 is zener. Replace with schottky. Zeners are sloooooow, so your gate boost turn of will dripple current through the parasitic cap
I think I chucked down any diode from the library - I should have spotted this is the symbol for a zenner! I was going to use something like this Buy Electronic Components Online - LCSC Electronics an SMD UF4007.
R20 is not nessesary, NRST has internal pullup. Normally when using external resistor is should be of 10k or less (avoid glitches)
I did not know that! I guess I should have guessed by the ‘N’ prefix, assuming that’s active low, and therefore has an internal pull up? Looking in the datasheet just now, it does state it has a permanent pull up, but could I have guessed by the ‘N’ prefix?
U2 has abs max 55V, but zener D7 is 56V type, so that won’t protect the module
D7 was there mainly so that the BLDC doesn’t generate a significant voltage to overcharge the battery. Let’s say that the battery is already at 55V (it’s maximum) and I’m going down a hill freewheeling, I wanted to ensure I don’t over charge the battery?
But you make a good point regarding it not saving the IC, however, the absolute max is 65V, so I think it should be okay.
U4 is is not a rail to rail opamp, so you cannot measure the stage current. Also, you need protection on that input, the motor currents can be negative. I think the MCP6c61 is a rail-to-rail opamp, though (https://ww1.microchip.com/downloads/en/DeviceDoc/20005367B.pdf). But I’m not sure what stage current is, is that an auto correct error and should be stall current?
You’re totally right about the negative current’s - I forgot entirely about that. I’ll add a schottky diode in series with the filter, to prevent any reverse current flow from the Opamp.
C23 is 0.47n, you need minimum 22uF for the buck converter
D8 should be schottky
DOH - again, copy paste error, but I would have taken that to copper! Thanks for pointing this out. I also haven’t yet spec’d the diode, I forgot about that. So I’ll find that too.
DS1 datasheet is hard to find, but AFAICS LED must be supplied from 5V. So no R34 and you need to drive it higher than 3.3V. The controller also seems to be needing 5V
DS1 is a placeholder for a random LCD module I have at home, but I will check that it’s 3v3 compatible, because I just assumed it would be, nice spot. The IO expander (U3) seems to be fine at 3v3.
A side comment. BLDC has more noise than FOC. The F030 can handle 3 phase FOC with the ST motor control library, so you could remove the need for the motor controller and hall sensors. Don’t know if you have other specific reasons for BLDC control. Maybe sourcing issues
Yeah this is totally a personal thing - I want to, at some point, write my own drivers for the F030, hence why I have the Hall effect sensors connected, but I don’t really need them for the control (since the driver will be doing that for me). But, to speed things up, I thought I’d start off with a driver. I can then probe the driver, see how it drives things, and replicate it in software at a later date, and, like you say, remove the driver and possibly the hall effect sensors if I go for FOC.
Thanks very much for the review!