ZEROPILOT AM debug - Mistake record
Firmware part:
SF_InterfaceINIT() is not used will likely cause a hardware fault
global and local scope variables will cause the data used in the function, not the one That contains the actual data.
When using an array: PLZ put the index in a variable with a meaningful name; otherwise, the code is not maintainable.
The state machine is a loop so the last state will need to call the first state
When just cloning the ZP_Proto_Port from the git, we need to init the submodule.
The dshot wave needs to measure with the PWM signal by configuring the trigger mode.
Be extremely careful when using the oscilloscope to measure shot in run mode may have some reason to cause the STM32 to brick.
Hardware issue
The ESC has a VCC output which is 12v, this is of no use plus it may burn the Nucleo if connected to the pin
reason: this red cable is specifically designed to power the MCU, but in our testing case, there is no need to connect the VCC to the Nucleo when the computer wire is attached. Plus it will burn the Nucleo.
Conclusion: Nucleo is not good at handling voltage, so every pin being plugged in needs to be checked before
The ESC output a 120-degree-phased-out sin wave So that when the signal is passed in the ESC will process the signal and output the correct wave to the magnet on the motor. Therefore there is no strict order to connect the wire, sequential is what we need.
Burning a board may cause the burning of other related sensor and board, which is unfavourable.
Do NOT expose the connector and DO NOT short the board when power is ON during testing => this will directly lead to burning the board.
reference:
Brushless motor with ESC: How Brushless DC Motor Works? BLDC and ESC Explained