Jump to content

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

      • Help Us Improve Cura – Join the Ultimaker Research Program
        🚀 Help Shape the Future of Cura and Digital Factory – Join Our Power User Research Program!
        We’re looking for active users of Cura and Digital Factory — across professional and educational use cases — to help us improve the next generation of our tools.
        Our Power User Research Program kicks off with a quick 15-minute interview to learn about your setup and workflows. If selected, you’ll be invited into a small group of users who get early access to features and help us shape the future of 3D printing software.

        🧪 What to Expect:
        A short 15-minute kickoff interview to help us get to know you If selected, bi-monthly research sessions (15–30 minutes) where we’ll test features, review workflows, or gather feedback Occasional invites to try out early prototypes or vote on upcoming improvements
        🎁 What You’ll Get:
         
        Selected participants receive a free 1-year Studio or Classroom license Early access to new features and tools A direct voice in what we build next
        👉 Interested? Please fill out this quick form
        Your feedback helps us make Cura Cloud more powerful, more intuitive, and more aligned with how you actually print and manage your workflow.
        Thanks for being part of the community,

        — The Ultimaker Software Team
        • 0 replies
      • Cura 5.10 stable released!
        The full stable release of Cura 5.10 has arrived, and it brings support for the new Ultimaker S8, as well as new materials and profiles for previously supported UltiMaker printers. Additionally, you can now control your models in Cura using a 3D SpaceMouse and more!
          • Like
        • 18 replies
    ×
    ×
    • Create New...