uStepper S
|
Function prototypes and definitions for the uStepper S library. More...
#include <avr/io.h>
#include <avr/interrupt.h>
#include <Arduino.h>
#include <EEPROM.h>
#include <inttypes.h>
#include <uStepperServo.h>
#include <uStepperEncoder.h>
#include <uStepperDriver.h>
Go to the source code of this file.
Classes | |
union | floatBytes_t |
Union to easily split a float into its binary representation. More... | |
struct | dropinCliSettings_t |
Struct to store dropin settings. More... | |
struct | posFilter_t |
Struct for encoder velocity estimator. More... | |
class | uStepperS |
Prototype of class for accessing all features of the uStepper S in a single object. More... | |
Macros | |
#define | CW 1 |
#define | CCW 0 |
#define | POSITION_REACHED 0x20 |
#define | VELOCITY_REACHED 0x10 |
#define | STANDSTILL 0x08 |
#define | STALLGUARD2 0x04 |
#define | HARD 0 |
#define | SOFT 1 |
#define | DRV_ENN PD4 |
#define | SD_MODE PD5 |
#define | SPI_MODE PD6 |
#define | CS_DRIVER PE2 |
#define | CS_ENCODER PD7 |
#define | MOSI1 PE3 |
#define | MOSI_ENC PC2 |
#define | MISO1 PC0 |
#define | SCK1 PC1 |
#define | NORMAL 0 |
#define | DROPIN 1 |
#define | PID 2 |
#define | CLOCKFREQ 16000000.0 |
#define | ENCODERINTFREQ 1000.0 |
#define | ENCODERINTPERIOD 1.0/ENCODERINTFREQ |
#define | ENCODERSPEEDCONSTANT ENCODERINTFREQ/65535.0 |
#define | PULSEFILTERKP 120.0 |
#define | PULSEFILTERKI 1900.0*ENCODERINTPERIOD |
Functions | |
void | TIMER1_COMPA_vect (void) __attribute__((signal |
Interrupt routine for critical tasks. More... | |
void | interrupt0 (void) |
Used by dropin feature to take in step pulses. More... | |
void | interrupt1 (void) |
Used by dropin feature to take in enable signal. More... | |
Variables | |
void | used |
Function prototypes and definitions for the uStepper S library.
This file contains class and function prototypes for the library, as well as necessary constants and global variables.
Definition in file uStepperS.h.
#define CCW 0 |
DESCRIPTION PENDING
Definition at line 132 of file uStepperS.h.
#define CLOCKFREQ 16000000.0 |
DESCRIPTION PENDING
Definition at line 208 of file uStepperS.h.
#define CS_DRIVER PE2 |
DESCRIPTION PENDING
Definition at line 193 of file uStepperS.h.
#define CS_ENCODER PD7 |
DESCRIPTION PENDING
Definition at line 194 of file uStepperS.h.
#define CW 1 |
DESCRIPTION PENDING
Definition at line 131 of file uStepperS.h.
#define DROPIN 1 |
Value defining dropin mode for 3d printer/CNC controller boards
Definition at line 204 of file uStepperS.h.
#define DRV_ENN PD4 |
DESCRIPTION PENDING
Definition at line 189 of file uStepperS.h.
#define ENCODERINTFREQ 1000.0 |
Frequency at which the encoder is sampled, for keeping track of angle moved and current speed
Definition at line 211 of file uStepperS.h.
#define ENCODERINTPERIOD 1.0/ENCODERINTFREQ |
Frequency at which the encoder is sampled, for keeping track of angle moved and current speed
Definition at line 213 of file uStepperS.h.
#define ENCODERSPEEDCONSTANT ENCODERINTFREQ/65535.0 |
Constant to convert angle difference between two interrupts to speed in revolutions per second. Dividing by 10 as each speed is calculated from 10 samples
Definition at line 215 of file uStepperS.h.
#define HARD 0 |
DESCRIPTION PENDING
Definition at line 186 of file uStepperS.h.
#define MISO1 PC0 |
DESCRIPTION PENDING
Definition at line 198 of file uStepperS.h.
#define MOSI1 PE3 |
DESCRIPTION PENDING
Definition at line 196 of file uStepperS.h.
#define MOSI_ENC PC2 |
DESCRIPTION PENDING
Definition at line 197 of file uStepperS.h.
#define NORMAL 0 |
Value defining normal mode
Definition at line 202 of file uStepperS.h.
#define PID 2 |
Value defining PID mode for normal library functions
Definition at line 206 of file uStepperS.h.
#define POSITION_REACHED 0x20 |
DESCRIPTION PENDING
Definition at line 134 of file uStepperS.h.
#define PULSEFILTERKI 1900.0*ENCODERINTPERIOD |
I term in the PI filter estimating the step rate of incomming pulsetrain in DROPIN mode
Definition at line 219 of file uStepperS.h.
#define PULSEFILTERKP 120.0 |
P term in the PI filter estimating the step rate of incomming pulsetrain in DROPIN mode
Definition at line 217 of file uStepperS.h.
#define SCK1 PC1 |
DESCRIPTION PENDING
Definition at line 199 of file uStepperS.h.
#define SD_MODE PD5 |
DESCRIPTION PENDING
Definition at line 190 of file uStepperS.h.
#define SOFT 1 |
DESCRIPTION PENDING
Definition at line 187 of file uStepperS.h.
#define SPI_MODE PD6 |
DESCRIPTION PENDING
Definition at line 191 of file uStepperS.h.
#define STALLGUARD2 0x04 |
DESCRIPTION PENDING
Definition at line 137 of file uStepperS.h.
#define STANDSTILL 0x08 |
DESCRIPTION PENDING
Definition at line 136 of file uStepperS.h.
#define VELOCITY_REACHED 0x10 |
DESCRIPTION PENDING
Definition at line 135 of file uStepperS.h.
void interrupt0 | ( | void | ) |
Used by dropin feature to take in step pulses.
This interrupt routine is used by the dropin feature to keep track of step and direction pulses from main controller
Definition at line 483 of file uStepperS.cpp.
void interrupt1 | ( | void | ) |
Used by dropin feature to take in enable signal.
This interrupt routine is used by the dropin feature to keep track of enable signal from main controller
Definition at line 471 of file uStepperS.cpp.
void TIMER1_COMPA_vect | ( | void | ) |
Interrupt routine for critical tasks.
This interrupt routine is in charge of sampling the encoder, process the data and handle PID
Definition at line 518 of file uStepperS.cpp.