Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: 1 [2] 3
Author Topic: Arduino MEGA 2560R3 with RAMPS 1.4?
swarm
Newbie
Posts: 9
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 11, 2014, 13:07
Quote

thank's for the reply 🙂

Sandy, can I use my 5V Nema17 stepper with pololu A4988?
Becuase as you said, pololu works with 8V but my motors are 5V only.. 🙁

Or is it okay with ramps 1.4?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 11, 2014, 13:23
Quote

Aha, yes, you will be fine. The voltage of the motors are not that important and most people run motors with a voltage much higher than the motor specifies - have a read through http://www.schmalzhaus.com/EasyDriver/index.html for some explanation. Not the same driver of course, but the same principle.

The 8v is just what the motor drivers themselves require - the drivers then chop the power up until it is some fraction of that, and you adjust them to output the kinds of power you want.

sn

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 12, 2014, 05:53
Quote

@Sandy: Nothing seems to be getting incredibly hot on the board from feeling the heat-sinks on the driver chips and the motors, they're definitely warm but do not burn-to-the-touch. I recorded a video of what's happening.

http://pneumonix.tumblr.com/post/85498408492

@Swarm: Speculatively, my power supply is could be the issue: it's a 1000ma, selective power supply that's plugged into the wall, it's definitely a bargain basement kinda deal, follow the link:

http://www.ebay.com/itm/Trisonic-TS-506B-1000mA-Univeral-AC-DC-Adapter-With-6-Tips-From-1-5V-To-12VDC-/261452274201?pt=Travel_Adapters_Converters&hash=item3cdfc51a19

*Alternatively I do have a 12V 1A, plugin power-supply as well, sort of like this one:

http://www.ebay.com/itm/New-AC-110-240V-Converter-Adapter-DC-12V-1A-Power-Supply-US-Plug-SR-/291099877608?pt=US_Lighting_Parts_and_Accessories&hash=item43c6e7a0e8

My stepper drivers are A4988 Step-Stick Pololu-compatible Motor Drivers .

robo
Newbie
Posts: 2
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 12, 2014, 16:12
Quote

vdrome
please share us the whole polargaph folder with your working modified arduino + Rapms sktech that you use. 🙁

We really need :'(

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 12, 2014, 16:29
Quote

Right I think you'd notice the heat - 130 degrees or so.

It looks to me like it's just not got the power. When locked, is the motor hard to turn by hand? I know there's the technical method of adjusting the motor driver, where you measure the voltage at the test point, but I've always used a manual method - set the motor moving, then turn the power right down until the motor is humming but not actually turning, then gradually turn it back up until the required torque is attained.

I made a little video about it once http://www.polargraph.co.uk/2013/02/tuning-stepper-drivers-for-strength-and-subtlety/

sn

swarm
Newbie
Posts: 9
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 12, 2014, 18:47
Quote

Your're very good vdrome 🙂

I tried with my father to use RAMS 1.4 and Arduino but we couldn't. 🙁

We have the same specific as yours. May I ask you to send the whole code?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 12, 2014, 21:59
Quote

I have added parts from this thread onto [a new page on the Polargraph wiki](https://github.com/euphy/polargraph/wiki/Using-the-Polargraph-software-with-RAMPS-motorshield).

By all means continue your discussion here, but vdrome it'd be cool if you could contribute your findings to the wiki page. If you have a github account, please drop me a line and I'll add you to the repo.

sn

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 13, 2014, 03:19
Quote

Okay, I've been really massaging the trimpot on the driver chip that's trying to run the X-Axis and it's still not holding the weight. I've noticed something very peculiar while physically feeling the sprocket when I operate the X-Axis. For example, when I press "set home" in the PG controller the X-Axis will drop down suddenly. Now I've adjusted the driver chip at various points and ensured the motor shaft is difficult to move by hand when it's all connected up but as soon as I initiate "set home" I notice that any small amount of weight on the the sprocket pulling in either direction will cause the sprocket/motor shaft to spin many steps. It seems as if the X-Axis loosens up very briefly after "set home" is clicked then half a second later it locks up again. On the Y-axis motor, this isn't happening it stays tight even when I press "set home" and have my hand applying some force in either direction. I've tried switching out driver-chips, and switching motors, the problem is definitely tied to the X-axis (I think). Also I can confirm that I tried different voltages coming out of the wall 7.5, 9, and 12v, but I still get funky x-axis moves.

I've uploaded the Ramps 1.4 firmware I've been pecking away at, maybe someone can re-create the problem:

https://www.dropbox.com/s/vby94rnxdah2hqr/polargraph_server_polarshield.zip

I'm starting to run out of ideas.

PS: Sandy, on your Ramps 1.4 wiki page you just made, where are you getting the 54 / 55 values for MotorAsteppin and MotorADirpin? I'm referencing the Ramps 1.4 datasheet on the RepRap Wiki and I'm seeing A1 / A0.Same thing with the Y-axis (motorB). Some clarification would be great, I'm going implement the values you posted and see if they resolve my X-axis issue.

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 13, 2014, 03:45
Quote

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

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 13, 2014, 10:42
Quote

Hi Vdrome, the 5x pin numbers are the digital equivalents of using the Ax notation. So they are synonyms, I just prefer the D numbers rather than the As.

I got the numbers from looking in the Marlin code. (I've added some links to source in the wiki page.)

It's a tricky one. A bad connection in the motor wiring / connector is the only thing I can think is up. So while still, there's only one coil activated, and that's fine, but when attempting to step, the opposite coil doesn't work, or something like that. I'm positive there's nothing in the code that can have an effect like that. (Set home does a couple of steps in both directions.)

Last suggestion: Try one of the other motor driver channels (z, e1 or e2):

    #define Z_STEP_PIN         46
    #define Z_DIR_PIN          48
    #define Z_ENABLE_PIN       62

    #define E0_STEP_PIN        26
    #define E0_DIR_PIN         28
    #define E0_ENABLE_PIN      24

    #define E1_STEP_PIN        36
    #define E1_DIR_PIN         34
    #define E1_ENABLE_PIN      30

sn

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 13, 2014, 15:44
Quote

I don't think it's my wiring because the issue is only related to the X-axis terminal on the board itself, for example; my Y-axis motor and driver-chip work fine, however when I switch the Y-motor to the X-axis terminal it starts exhibiting the same behavior that the X-motor had. Maybe this is some quirk native to the RAMPS 1.4 board? I could of sworn I tried this on the other driver channels and had the same issue, but I don't recall as I've been pouring a lot of time into this. I'll noodle around some more on the other motor terminals, hopefully something will resolve itself! If I get good results I'll upload the firmware and post here.

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 16, 2014, 03:35
Quote

I've some good news:

I got RAMPS 1.4 working with the Polargraph firmware. As per Sandy's suggestion instead of using the X-axis motor terminal on the board use the E1 motor terminal instead, that resolved the problem I had with the motor dropping out during micro-stepping.

*ALSO if you want to use a servo on Ramps 1.4 with a 12V adapter ensure that there is a jumper connecting the 5V pin and the VCC pin next the servo pins on the board.

Check here for servo connection reference: http://forums.reprap.org/read.php?219,256377

I'm still doing some initial testing; the servo twitches for a sec when it's plugged into the board, though when I click pen lift and pen drop I get nothing.

@Sandy: Here's a copy of the firmware snag it and toss it up on Github:

https://www.dropbox.com/s/dfejkmgpckci3q8/vdrome_polargraph_server_polarshield.zip

swarm
Newbie
Posts: 9
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 17, 2014, 15:58
Quote

THANK YOUUU 🙂

VDROME 🙂

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 17, 2014, 17:20
Quote

@swarm: If you have a servo motor could you please test it on your board for me, let me know your results. I can't get mine to lift or drop in the controller software.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 17, 2014, 18:44
Quote

@vdrome, cool thanks, were the only changes the pin assignments in the configuration.ino?

sn

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 17, 2014, 19:17
Quote

Sandy, yes for MotorA I'm using E1 for MotorB I'm using Y.

const byte motoraEnablePin = 30;
const byte motoraStepPin = 36;
const byte motoraDirPin = 34;

const byte motorbEnablePin = 56;
const byte motorbStepPin = 60;
const byte motorbDirPin = 61;

Also in the default properties.txt I changed the StepsPerRev to 3200.

I'm running a vector job now and it seems to be working fine, just have to fine tune the stepper drivers some more. The only issue that is remaining is getting the servo to work, I have it set to pin 7 in the firmware, but it's not lifting.

swarm
Newbie
Posts: 9
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 25, 2014, 11:24
Quote

Quote from vdrome on May 17, 2014, 17:20
@swarm: If you have a servo motor could you please test it on your board for me, let me know your results. I can't get mine to lift or drop in the controller software.

Hi

Vdrome 🙂

I can't test it becuase i don't have serveo motor 🙁

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 25, 2014, 16:44
Quote

Hello, I got a spare RAMPS board, and got things working. Once again, I've been feeding you duff information. The servo pins on RAMPS are D4, D5, D6 and D11 (not D7). I don't know why I thought it was D7 (it certainly isn't on the diagram).

There needs to be a link between 5V and VCC on the boards, as described in the reprap forum link supplied by vdrome above (thanks!). Servo works ok for me now.

I have updated the wiki page at:
https://github.com/euphy/polargraph/wiki/Using-the-Polargraph-software-with-RAMPS-motorshield

And have updated the polargraph_server_polarshield to make switching between hardware types a bit easier.

Interesting to note that Y and E1 were the only channels I could get working too. E0 worked a bit, but had comms interference on it. X and Z were not cooperative at all. No idea why.

sn

vdrome
Beginner
Posts: 36
Permalink
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 28, 2014, 01:23
Quote

@sandy

Success!

Assigning the D4 pin to servo works without a hitch.

*Yes, I was also getting some funk (as noted earlier) out of E0,X, and Z pins as well.

I'd say we have a mission complete on the Ramps board.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Arduino MEGA 2560R3 with RAMPS 1.4?
on: May 28, 2014, 08:53
Quote

Hurray!

Pages: 1 [2] 3
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.048 seconds.