Skip to content

Conversation

@Ragiton
Copy link

@Ragiton Ragiton commented Nov 5, 2025

Handles phase_state on Teensy 4.1 so that PWM pins will be disabled when motor.disable() is called.

Description

This is only for Teensy 4.
This enables coasting the motor on drivers where the enable pin does not fully disable the driver and all 6 PWM pins must be disabled. Without this, the motor would lock up when calling motor.disable() due to PWM pins still being active when using driver board: https://www.sparkfun.com/sparkfun-brushless-motor-driver-3-phase-tmc6300.html

Type of change

Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Motor spins freely when calling motor.disable()

Test Configuration/Setup:

askuric and others added 3 commits July 28, 2025 12:05
Handles phase_state so that PWM pins will be disabled when motor.disable() is called.

This enables coasting the motor on drivers where the enable pin does not fully disable the driver and all 6 PWM pins must be disabled.
@runger1101001
Copy link
Member

Very nice, thank you for this contribution!

Do you know when the phase-state setting takes effect? Is it right away, or is it also related to the line in write_pwm_pair():

flexpwm->MCTRL |= FLEXPWM_MCTRL_LDOK (1<<submodule) ; // signal new values

If its immediate I would have said its better to pre-compute the changes for all three phases and set them at the same time?

@runger1101001 runger1101001 added the enhancement New feature or request label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants