cocktailyogi / EggDuino

Arduino Firmware for Spherebot / Eggbot integration in Inkscape
MIT License
91 stars 138 forks source link

EggDuino Firmware is not working with Ramps 1.4 #31

Open jpetvaldsky opened 9 months ago

jpetvaldsky commented 9 months ago

Hi i want to apologize that i am creating this as an issue. But i have a question. I am trying to use your firmware (from master branch), with small modification (changed only PINs and small modification in initHardware function), because only CNC shield what i have at home was Ramps 1.4, but i was not able to have it up and running. Inkscape is comunicating with Arduino, i am able to get Firmware version, i have using motors X and Z and servo0 on Ramps, i have placed all 3 jumpers under each driver to setup microsteps. This is my pin configuration:

EggDuino.ino

//Rotational Stepper Z (Egg):
#define step1 Z_STEP_PIN // 46
#define dir1 Z_DIR_PIN // 48
#define enableRotMotor Z_ENABLE_PIN // 62

#define rotMicrostep 16  //MicrostepMode, only 1,2,4,8,16 allowed, because of Integer-Math in this Sketch
//Pen Stepper X:
#define step2 X_STEP_PIN // 54
#define dir2 X_DIR_PIN // 55
#define enablePenMotor X_ENABLE_PIN // 38

#define penMicrostep 16 //MicrostepMode, only 1,2,4,8,16 allowed, because of Integer-Math in this Sketch

#define servoPin SERVO0_PIN //Servo - Pin 11

For initHardware() i tried both options, first i tried to have SPMCSR &= ~SPMEN; instead of ~SELFPRGEN, then i tried to remove both definitions.

Helper_Functions.ino

void initHardware(){
    // enable eeprom wait in avr/eeprom.h functions
    //SPMCSR &= ~SELFPRGEN;
    //SPMCSR &= ~SPMEN;
    ...

But when i am trying to send any command from inkscape to Eggbot, nothing happens, servo or motors is not moving :(

My Setup is:

Any idea how i can debug and follow further? Thanks for any advice!

kkrell2016 commented 8 months ago

Hey i also tried it with a Ramp1.4 Board. Maybe you got the pins wrong? I'm using the X,Y stepper with following config.

define step1 54

define dir1 55

define enableRotMotor 38

define rotMicrostep 16 //MicrostepMode, only 1,2,4,8,16 allowed, because of Integer-Math in this Sketch

//Pen Stepper:

define step2 60

define dir2 61

define enablePenMotor 56

define penMicrostep 16 //MicrostepMode, only 1,2,4,8,16 allowed, because of Integer-Math in this Sketch

You can connect the servo directly to the servopins. For 5V you can connect Vcc with 5V to take the Power from the 2560 User D4 and it work.

As you mentioned. SPMCSR &= ~SPMEN; in helper functions.