- Decided on STM32G0B1CBT6 microcontroller
- Has PWM, SPI, UART, USB, encoder and spare GPIO peripherals
- https://jlcpcb.com/partdetail/Stmicroelectronics-STM32G0B1CBT6/C2847904
- Will program with SWD (Serial Wire Debug) interface
- SWLCK - clock signal
- SWDIO - allows user to use debugger (set up breakpoints, step through etc.), code is uploaded via this pin
- SWO - unidirectional data from microcontroller to computer enables real-time monitoring and analysis of program behavior, performance and other relevant information,
- Will not use this pin
- **The SWIM pin on ST-Link V2 is to STM8 what SWIO is to STM32
- *** BOOT0 pin must be low to run flashed program and to program device over SWD, only high if you want to program device over USB
- Most likely going to power IC using 3.3V
- Use I2C to communicate with sensors, PWM and Encoder for feedback control over motors, SPI to save to external memory, and UART to communicate with Bluetooth module
- Decided on DRV8876PWPR motor driver
- https://jlcpcb.com/partdetail/TexasInstruments-DRV8876PWPR/C575551
- Has two control modes, Ph/EN and PWM
- To control 2 motors, PH/EN requires two PWM signals, PWM mode requires 4 PWM signals
- Will use PWM mode unless using the same timers for PWM and Encoder causes issues, or need to use those pins for other reasons
- ** PWM operate motors in all 4 modes (Coast, Reverse, Forward, Brake (low side decay)), Ph/EN only doesn't allow for coasting
- Braking Mode: Often referred to as "dynamic braking" or "short-circuit braking", involves stopping the motor from more quickly by creating a closed circuit via the motor windings which dissipates the rotational energy as electrical energy, then heat due to resistive forces
- Turn low side switches on
- The effectively shorts the motor terminals together
- As the motor continues to spin to to its inertia, it acts like a generator, generated current flows through the short circuit
- This current generates a counter-torque that opposes the rotation, causing the motor to slow down more quickly than if it were allowed to coast
- Coasting Mode: Allows motor to slow down naturally due to friction or other resistive forces with out actually applying any braking forces
- Braking Mode: Often referred to as "dynamic braking" or "short-circuit braking", involves stopping the motor from more quickly by creating a closed circuit via the motor windings which dissipates the rotational energy as electrical energy, then heat due to resistive forces
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.