Okay I've just updated my firmware here's the configuration page, still having issues with the X-Axis dropping out in-between steps:
/**
* Polargraph Server. - CORE
* Written by Sandy Noble
* Released under GNU License version 3.
* http://www.polargraph.co.uk
* http://code.google.com/p/polargraph/
Configuration.
This is one of the core files for the polargraph server program.
It sets up the motor objects (AccelSteppers), and has default
values for the motor, sprocket and microstepping combinations used
by polargraphs so far.
Comment out the blocks of code you don't need.
*/
// motor configurations for the various electrical schemes
// =================================================================
// 1. Adafruit motorshield
//#include <AFMotor.h>
//const int stepType = INTERLEAVE;
//
//AF_Stepper afMotorA(motorStepsPerRev, 1);
//AF_Stepper afMotorB(motorStepsPerRev, 2);
//
//void forwarda() { afMotorA.onestep(FORWARD, stepType); }
//void backwarda() { afMotorA.onestep(BACKWARD, stepType); }
//AccelStepper motorA(forwarda, backwarda);
//
//void forwardb() { afMotorB.onestep(FORWARD, stepType); }
//void backwardb() { afMotorB.onestep(BACKWARD, stepType); }
//AccelStepper motorB(forwardb, backwardb);
//
//void configuration_motorSetup()
//{
// // no initial setup for these kinds of motor drivers
//}
//void configuration_setup()
//{
// defaultMachineWidth = 650;
// defaultMachineHeight = 650;
// defaultMmPerRev = 95;
// defaultStepsPerRev = 400;
// defaultStepMultiplier = 1;
// delay(500);
//}
// end of Adafruit motorshield definition
// =================================================================
// =================================================================
// 2. **RAMPS 1.4** (Experimental) **X-AXIS not locking in correctly?**
// This uses stepstick-format stepper drivers on arduino pins 3 to 8.
const byte motoraEnablePin = 38;
const byte motoraStepPin = 54;
const byte motoraDirPin = 55;
const byte motorbEnablePin = 56;
const byte motorbStepPin = 60;
const byte motorbDirPin = 61;
//const byte motorcEnablePin = 30;
//const byte motorcStepPin = 31;
//const byte motorcDirPin = 32;
AccelStepper motorA(1,motoraStepPin, motoraDirPin);
AccelStepper motorB(1,motorbStepPin, motorbDirPin);
//AccelStepper motorC(1,motorcStepPin, motorcDirPin);
void configuration_motorSetup()
{
pinMode(motoraEnablePin, OUTPUT);
digitalWrite(motoraEnablePin, HIGH);
pinMode(motorbEnablePin, OUTPUT);
digitalWrite(motorbEnablePin, HIGH);
motorA.setEnablePin(motoraEnablePin);
motorA.setPinsInverted(false, false, true);
motorB.setEnablePin(motorbEnablePin);
motorB.setPinsInverted(true, false, true); // this one turns the opposite direction to A, hence inverted.
}
void configuration_setup()
{
defaultMachineWidth = 650;
defaultMachineHeight = 650;
defaultMmPerRev = 95;
defaultStepsPerRev = 3200;
defaultStepMultiplier = 1;
// init SD card
sd_initSD();
lcd_initLCD();
lcd_showSummary();
delay(1000);
//pinMode(2, INPUT_PULLUP);
//attachInterrupt(INTERRUPT_TOUCH_PIN, lcd_touchInput, LOW);
// calibration pins
pinMode(ENDSTOP_X_MIN, INPUT);
pinMode(ENDSTOP_Y_MIN, INPUT);
pinMode(ENDSTOP_X_MAX, INPUT);
pinMode(ENDSTOP_Y_MAX, INPUT);
// do a write to turn on the internal pull up resistors
digitalWrite(ENDSTOP_X_MIN, HIGH);
digitalWrite(ENDSTOP_Y_MIN, HIGH);
digitalWrite(ENDSTOP_X_MAX, HIGH);
digitalWrite(ENDSTOP_Y_MAX, HIGH);
lcd_displayFirstMenu();
releaseMotors();
}
// end of Polarshield definition
// =================================================================
Here's the entire firmware:
https://www.dropbox.com/s/vby94rnxdah2hqr/polargraph_server_polarshield.zip
|