Jump to content
UltiMaker Community of 3D Printing Experts

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.3 stable released
        In this stable release, Cura 5.3 achieves yet another huge leap forward in 3D printing thanks to material interlocking! As well as introducing an expanded recommended print settings menu and lots of print quality improvements. Not to mention, a whole bunch of new printer profiles for non-UltiMaker printers!
          • Thanks
          • Like
        • 24 replies
      • Here it is. The new UltiMaker S7
        The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.
         
         
        So what’s new?
        The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.
         
        The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.
         
        The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.
         

         
        The UltiMaker S7 also includes quality of life improvements:
        Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more  
        Curious to see the S7 in action?
        We’re hosting a free tech demo on February 7.
        It will be live and you can ask any questions to our CTO, Miguel Calvo.
        Register here for the Webinar
          • Like
        • 18 replies
      • UltiMaker Cura Alpha 🎄 Tree Support Spotlight 🎄
        Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
         
        We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.  
          • Like
        • 22 replies
    ×
    ×
    • Create New...