Porting to my hardware

I have an STM32F072 board and just designed a simplefocmini compatible board.

So I’m trying to get this combination to work. First got the sensor (AS5600) working. So now on the the real FOC.

So I had first made a mistake to use PA7-8-9 instead of PA8-9-10. Oops. Then tried it with the hardware still wired up for PA7-8-9 and got bad signals on PA7. That took much too long before I realized I had fixed the software to use 8-9-10. So then I hooked up that part correctly verified good PWM signals on all three wires going to the driver board. Then I plugged the three signals into driver board and… the motor started spinning! Great!

Then I restarted the “angle control” example, and… nothing! Still “no movement detected” at startup. :frowning: . No power draw at all either.

PS: Oh. Just checking: Can I use any pin for “EN” ? I used PB9 (I was aiming for PA0, but missed).

PPS: Another thing! On simplefocmini: Is the series-resistor of 10k on EN intended or was that meant as a pulldown?

Update:
I got openloop speed to work.

Then when going back to the angle control example, I noticed that it was different after a power supply cycle. I think the drv chip may have been asserting fault and then refusing to do anything.

So now I’ve hooked up nRESET, nSLP and nFLT , now I get the calibration cycle to run. This required setting the voltage for the angle calibration to 1V. That now seems to work.

Then the motor becomes really acitve, (i.e. vibrating) when the angle-control becomes active. Then when I modify the PID parameters of the angle-pid, it seems I can get the calibration to fail. I don’t understand why that would be the case. I now have: motor.P_angle.P = 2; which is 10x lower than the example suggests, but still unstable.

supply = 12V,
limit = 1V. (now).
Any suggestions on what to tune next?

OK, update: I managed to get the velocity PID tuned and now also the angle control works.