Tic Stepper Motor Controller library for Arduino
Classes | Enumerations | Variables
Tic.h File Reference
#include <Arduino.h>
#include <Stream.h>
#include <Wire.h>
Include dependency graph for Tic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TicBase
 
class  TicSerial
 
class  TicI2C
 

Enumerations

enum  TicProduct {
  Unknown = 0, T825 = 1, T834 = 2, T500 = 3,
  T249 = 4, Tic36v4 = 5
}
 
enum  TicError {
  IntentionallyDeenergized = 0, MotorDriverError = 1, LowVin = 2, KillSwitch = 3,
  RequiredInputInvalid = 4, SerialError = 5, CommandTimeout = 6, SafeStartViolation = 7,
  ErrLineHigh = 8, SerialFraming = 16, RxOverrun = 17, Format = 18,
  Crc = 19, EncoderSkip = 20
}
 
enum  TicCommand {
  SetTargetPosition = 0xE0, SetTargetVelocity = 0xE3, HaltAndSetPosition = 0xEC, HaltAndHold = 0x89,
  GoHome = 0x97, ResetCommandTimeout = 0x8C, Deenergize = 0x86, Energize = 0x85,
  ExitSafeStart = 0x83, EnterSafeStart = 0x8F, Reset = 0xB0, ClearDriverError = 0x8A,
  SetSpeedMax = 0xE6, SetStartingSpeed = 0xE5, SetAccelMax = 0xEA, SetDecelMax = 0xE9,
  SetStepMode = 0x94, SetCurrentLimit = 0x91, SetDecayMode = 0x92, SetAgcOption = 0x98,
  GetVariable = 0xA1, GetVariableAndClearErrorsOccurred = 0xA2, GetSetting = 0xA8
}
 
enum  TicOperationState {
  Reset = 0, Deenergized = 2, SoftError = 4, WaitingForErrLine = 6,
  StartingUp = 8, Normal = 10
}
 
enum  TicPlanningMode { Off = 0, TargetPosition = 1, TargetVelocity = 2 }
 
enum  TicReset {
  PowerUp = 0, Brownout = 1, ResetLine = 2, Watchdog = 4,
  Software = 8, StackOverflow = 16, StackUnderflow = 32
}
 
enum  TicDecayMode {
  TicDecayMode::Mixed = 0, TicDecayMode::Slow = 1, TicDecayMode::Fast = 2, TicDecayMode::Mixed50 = 0,
  TicDecayMode::Mixed25 = 3, TicDecayMode::Mixed75 = 4
}
 
enum  TicStepMode {
  Full = 0, Half = 1, Microstep1 = 0, Microstep2 = 1,
  Microstep4 = 2, Microstep8 = 3, Microstep16 = 4, Microstep32 = 5,
  Microstep2_100p = 6, Microstep64 = 7, Microstep128 = 8, Microstep256 = 9
}
 
enum  TicAgcMode { Off = 0, On = 1, ActiveOff = 2 }
 
enum  TicAgcBottomCurrentLimit {
  P45 = 0, P50 = 1, P55 = 2, P60 = 3,
  P65 = 4, P70 = 5, P75 = 6, P80 = 7
}
 
enum  TicAgcCurrentBoostSteps { S5 = 0, S7 = 1, S9 = 2, S11 = 3 }
 
enum  TicAgcFrequencyLimit { Off = 0, F225Hz = 1, F450Hz = 2, F675Hz = 3 }
 
enum  TicPin {
  SCL = 0, SDA = 1, TX = 2, RX = 3,
  RC = 4
}
 This enum defines the Tic's control pins.
 
enum  TicPinState { HighImpedance = 0, InputPullUp = 1, OutputLow = 2, OutputHigh = 3 }
 
enum  TicInputState {
  TicInputState::NotReady = 0, TicInputState::Invalid = 1, TicInputState::Halt = 2, TicInputState::Position = 3,
  TicInputState::Velocity = 4
}
 This enum defines the possible states of the Tic's main input. More...
 
enum  TicMiscFlags1 {
  Energized = 0, PositionUncertain = 1, ForwardLimitActive = 2, ReverseLimitActive = 3,
  HomingActive = 4
}
 
enum  TicMotorDriverError { None = 0, OverCurrent = 1, OverTemperature = 2 }
 
enum  TicHpDriverError {
  OverTemperature = 0, OverCurrentA = 1, OverCurrentB = 2, PreDriverFaultA = 3,
  PreDriverFaultB = 4, UnderVoltage = 5, Verify = 7
}
 

Variables

const uint8_t TicCurrentUnits = 32
 
const uint8_t TicT249CurrentUnits = 40
 
const uint16_t TicInputNull = 0xFFFF
 

Detailed Description

This is the main header file for the Tic Stepper Motor Controller library for Arduino.

For more information about the library, see the main repository at: https://github.com/pololu/tic-arduino

Definition in file Tic.h.

Enumeration Type Documentation

◆ TicAgcBottomCurrentLimit

This enum defines possible AGC buttom current limit percentages.

See TicBase::setAgcBottomCurrentLimit() and TicBase:getAgcBottomCurrentLimit().

