Okay I finally got Mega + Ramps 1.4 (almost) working with the modified firmware installed - both motors are spinning finally. However - it seems like the X-AXIS is having issues. When I "set_home", rove around, and draw vectors, the gondola will literally drop down while moving about the drawing surface, like it's slipping when the it's attached. Also when it's drawing the gondola progressively drops vertically down during a job - when it's suppose to be drawing from left to right in rows.
I've tested the amperage on the driver chips themselves via the trim-pot and the ground - and they're around 1.8A on each one. I've also switched out driver-chips on the X-axis, but that doesn't seem to have made a difference.
Is there a particular voltage / amperage I should be running at, if in case that's the issue?
Here's my configuration code:
/**
* 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. Polarshield motor driver board
// This uses stepstick-format stepper drivers on arduino pins 3 to 8.
const byte motoraEnablePin = 38;
const byte motoraStepPin = A0;
const byte motoraDirPin = A1;
const byte motorbEnablePin = A2;
const byte motorbStepPin = A6;
const byte motorbDirPin = A7;
//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 = 400;
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
// =================================================================
|