I haven't had a chance to post recently as I've been busy working on the TI board and have recently received a new board.
The TI board requires a lot of point-to-point wiring to the Nucleo board, and it looks like this:
I got an ST STSPIN32G4 board yesterday. This board has a chip that integrates the STM32G4 MCU, gate drivers, and opamps and comparators for current sensing and overvoltage protection. It's a lot cleaner, needing only the three motor phases, the encoder signals, and DC power as external connections. I spent several hours this morning porting the STM32F7 code over to the STM32G4 and resolving the differences.
The first thing I did when I got the board up and running was to test the encoder inputs. This is some simple code that just reads the encoder inputs in a loop and prints the current value on a serial terminal. When I hooked up the motor's Hall encoder output to the board, I was getting only even numbers displayed: 2, 4, 6, and the forbidden 0. That implied that Hall #1 was stuck low. I checked my code thoroughly and didn't find anything wrong. Next I checked the board itself.
The Hall #1 input has continuity from the connector pin on the board all the way to the pin on the STSPIN32G4 chip--so far so good. But when I powered up the board and looked at voltages the issue became clear. The board has 10K pull-ups on all three Hall inputs (for some reason they're pulled up to 3.3v rather than the 5v that's on the "Hall PWR" pin), so I was expecting all three Hall inputs at the MCU to be 3.3v with nothing connected to the Hall inputs on the board. That was true for Hall #2 and #3, but Hall #1 was at 1.25v. Looking at the datasheet, the input threshold for a logic high is 1.88v, which explains why I'm only seeing a low on Hall #1, even when I tie it directly to Vdd at the Hall #1 connector pin on the board.
Here's the schematic of the sensor input section of the board:
When I Tie Hall #1 (H1) high, I measure 5v at Point A and 1.72v at Point B. Measuring Hall #2 and Hall #3 at equivalent points in their circuits gives 5v at both points. R81 is dropping 3.28v, which it shouldn't be, because it connects directly to port PB6 on the MCU, which is an input and therefore high impedance. I suspect a partial short to ground somewhere. It's not a direct short, or Point B would measure 0v. R85 isn't populated on the board, so it's not that. I'm suspecting that C34 is bad or perhaps there's a short somewhere on the board (or on an inner layer). I looked at the board pretty closely and didn't see anything obvious.
Anyone have any suggestions for what to look at and/or try next? I could send the board back and request a replacement, but it's a holiday weekend here and I'd like to get some work done with it.
@mxlemming: With my small motor, calculated ripple current is ~88 mA, which is 2x the drive current. Now that I have a dyno, I can put some load on the motor and drive it up to current levels several times the ripple current and I'm hoping the measured current will look less like noise!