1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Using Arduino board on Robo R2 project in process

Discussion in 'Mods and Upgrades' started by Lance Weston, Mar 27, 2019.

  1. Lance Weston

    Lance Weston Active Member

    Joined:
    Jun 2, 2018
    Messages:
    664
    Likes Received:
    230
    I have the software working for Fans, Bed, Extruder, Steppers, Endstops, thermisters. In short everything I need to use the board. I have not yet tested Auto level or filament sensor. All functions working on the LCD. Will go through a print on the bench, will exercise all steppers, heaters and the fan. The PID functions nicely on both heaters. The Raspberry Pi camera tested and working.

    Using the firmware: Install the "arduino-1.8.9-windows". Unzip the "Working Arduino.zip" Go into the Arduino folder then into the Marlin folder. Double click on "Marlin.ino". You are now in the firmware and ready to load onto the Arduino board. Click on tools and set the port and verify that the board is a genuine Mega Arduino. Only those boards work. Click on the right arrow on the top bar to load the firmware. If it does not load reboot and try again.

    Attached is a picture of a working / not working / and untested / Arduino Board.

    Auto level is verified as working.

    Link for Marlin file:
    https://drive.google.com/open?id=1kfGce8RplWiVw3_gPpxhKlYaDzd7pvjN

    I modified the Marlin file to always return the same value for Raspberry Pi current that the Robo R2 returns. I did this because the Arduino board has no chip monitoring current and the floating pin will give random results.


    I have built a Robo printer that uses dual Z steppers and dual Z switches. It is set up for 3950 thermisters on both bed and print head. Link:
    https://drive.google.com/open?id=15LGnDVBA9oADLHWf-lUng-pYtP7frPka
    video of progress:
    https://drive.google.com/open?id=1zGXZr7gJl-D9rE4K4kLu4ZzLZCgnDnNO

    Filament sensor solved. The Arduino does not do the filament sensor the Rasberry Pi does through the red and black wires coming off the header. The wires come from GPIO (20/21) and run up to the sensors. I assume GND comes from the ribbon cable. This should just work.

    I modified the Ramps board: remove D1, move the 5amp PTC into the 11 amp PTC position and replace the 5amp PTC with a fuse holder (11amp fuse) The original code was modified to reassign the Bed to D9 and the Extruder to D10, and the fan to D8. I have included a zip of the working code.

    D9 and D10 are now 24 volts for the heaters and D8 is 12v for the extruder fans.

    I have included below a mark up of the Arduino that shows the hookup.

    The 5v regulator on the Arduino can not handle the current. I am using a 24v->5v step down (eBay $2) that powers both the Rasberry Pi and the Arduino. You have to make the Arduino power cable from a micro USB cable. The Arduino cable uses standard two pin connectors. The 12v no longer has much current so I use a step down 24v->12v, the 12v is less than 1amp with all fans on full.
     

    Attached Files:

    #1 Lance Weston, Mar 27, 2019
    Last edited: Jun 25, 2019
    Geof and mark tomlinson like this.
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Looks good. My only concern would be to verify that the 5v lines to the LCD are in fact still in spec.
    I can imagine there may be level-shifter issues, but that could just be me over-thinking it :)

    Looks good so far.
     
    Geof likes this.
  3. Lance Weston

    Lance Weston Active Member

    Joined:
    Jun 2, 2018
    Messages:
    664
    Likes Received:
    230
    The Robo R2 does exactly the same thing. It uses a micro sd cable running to a 5v supply on the main board to power the Rasberry Pi. The Rasberry Pi carries the 5v up to the LCD through the cable, or in my instance direct plug in.
     
    mark tomlinson likes this.
  4. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Yea, I know how the C2 does it (the R2 is slightly different in that it uses HDMI too where the C2 just uses the GPIO, or at least mine does).
     
  5. Lance Weston

    Lance Weston Active Member

    Joined:
    Jun 2, 2018
    Messages:
    664
    Likes Received:
    230
    What I really need is someone that knows how the Robo 2 does the PID. Does it issue a GCODE command go do PID or does it do the PID in the Ardiuno by fetching status and sending on/off commands? Can I get a log of the the command sequence?
     
  6. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Good luck with that :)
    My suspicion is that it uses an OctoPi plugin for that (there are some out there).
    If not then they coded it up into the RoboPi custom LCD stuff.
    In either case it does the GCode to Marlin directly from the LCD or OctoPi

    Supposition only, I have no proof.
     
  7. Lance Weston

    Lance Weston Active Member

    Joined:
    Jun 2, 2018
    Messages:
    664
    Likes Received:
    230
    Jason kindly sent me the latest code. It compiled and worked now all functions work perfectly. Untested as of yet are the filament sensor and the auto level. I don't use them but I will get around to trying to get them to work.
     
  8. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Arduino code or the Pi?
     
  9. Lance Weston

    Lance Weston Active Member

    Joined:
    Jun 2, 2018
    Messages:
    664
    Likes Received:
    230
    He sent me new Arduino code. If you get a Rasberry Pi you could make an R1 into an R2. You just need a Rasberry Pi Image. All of the limits are in the Arduino code and the Bed PID works well.
     
  10. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Thanks :)

    I sort-of did that with a project a year ago where I cloned the SD card from the C2 and modified it for the R1.
     
  11. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    RoboLCD does not do PID control, that is handled completely by Marlin firmware. The Wizard in RoboLCD just sends the mainboard M301 and M304 commands for the firmware to execute PID tuning. All the rPi does is runs OctoPrint and the screen plugin will send other Mcode or Gcode commands, based on menu selections, to the mainboard. It does no processing itself, it isn't like Klipper which does a lot of processing on the rPi so the mainboard and Marlin firmware doesn't have to.
     
  12. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    pconsole.py is the app that handles most of sending the commands to the mainboard, it is part of the RoboLCD OctoPrint plugin. Also Octopi is just a simple distribution preconfigured OctoPrint with a few add on's. It too does not do any actual print processing, other than parsing Gcode files and sending them one command at a time to the mainboard.
     
  13. Bemster

    Bemster New Member

    Joined:
    Jul 3, 2017
    Messages:
    27
    Likes Received:
    9
    There looks to be something wrong with the zip file? Having errors decompressing the file both on Mac and Windows.
     
  14. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Just a guess but you will probably need to be a bit more specific :)
    Which file, what errors?
     
  15. Bemster

    Bemster New Member

    Joined:
    Jul 3, 2017
    Messages:
    27
    Likes Received:
    9
    Depends on OS. IO can get some files out in Windows but not sure if all are there.
     

    Attached Files:

  16. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
  17. Lance Weston

    Lance Weston Active Member

    Joined:
    Jun 2, 2018
    Messages:
    664
    Likes Received:
    230
    I had checked my zip file prior to uploading and it was okay, the system will not let me upload a new file. I do not know how to private message but if you can do it I will email you the file.
     
  18. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    I can delete the attached file if you want to try it again.
    I downloaded it and tested and sure enough, it fails a test.
     
  19. Lance Weston

    Lance Weston Active Member

    Joined:
    Jun 2, 2018
    Messages:
    664
    Likes Received:
    230
    The system tells me the file is too large and will not upload it. I do not know how to use my google drive to create a link but will work on it.
     
  20. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Ah yes, they have a limit on filesize. A link to a shared OneDrive, GoogleDrive, etc. is an excellent alternative.
    That is what I do for the stuff I have (like the Robo Pi Image backup)
     

Share This Page