Definition at line 193 of file Tic.h.

◆ TicAgcCurrentBoostSteps

This enum defines possible AGC current boost steps values.

See TicBase::setAgcCurrentBoostSteps() and TicBase::getAgcCurrentBoostSteps().

Definition at line 209 of file Tic.h.

◆ TicAgcFrequencyLimit

enum TicAgcFrequencyLimit
strong

This enuam defines possible AGC frequency limit values.

See TicBase::setAgcFrequencyLimit() and TicBase::getAgcFrequencyLimit().

Definition at line 220 of file Tic.h.

◆ TicAgcMode

enum TicAgcMode
strong

This enum defines possible AGC modes.

See TicBase::setAgcMode() and TicBase::getAgcMode().

Definition at line 182 of file Tic.h.

◆ TicCommand

enum TicCommand
strong

This enum defines the Tic command codes which are used for its serial, I2C, and USB interface. These codes are used by the library and you should not need to use them.

Definition at line 65 of file Tic.h.

◆ TicDecayMode

enum TicDecayMode
strong

This enum defines the possible decay modes.

See TicBase::getDecayMode() and TicBase::setDecayMode().

Enumerator
Mixed 

This specifies "Mixed" decay mode on the Tic T825 and "Mixed 50%" on the Tic T824.

Slow 

This specifies "Slow" decay mode.

Fast 

This specifies "Fast" decay mode.

Mixed50 

This is the same as TicDecayMode::Mixed, but better expresses your intent if you want to use "Mixed 50' mode on a Tic T834.

Mixed25 

This specifies "Mixed 25%" decay mode on the Tic T824 and is the same as TicDecayMode::Mixed on the Tic T825.

Mixed75 

This specifies "Mixed 75%" decay mode on the Tic T824 and is the same as TicDecayMode::Mixed on the Tic T825.

Definition at line 134 of file Tic.h.

◆ TicError

enum TicError
strong

This enum defines the Tic's error bits. See the "Error handling" section of the Tic user's guide for more information about what these errors mean.

See TicBase::getErrorStatus() and TicBase::getErrorsOccurred().

Definition at line 44 of file Tic.h.

◆ TicHpDriverError

enum TicHpDriverError
strong

This enum defines the bits in the "Last HP driver errors" variable.

See TicBase::getLastHpDriverErrors().

Definition at line 296 of file Tic.h.

◆ TicInputState

enum TicInputState
strong

This enum defines the possible states of the Tic's main input.

Enumerator
NotReady 

The input is not ready yet. More samples are needed, or a command has not been received yet.

Invalid 

The input is invalid.

Halt 

The input is valid and is telling the Tic to halt the motor.

Position 

The input is valid and is telling the Tic to go to a target position, which you can get with TicBase::getInputAfterScaling().

Velocity 

The input is valid and is telling the Tic to go to a target velocity, which you can get with TicBase::getInputAfterScaling().

Definition at line 250 of file Tic.h.

◆ TicMiscFlags1

enum TicMiscFlags1
strong

This enum defines the bits in the Tic's Misc Flags 1 register. You should not need to use this directly. See TicBase::getEnergized() and TicBase::getPositionUncertain().

Definition at line 274 of file Tic.h.

◆ TicMotorDriverError

enum TicMotorDriverError
strong

This enum defines possible motor driver errors for the Tic T249.

See TicBase::getLastMotorDriverError().

Definition at line 286 of file Tic.h.

◆ TicOperationState

enum TicOperationState
strong

This enum defines the possible operation states for the Tic.

See TicBase::getOperationState().

Definition at line 95 of file Tic.h.

◆ TicPinState

enum TicPinState
strong

This enum defines the Tic's pin states.

See TicBase::getPinState().

Definition at line 241 of file Tic.h.

◆ TicPlanningMode

enum TicPlanningMode
strong

This enum defines the possible planning modes for the Tic's step generation code.

See TicBase::getPlanningMode().

Definition at line 109 of file Tic.h.

◆ TicReset

enum TicReset
strong

This enum defines the possible causes of a full microcontroller reset for the Tic.

See TicBase::getDeviceReset().

Definition at line 120 of file Tic.h.

◆ TicStepMode

enum TicStepMode
strong

This enum defines the possible step modes.

See TicBase::getStepMode() and TicBase::setStepMode().

Definition at line 162 of file Tic.h.

Variable Documentation

◆ TicCurrentUnits

const uint8_t TicCurrentUnits = 32

This constant is used by the library to convert between milliamps and the Tic's native current unit, which is 32 mA. This is only valid for the Tic T825 and Tic T834.

Definition at line 30 of file Tic.h.

◆ TicInputNull

const uint16_t TicInputNull = 0xFFFF

This is used to represent a null or missing value for some of the Tic's 16-bit input variables.

Definition at line 38 of file Tic.h.

◆ TicT249CurrentUnits

const uint8_t TicT249CurrentUnits = 40

This constant is used by the library to convert between milliamps and the Tic T249 native current unit, which is 40 mA.

Definition at line 34 of file Tic.h.