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 the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 26 replies
    ×
    ×
    • Create New...