HF-TMC9660 Driver 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
tmc9660::TMC9660< CommType >::StepDir Struct Reference

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

#include <tmc9660.hpp>

Collaboration diagram for tmc9660::TMC9660< CommType >::StepDir:
[legend]

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 e_rpm) noexcept
 Set maximum allowed extrapolation velocity.
 
bool enableVelocityFeedForward (bool enable_vel_ff) 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

template<typename CommType>
struct tmc9660::TMC9660< CommType >::StepDir

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()

template<typename CommType >
tmc9660::TMC9660< CommType >::StepDir::StepDir ( TMC9660 & parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ enableExtrapolation()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::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()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::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()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::StepDir::enableVelocityFeedForward ( bool enable_vel_ff)
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
enable_vel_ffEnable the VELOCITY_FEEDFORWARD feature (VELOCITY_FEEDFORWARD_ENABLE)
Returns
true on success

◆ setMaxExtrapolationVelocity()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::StepDir::setMaxExtrapolationVelocity ( uint32_t e_rpm)
noexcept

Set maximum allowed extrapolation velocity.

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

◆ setMicrostepResolution()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::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()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::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

template<typename CommType >
friend class TMC9660
friend

Member Data Documentation

◆ driver

template<typename CommType >
TMC9660& tmc9660::TMC9660< CommType >::StepDir::driver
private

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