StepperII
Dual Axis Stepper Controller
Functions | Variables

app.cpp File Reference

Contains application functions. More...

#include <stdlib.h>
#include <avr/sleep.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "CBitio.h"
#include "CEvent.h"
#include "CEepromVar.h"
#include "CStepper.h"
#include "forth.h"
#include "CTask.h"
#include "CTimer1.h"
#include "CTimer3.h"
#include "CNullTimer.h"
#include "CProfile.h"
#include "Timers.h"
#include "CUsbSerial.h"
#include "CLmd18245.h"
#include "CPulseMotor.h"
#include "CCurrentLimit.h"
#include "CSlaveInterface.h"
#include "usb_serial.h"
#include "CApp.h"
#include "app.h"

Functions

 CBit (F, 5, WO) directionLed
 Direction indicator.
 CBit (F, 6, WO) stepLed
 Step indicator.
 ISR (TIMER1_COMPA_vect)
 Primary axis counter TOP interrupt.
 ISR (TIMER1_OVF_vect)
 Primary axis counter BOTTOM interrupt.
 ISR (TIMER3_COMPA_vect)
 Secondary axis counter TOP interrupt.
 ISR (TIMER3_COMPB_vect)
 Secondary axis counter TOP interrupt.
 ISR (TIMER3_OVF_vect)
void initApp (void)
 Initialize the dual-stepper application.
void doStepEvents (void)
 Poll and process step events for the master board.
void checkSlaveStep (void)
 Poll and process motion, step, and brake inputs for the slave board.
void resetWatchdog (void)
 Reset the hardware watchdog.
void axis (void)
 Select the active axis for subsequent console commands.
void doHomeOffset (void)
 Not supported in this release of software.
void prof (void)
 Set the motion profile for the active axis.
void save (void)
 Write the configuration for the active axis to non-volatile memory.
void show (void)
 Write the configuration for the active axis to the console.
void step (void)
 Relative move.
void stepTo (void)
 Absolute move.
void on (void)
 Turn on stepper motor for the active axis in specified direction.
void off (void)
 Turn off stepper motor for the active axis.
void autoHome (void)
void changeSpeed (void)
void brakeOn (void)
 Turn on the brake for the active axis.
void brakeOff (void)
 Turn off the brake for the active axis.
void primaryBrakeOff (void)
 Turn off the brake for the primary axis.
void secondaryBrakeOff (void)
 Turn off the brake for the secondary axis.
void pos (void)
 Write the current position of the active axis to the console.
void wtPos (void)
 Set the position of the active axis (not a motion command)
void state (void)
 Write motion state of the active axis to the console.
void writeCurrentLimit (void)
 Write current limit to onboard non-volatile digital potentiometer.
void readCurrentLimit (void)
 Write the board current limit setting to the console.
void master (void)
 Set the master/slave property for the board.
void nonBlocking (void)
 Set the command type for the active axis motion commands.
void units (void)
 Set the units for the active axis.
void accel (void)
 Set the magnitude of the motion profile acceleration slope for the active axis.
void maxSpeed (void)
 Set the maximum speed of the motion profile for the active axis.
void decel (void)
 Set the magnitude of the motion profile deceleration slope for the active axis.
void msSettle (void)
 Set a settling delay in milliseconds for the active axis. This delay follows any motion command and allows mechanical vibrations in the rotator to dampen.
void noLimits (void)
 Enable/disable travel limits for the active axis.
void lowTravelLimit (void)
 Set the minimum allowable position for the active axis.
void highTravelLimit (void)
 Set the maximum allowable position for the active axis.
void microSteps (void)
 Set stepper motor microstepping for the active axis.
void stepsPayload360 (void)
 Set the number of steps for a 360 degree revolution of the payload for the active axis.
void brakeType (void)
 Set the brake type for the active axis.
void reverse (void)
 Set the rotation convention for the active axis.
void currentLimit (void)
 Set the on-board current limiting hardware.
void home (void)
 Move the active axis to home position.
void homeAll (void)
 Move the both axes to home position.
int continuePrompt (void)
void demo (void)
 Perform a motion sequence suitable for driving a 1 or 2 axis test.

Variables

CUsbSerial port
 USB serial port.
uint8_t primaryShadow[sizeof(CProfile)] EEMEM
 Horizontal axis configuration shadow.
CLmd18245 primaryMotor
 Motor driver for horizontal axis.
CTimer1 primaryStepTimer
 Horizontal axis step timer.
CStepper primaryAxis
 Horizontal axis control object.
CPulseMotor secondaryMotor
 Slave interface pulse generator.
CTimer3 secondaryStepTimer
 Vertical axis step timer.
CStepper secondaryAxis
 Vertical axis control object.
CLmd18245 slaveMotor
 Motor driver for vertical axis.
CNullTimer slaveTimer
 No step timer for slave interface.
CStepper slaveAxis
 Vertical slave axis control object.
CStepperpAxis
 Pointer to the active axis control object.
char activeAxis
 Active axis numerical ID.
CSlaveInterface slaveInterface
 Hardware definitions for vertical slave interface.
CEepromVar< char > _master & masterShadow
 Board master/slave variable.
CEvent outputCompare1A
 Primary output compare A event.
CEvent overflow1
 Primary overflow event.
CEvent outputCompare3A
 Secondary output compare A event.
CEvent overflow3
 Secondary overflow event.

Detailed Description

Contains application functions.


Function Documentation

void checkSlaveStep ( void  )

Poll and process motion, step, and brake inputs for the slave board.

When motion input goes active, disables global interrupts and does steps. Leaves step loop when motion input goes inactive. Does not support watchdog or task switching.

Parameters:
[in]none
Returns:
none
void doHomeOffset ( void  )

Not supported in this release of software.

void doStepEvents ( void  )

Poll and process step events for the master board.

  • Does nothing for the slave board.
Parameters:
[in]none
Returns:
none
void initApp ( void  )

Initialize the dual-stepper application.

Set up the axis objects and the board current limit.

Parameters:
[in]none
Returns:
none
void primaryBrakeOff ( void  )

Turn off the brake for the primary axis.

  • Used by the automatic brake timer after a motion command
void resetWatchdog ( void  )

Reset the hardware watchdog.

Parameters:
[in]none
Returns:
none
void secondaryBrakeOff ( void  )

Turn off the brake for the secondary axis.

  • Used by the automatic brake timer after a motion command

Variable Documentation

Horizontal axis configuration shadow.

Board master/slave flag shadow.

Slave axis configuration shadow.

Vertical axis configuration shadow.

 All Classes Files Functions Variables Defines