HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
TMC9660::StepDir Struct Reference

Subsystem for controlling the STEP/DIR pulse input interface. More...

#include <TMC9660.hpp>

Collaboration diagram for TMC9660::StepDir:

Public Member Functions

bool setMicrostepResolution (tmc9660::tmcl::StepDirStepDividerShift µSteps) noexcept
 Configure microstep resolution for each STEP pulse.
 
bool enableInterface (bool on) noexcept
 Enable or disable the STEP/DIR interface.
 
bool enableExtrapolation (bool enable) noexcept
 Enable signal extrapolation between STEP pulses.
 
bool setSignalTimeout (uint16_t timeout_ms) noexcept
 Timeout before extrapolated motion stops after last pulse.
 
bool setMaxExtrapolationVelocity (uint32_t eRPM) noexcept
 Set maximum allowed extrapolation velocity.
 
bool enableVelocityFeedForward (bool enableVelFF) noexcept
 Enable hardware feed-forward terms and set gain/shift.
 

Private Member Functions

 StepDir (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

Subsystem for controlling the STEP/DIR pulse input interface.

Enables stepper-style control using external STEP and DIR pulses, with support for:

  • Signal extrapolation to interpolate between pulses
  • Velocity feed-forward
  • Microstep resolution configuration

Refer to Parameter IDs #205–#209 (Table 48). See datasheet page 95 for details on the STEP/DIR interface.

Constructor & Destructor Documentation

◆ StepDir()

TMC9660::StepDir::StepDir ( TMC9660 parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ enableExtrapolation()

bool TMC9660::StepDir::enableExtrapolation ( bool  enable)
noexcept

Enable signal extrapolation between STEP pulses.

Parameters
enabletrue = enable extrapolation
Returns
true on success
  • Parameter: STEPDIR_EXTRAPOLATE
  • Behavior described on p. 96, Fig. 27

◆ enableInterface()

bool TMC9660::StepDir::enableInterface ( bool  on)
noexcept

Enable or disable the STEP/DIR interface.

Parameters
ontrue = enable, false = disable
Returns
true on success
  • Parameter: STEPDIR_ENABLE
  • Boot option: see datasheet Table 11

◆ enableVelocityFeedForward()

bool TMC9660::StepDir::enableVelocityFeedForward ( bool  enableVelFF)
noexcept

Enable hardware feed-forward terms and set gain/shift.

This allows the ramp generator to use feed-forward terms for velocity and acceleration.

Parameters
enableVelFFEnable the VELOCITY_FEEDFORWARD feature (VELOCITY_FEEDFORWARD_ENABLE)
Returns
true on success

◆ setMaxExtrapolationVelocity()

bool TMC9660::StepDir::setMaxExtrapolationVelocity ( uint32_t  eRPM)
noexcept

Set maximum allowed extrapolation velocity.

Parameters
eRPMMax electrical RPM before extrapolation is disabled
Returns
true on success
  • Parameter: STEPDIR_MAXIMUM_EXTRAPOLATION_VELOCITY

◆ setMicrostepResolution()

bool TMC9660::StepDir::setMicrostepResolution ( tmc9660::tmcl::StepDirStepDividerShift  µSteps)
noexcept

Configure microstep resolution for each STEP pulse.

Parameters
µStepsMicrosteps per full step (e.g. 256 = 1/256 resolution)
Returns
true on success
  • Parameter: STEPDIR_STEP_DIVIDER_SHIFT (shift of incoming step pulse count)

◆ setSignalTimeout()

bool TMC9660::StepDir::setSignalTimeout ( uint16_t  timeout_ms)
noexcept

Timeout before extrapolated motion stops after last pulse.

Parameters
timeout_msTimeout in milliseconds
Returns
true on success
  • Parameter: STEPDIR_STEP_SIGNAL_TIMEOUT_LIMIT

Friends And Related Symbol Documentation

◆ TMC9660

friend class TMC9660
friend

Member Data Documentation

◆ driver

TMC9660& TMC9660::StepDir::driver
private

The documentation for this struct was generated from the following files: