Jump to content

Python controlling ultimaker 2+


nikitas

Recommended Posts

Posted · Python controlling ultimaker 2+

I want a linear 2 D scanning in the X and Y direction and a device is connected to the print head is logging a data. I wanted to use ultimaker as a XY scanner in my application. Is there any simple python code, that I can use to sent g-code directly to the UM2+?

 

I wanted to send only g-code "G0 X1" (move forward or backward X and Y direction. and pause for specific time. I tried putty using "COM3" and baud rate 115200, it give random text, how I can send the g-code via serial port using python?

 

 

  • Link to post
    Share on other sites

    Posted · Python controlling ultimaker 2+

    At the heart of the UM2 is the same chip as an Arduino Mega. You should be able to talk to open its serial port (using PySerial) and send any gcode to it line by line.

     

    The default Baud rate is 250000.

    • Like 1
    Link to post
    Share on other sites

    Posted · Python controlling ultimaker 2+

    Dear @ahoeben, Thank you. Can I use "PUTTY" for the initial testing with "COM3" and Baud rate of "250000" to send the g-code?

     

    should I need to send some other initial g-code for the initialization?

     

    Thanks

  • Link to post
    Share on other sites

    Posted · Python controlling ultimaker 2+

    Putty should work. I am not entirely certain if the checksum that is normally added to every line is mandatory. In that case using Putty would require some math.

     

    If you just want to move the head around, that should work without any initialisation. If you want to extrude material, you will first have to heat up the nozzle (the firmware prevents cold extrusions)

    • Like 1
    Link to post
    Share on other sites

    Posted · Python controlling ultimaker 2+

    pronterface is easier to use.  I think there *is* a checksum on the end of every line sent through usb/serial.  If so then pronterface does this automatically and I think you can see what is happening (I think it shows you the checksum).

     

    Pronterface is free and is here and has a command line utility also I think:

    http://koti.kapsi.fi/~kliment/printrun/

     

    Note that G0 X1

    Moves to position 1mm (1mm from left edge) but this is absolute so you then need to do:

    G0 X2

    To get to the next spot.

     

    If you just keep sending G0 X1 it moves there the first time but then keeps "moving" to where it already is from then on.

     

    • Like 1
    Link to post
    Share on other sites

    Posted · Python controlling ultimaker 2+
    19 hours ago, gr5 said:

    pronterface is easier to use.  I think there *is* a checksum on the end of every line sent through usb/serial.  If so then pronterface does this automatically and I think you can see what is happening (I think it shows you the checksum).

     

    Pronterface is free and is here and has a command line utility also I think:

    http://koti.kapsi.fi/~kliment/printrun/

     

    Note that G0 X1

    Moves to position 1mm (1mm from left edge) but this is absolute so you then need to do:

    G0 X2

    To get to the next spot.

     

    If you just keep sending G0 X1 it moves there the first time but then keeps "moving" to where it already is from then on.

     

    Thank you all for their nice suggestions and comments. @gr5, suppose if I use command G0 X1 it will move the head once, later if I again execute this it will not move the head? If I want to scan the head from point 1 to point 2 with stem size 0.5mm, I have to pass a gcode such as "G0 Xk" where k is calculated as Pi where Pi previous location+0.5?

     

    Thanks a lot.

     

  • Link to post
    Share on other sites

    Posted · Python controlling ultimaker 2+

    There are two "modes" of specifying coordinates: relative or absolute. You describe absolute coordinates. In relative coordinates each time you use `G0 X1`, the head will move 1 mm.


    You can change between absolute and relative modes with the G90 and G91 commands respectively.

     

    http://marlinfw.org/docs/gcode/G000-G001.html

    http://marlinfw.org/docs/gcode/G090.html

    http://marlinfw.org/docs/gcode/G091.html

    • Like 1
    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

      • 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
        • 18 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...