Jump to content

Adding an I2C Slave to UM3 Extended


felipe_r

Recommended Posts

Posted · Adding an I2C Slave to UM3 Extended

Hello, 

I've been developing a robotic arm able to take the printing out of a 3d Printer once the process is finished, being the reason that the lab i'm doing services for wants to automatize the process of finishing a print/starting the next print (if any) when no one is on the lab. I tested this arm with a UM2 machine + A Ramps 1.4 Processor/Arduino Mega in Lab's possession and it works fine, controlling it via I2C and using gcode (M260). The issue I face now is that at the end, the printers used by the lab are UM3 Extended.   

I've become aware more and more of the differences in Hardware architecture between UM2 and UM3 Extended (should have done this before, yes I know), and the tutorials posted here helped me a lot to see where the I2C ports are in the UM3 Extended. Considering that both I2C-based cables, P2 and P5 in the schematic here, are not connected to anything (not sure if i understood well, but those connections went to what was called "Feature X?" here), I had the idea of using one of these two unused cables to send I2C commands.

Before trying anything with the UM3, I got into the UM3 developer mode and connected via Putty/SSH. Using ultimaker as user, i managed to enter the command interface and used G28 and G0/G1 successfully + still not connecting my mechanical arm, used M260, getting a message that the command was sent.

Then I connected the arm to one I2C port of the 3d printer, checking several times that the pins were well connected in order to not burn the UM3 Extended, but I could not move the arm. With a logic analyzer, could see that connections were alright since i'm receiving the data sent to the print head with the right I2C addresses, the clock, 5V and GND properly, but when a message is sent via M260 using the command interface, nothing is received by my arm Microcontroller, so in at least one part of the process the message is being lost.

I've been reading different posts in this forum and saw that the M260 is not listed amongst the possible commands to use, but G28 is not listed either and still I could use it. Also, I have seen nothing like the "I2C_EXPERIMENTAL" in a couple of Marlin Firmware versions (2017.06.21 and 2016.10.10) for the Ultimainboard. Finally, I have not found much references to the I2C port inside griffin folder. Is there a not too difficult way to control a slave (like my mechanical arm) via I2C, with the Ultimainboard as a master? I'm aware of the danger related to the usage of the developer mode and the addition of electrical connections to the I2C port of the UM3.

PS: I would have liked to utilize the server, but the lab is using 3dprinterOS and I could not send commands through its platform. The firmware the UM3 Extended has is: 5.2.11.20190503.

Cheers and thanks in advance!

  • Link to post
    Share on other sites

    Posted · Adding an I2C Slave to UM3 Extended

    So there is the linux computer you ssh'ed into and then there is an arduino board with a flavor of Marlin on it.  The firmware on the arduino board is derived from Marlin so UM is required to supply source code if you ask because Marlin is open source.  I asked.  I just put it here for you to look at:

    gr5.org/jedi_marlin.zip

     

    You can (hopefully) easily grep for "260" to see if it's implemented.  Most likely it is.  I suspect instead the code is blocked by linux from sending most gcodes onwards to the marlin board.

     

    If I'm right then you'll have to find the list of which gcodes are sent on to marlin, which gcodes are interpreted (like T0 and T1 are probably converted into many gcodes.  Perhaps.) and which gcodes are discarded.

     

    Even though you do "sendgcode" it doesn't necessarily do what you tell it.  Even if it claims it did.

     

    Also there are some codes that will work after you enable something.  So to set the nozzle temp using gcodes you first have to enable power to the nozzle or something and I forget how to do that but it's somewhere on this forum.  I doubt this has anything to do with I2C and M260.

     

    Anyway hopefully you find the code that triages gcodes and it's an easy fix.

  • Link to post
    Share on other sites

    Posted · Adding an I2C Slave to UM3 Extended

    Oh and keep in mind, any changes you make to either firmware will get overridden the next time you upgrade your UM3 with "latest firmware".

  • Link to post
    Share on other sites

    • 2 months later...
    Posted · Adding an I2C Slave to UM3 Extended

    I think feature X was the planned but not implemented filament flow sensor, and you should be good in connecting to that line.
    M260 is not implemented in our version of marlin, which can be found here , you'd have to add your own version of that.
    Best quick check to see if your i2c connection is live is the M12100 which scans the i2c bus.

    Some gcodes like G28 are caught in the python code side when coming from a gcode file and won't be executed because it would loose us bed probe data, etc.

    The "linux" olimex board also has an i2c bus and you could hook it up there, which would allow you to use command-line tools like i2cdetect, i2cget and i2cget.
    this would require a lot less modification, you'd have to change the WAIT_FOR_CLEANUP steps to not happen and trigger your robot arm instead.
    The python code I'm referring to can be found on your printer in /usr/share/griffin/griffin/printer/

    good luck!!!

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • Introducing Universal Cura Projects in the UltiMaker Cura 5.7 beta
        Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
          • Like
        • 10 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...