Welcome to Our Community

Some features disabled for guests. Register Today.

Help with CNC and real time feedrate adjustment

Discussion in 'Tutorials' started by npedro, May 15, 2020.

  1. npedro

    npedro New
    Builder

    Joined:
    Dec 18, 2018
    Messages:
    2
    Likes Received:
    0
    Hey guys,

    I would like to ask you for some help with a project that I have in hands.

    I am using a CNC setup to control the position of an IR heat source.

    Now I'm using Marlin modified to meet my needs, running on a Arduino mega with ramps 1.4.

    I have been using 4 axis with 5 motors, X, Y, 2 motors in Z and a E axis por a pressing routine.

    My goal now is to install an IR temperature sensor to read the values on the surface of the material and have live adjustment to the feedrate of X and Y to achieve a set temperature.

    I couldn't find so far a straightforward manner to implement this, so I'm asking for your help for some options that I might have.

    Best solution would be to continue modifying malin to do it.

    I have read, but couldn't find exactly how it works, That GRBL with arduino can be used t have real time feedrate change, but as far as I've seen it's not easy to have a 4th motor (now E axis), and also I understood that is used mainly in CNC so, it's not prepared to have temperature readings.

    It was suggested to me to use a raspberry py to do this, but have zero experience on this.

    Any kind of suggestions or help is welcome so I can do more research.

    Thank you and hope that you are all safe and healthy.

    Regards
     
  2. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    This should probably be moved to General Talk or something, not many people are gonna see a question in Tutorials.

    XYZZ isn't an issue for grbl, just like XYYZ on a standard gantry machine isn't an issue. The "pressing routine"... What is it? grbl has additional IO (eg. spindle speed) that could potentially be pressed into service on a custom machine, depending on what it needs to do.

    So Marlin gets you temperature reading and PID response, but can't route that to a feedrate override. grbl gets you feed override and other real-time commands, but doesn't natively read temperature.

    In grbl, you'd have to either modify a fairly open g-code sender like OB CONTROL (exe, JavaScript source) or bCNC (straight Python) to add in your temperature needs, because the grbl board itself is intentionally purely motion control, it does no calculations or readings itself other than planning and executing the machine acceleration from what it gets sent.

    I think the RasPi suggestion was for it to be used as your gcode sender host with easy-access IO for your temperature sensor, rather than having to do something with USB on a standard x86 machine, which may be significantly more complex.

    I'm not familiar with Marlin so I can't say for sure which path would be easiest, but in either case it's going to involve software modification. Understanding how you can adapt a g-code sender for grbl can be found here, a page for people who write g-code senders: gnea/grbl
     
  3. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,287
    Likes Received:
    1,837
    I would do it in the sender by sending a series of short moves, each with it's own feedrate.
    so control would be something like
    set feedrate=300
    while 'doing job' do
    send 'G1 X1 Feedrate'
    measure temperature
    feedrate = adjustfeedrate(temperature)
    wait for 'ok' from marlin

    you will need to look up PID control and figure how to use it.
    you do know how long the move will take from the previous feedrate.
    where your temperature probe points will matter, if ahead of the heat the trailing heat will be too high, if behind the heat then there may be time delay effects.
     
  4. npedro

    npedro New
    Builder

    Joined:
    Dec 18, 2018
    Messages:
    2
    Likes Received:
    0
    Hi David.

    Thanks for your input. I will research how to test that. Cheers.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice