Can I use a Arduino Mega 2560 board with ramps 1.4

Home Forum Makelangelo Polargraph Art Robot Can I use a Arduino Mega 2560 board with ramps 1.4

Viewing 25 posts - 1 through 25 (of 26 total)
  • Author
    Posts
  • #22282
    Avatarrichyrich140db2000
    Participant

    Hello everyone,

    I’m having some difficulty getting the hardware to work correctly.
    Only one acces / motor is responding and I’m not getting any information on the smart lcd screen,

    So per the title question I have, does the Arduino firmware work with mega 2560 and ramps 1.4 ?

    Or would I be better off getting s ramps board?

    #22997
    AvatarTan
    Participant

    hi @richyrich140db2000

    I am also trying to build one with ramps board for sometime. finally managed to work it (almost)
    problems I have encountered:
    power problems:
    I have tired different power suplies. finally got it working with 12V 5A power supply / quite not sure with wiring though… just using 11A sockets for now

    jumpers
    it took me couple of days to realize that I have did not put jumpers under one of the motor drives. (motor was just vibrating)
    also in order to power servo, I have to put a jumper to 5a/vcc slots (they moved it to a different place on different ramps versions (also took 2 days to find)
    and I am using a big servo / I think it requires more power and causing problems (I will try a micro servo)

    LCD was not working / first it was due to power&usb cable problem, and later because of using wrong sockets ( I am using the original LCD Dan sent)
    I still cannot drive motors with LCD..

    arduino:
    my mega is cheap chinese model, it is not working with mac, I managed to upload the firmware with mac but makelangelo software never sees it on mac 🙁
    also have problems with usb cables…
    also in my first attempt I burnt my ramps MOSFET’s

    right now I am dealing with

    now motors are working / although moves up instead of down / but I think there is solution somewere on the forum
    and motors are moving faster!!! instead of 1cm they move ~3cm

    hope this helps

    #23003
    DanDan
    Keymaster

    >although moves up instead of down

    with power off, reverse the connection. if the wires are rgby, make them ybgr.

    > motors are moving faster!!! instead of 1cm they move ~3cm

    probably still missing a jumper under a driver. all three jumpers should be on for 1/16th microstepping. if your board somehow supports 1/32… then you have to adjust.

    #23021
    Avatarbulp
    Participant

    im been using Arduino Mega Board with RAMPS 1.4 with cheap or clone Futaba S3003 servo motor since September 2017… its work flawlessly till Jun 2018 as the Futaba stop working randomly after 1 hour or less.. id bought so many Futaba & even upgrade the makelangelo firmware still the new Futaba stop working after 3 hours.. maybe there is some sort of electrical short from Futaba to RAMPS board since there is some glitch or when that servo motor connected to RAMPS the whole system when hang!.. LCD cant display properly etc… it when good after id disconnected that servo motor..

    i did try it using few new Arduino Mega (CHina Clone) & the problems still arise…

    now im trying to use MKS BOARD V1.4 to see if the board really good handling Servo Motor connection (power distribution or PWM etc).

    #23022
    Avatarrichyrich140db2000
    Participant

    Thank you for the reply’s

    I’m glad to hear that it can and should work, so now I just need some help.

    Question for you Bulp, could you share your config sketch file ?

    I believe somewhere in the config file something is missing.

    Thanks again for the reply’s and any help you can give,

    #23025
    Avatarbulp
    Participant

    Hi richyrich140db2000, i do believe that the latest firmware didnt tweak very well for smartcontroller LCD as per firmware before Jun 2018 that really work well with SmartController that have built in SD Card.

    apparently i do get prompt with command that need to enter from smartcontroller.. id try to disable to define has LCD & SD from firmware but still the command appear.

    id just define the type of polargraph & using RAMPS, thats it.. other than the LCD problem im still waiting for Dan to fix it.

    #23029
    DanDan
    Keymaster

    It is not clear to me what is your LCD problem. Please list the steps to reproduce it. Thanks!

    #23074
    Avatarrichyrich140db2000
    Participant

    Hello Dan,

    The problems I’m having is:

    only 1 motor is responding on X access no other access has power output and the motor is putting out a annoying high frequency humm. Yes the stepper driver power has been adjusted.

    The Lcd display I’m using is the “reprap smart lcd controller with built is SD card reader”. It gets power but dose not display anything and the built in speaker puts out a high frequency dog whistle sound. It’s annoying as hell.

    What pins should I use for the servo?

    Thanks again for the help.

    #23076
    DanDan
    Keymaster

    It’s not enough information to determine the cause of the problem. If it was just one motor I’d say the wiring is wrong on that motor OR the driver is dead.
    The reprap smart LCD controller is supported, so it’s either wired wrong, setup wrong in the software, or something else. Process of elimination.

    #23136
    AvatarPhi Le
    Participant

    Hello Dan,

    I did a Makelangelo Bot by Ramps 1.5 + Arduino Mega 2560 yesterday. I uploaded Makelangelo firmware 7.20.1 for my bot successfully. In Makelangelo software, I can control stepper motor move and servo up/down, but when I upload image file and press Start/Start at line, the bot isn’t work. Can you help me? Sorry for my English. I’m from Vietnam.
    Notes: I’m using 11A socket in ramps board.

    #23137
    DanDan
    Keymaster

    If you have no LCD panel then in configure.h uncomment

    #define HAS_LCD

    and upload again. The machine waits for you to press a button on the LCD to confirm the pen is ready to draw before starting. With no LCD panel, there is no button and the wait will be forever.

    #23138
    AvatarTan
    Participant

    Hi Dan,

    MY ramps is finally working
    but in makelangelo software my new makelangelo has the id “-1” and everytime I connect it I have to change the machine settings and machine size.

    thanks

    #23139
    DanDan
    Keymaster

    When you connect the software to your machine it should assign a unique ID number to that device and register the machine with my server. This is a once-only thing so I can count how many Makelangelos are in the world: https://www.marginallyclever.com/makelangelos_over_time.php

    Either your machine is not phoning home; not connected; or some other problem.

    #23145
    AvatarPhi Le
    Participant

    Dear Dan,

    I uncommented #define HAS_LCD and upload again. But the bot still not work when I press START/START AT LINE. However, I still controll servo and stepper motor move. Help tell me what is wrong?

    Code in configure.h
    //——————————————————————————
    // LCD panels supported
    //——————————————————————————

    //#define HAS_LCD // if you have an LCD panel
    #define HAS_SD // if you have SD card support on your LCD panel (must be on panel?)

    // only uncomment one of these options
    //#define LCD_IS_128X64 // reprapdiscount Full Graphic Smart LCD Controller
    #define LCD_IS_SMART // reprapdiscount Smart LCD Controller (including XXL model)

    //——————————————————————————

    #23150
    DanDan
    Keymaster

    makelangelo-firmware.ino, near line 740, check it is written:

    void waitForPinState() {
    #ifdef HAS_LCD
    int pin = parseNumber(‘P’, BTN_ENC);
    #else
    int pin = parseNumber(‘P’, -1);
    #endif
    if(pin == -1) return; // no pin specified.

    in the previous version the last if was not there.

    #23167
    AvatarPhi Le
    Participant

    Dear Dan,

    My bot worked successfully. Thank you very much ^^.

    #23193
    AvatarPhi Le
    Participant

    Hi, Dan.

    I get some problems. First, I use Makelangelo V3, so when I press Go Home, the bot move any location and stop. Second, what is ratio between loads which you hang on timing belt and bot? because when the bot move, sometimes it’s sliding step (between pulley 20 teeth on stepper motor and timing belt GT2).

    #23198
    DanDan
    Keymaster

    M3 only has “set home”, when the pen holder is already at the home position. There is no automatic find home on the 3.

    The Center weight we use is 200g. The outsides are 100g each.

    #27687
    AvatarIlex
    Participant

    Hello
    I am completley new to electronics, Arduino Mega-things, Ramps, stepper motors etc…
    When I saw your draw bot I wanted to make such piece of art!
    Got instructions from “Instructables” in which someone made it with Ramps 1.4 and Mega 2560 so I bought that stuff.

    It took me al lot of time, research and trial & error to get somewhere in the software part. Pffiuw!

    Almost there. Almost.
    The RepRap LCD Full Graphic Smart Controller is working except of the encoder rotary.
    I can only go through the menu when I really turn very slowly and carefully!
    I need to make 1/8 turn or so to let the cursor move 1 step.

    Any suggestions?
    Thx in advance!

    #27689
    DanDan
    Keymaster

    in lcd.h, change

    #define LCD_TURN_PER_MENU (3) // was 5

    To a lower number. try (1) or (2). <=0 will not work.

    #27690
    AvatarIlex
    Participant

    Hallo Dan, I tried it already… no good.
    Is this the C-code where to look at?

    #27691
    DanDan
    Keymaster

    The Arduino code is here: https://github.com/MarginallyClever/Makelangelo-firmware/

    You will want to setup right:
    In configure.h, where you set the machine to POLARGRAPH and the board type to BOARD_RAMPS.
    In robot_polargraph.h, check that the machine version matches yours (MAKELANGELO_5?).

    ramps.h defines the pins used by the stepper motors and the LCD panel.
    You can change these numbers and upload the code to your robot to reprogram the machine.

    Sorry if this is pedantic, I’m writing for everyone who comes after you that doesn’t know how to join us.

    #27694
    AvatarIlex
    Participant

    Hello Dan, I got the polargraph working without the LCD.
    Stepper, servo etc responds.
    The problem started when connecting the LCD to get rid off the PC.

    Somewhere the encoder is counting wrong. Don’t find which part of the sketch is responsible for that?

    Thx for helping!

    #27699
    DanDan
    Keymaster

    > Somewhere the encoder is counting wrong.

    What do you mean?

    the place to look is in lcd.cpp. look in LCD_read(), where the encoder changes the value lcd_turn.

    #27711
    AvatarIlex
    Participant

    Well, in my thoughts the encoder gets micro-pulses while turning the knob.
    If he gets lets say 4 pulses before the knob ‘clicks’, and he got the command to change cursor at 4 pulses… he would change before ‘click’.
    Euh… not?
    🙂

    Somewhere around here, Dan?

    [code]
    int buttons=0;
    unsigned long next_lcd_read=0;
    const char *update_key;
    void *update_val;

    void LCD_read() {
    long now = millis();

    if(ELAPSED(now,next_lcd_read)) {
    // detect potentiometer changes
    buttons = ((digitalRead(BTN_EN1) == LOW) << BLEN_A)
    | ((digitalRead(BTN_EN2) == LOW) << BLEN_B);
    next_lcd_read=now+30;
    }

    // potentiometer uses grey code. Pattern is 0 3 1 2
    if (lcd_rot_old != buttons) {
    switch (buttons) {
    case ENCROT0: switch( lcd_rot_old ) { case ENCROT3: lcd_turn++; break; case ENCROT1: lcd_turn–; break; } break;
    case ENCROT1: switch( lcd_rot_old ) { case ENCROT0: lcd_turn++; break; case ENCROT2: lcd_turn–; break; } break;
    case ENCROT2: switch( lcd_rot_old ) { case ENCROT1: lcd_turn++; break; case ENCROT3: lcd_turn–; break; } break;
    case ENCROT3: switch( lcd_rot_old ) { case ENCROT2: lcd_turn++; break; case ENCROT0: lcd_turn–; break; } break;
    }
    // for debugging potentiometer
    {
    //if(lcd_turn !=0) Serial.print(lcd_turn>0?’+’:’-‘);
    //else Serial.print(‘ ‘);
    //Serial.print(millis()); Serial.print(‘\t’);
    //Serial.print(lcd_rot_old); Serial.print(‘\t’);
    //Serial.print(buttons); Serial.print(‘\t’);
    //Serial.print(lcd_turn); Serial.print(‘\n’);
    }

    lcd_rot_old = buttons;
    }

    // find click state
    int btn = digitalRead(BTN_ENC);
    if ( btn != lcd_click_old && btn == HIGH ) {
    // when button is released
    lcd_click_now = true;
    }
    lcd_click_old = btn;
    }

    [/code]

Viewing 25 posts - 1 through 25 (of 26 total)
  • You must be logged in to reply to this topic.