585,599 active members*
3,734 visitors online*
Register for free
Login
Results 1 to 14 of 14
  1. #1
    Join Date
    Aug 2019
    Posts
    2

    Controller board to cut Bezier curves?!??

    Is there such a thing (no - I should say "*where* is there such a thing") as a stepper motor control board that can cut Bezier (or other type) parametric curves "without" doing the "cut it up into a couple hundred line segments" thing? I put "without" in quotes because I'm thinking of something that would say calculate a tangent to the curve a the current point, and then use that to adjust the inputs given to the stepper motors directly.

    Or does this make a wonderful opportunity to learn much more than I want about stepper motor control theory?

  2. #2
    Join Date
    Dec 2013
    Posts
    5717

    Re: Controller board to cut Bezier curves?!??

    Any curve (arc), at least in the CNC universe, is a series of discrete X/Y coordinates (points) because steppers and servos are digital devices. The resolution of the points is a function of the finest possible resolution of the device used and its ability to achieve the commanded move. The smoothness of the arc is a function of the number of points on the arc, the more points the smoother the path is, within reason. The minimum possible move is 1 step or 1 encoder pulse, actual resolution would depend on the mechanics of the system.

    So yes, almost any arc can be generated. The math would normally be done in a CAM program, then ''posted'' to create the G code that the controller can understand and would then be fed to the system controller. It would be possible to generate the arc mathematically, output the points, and translate the points into text, G code or other format, that the controller could understand.

    EDIT: ''I put "without" in quotes because I'm thinking of something that would say calculate a tangent to the curve a the current point, and then use that to adjust the inputs given to the stepper motors directly.''

    There is at least one controller that can be programmed to do exactly what you describe, Galil Motion Control products will do this, I'm sure there are others also.
    Jim Dawson
    Sandy, Oregon, USA

  3. #3
    Join Date
    Dec 2003
    Posts
    1213

    Re: Controller board to cut Bezier curves?!??

    No need to learn stuff about controlling steppers.You need to find a CAM program to do the calculating.Lots of people here will recommend Fusion 360.There are lots of others,but some cost money.You can learn a lot by watching the tutorials on youtube and I would recommend looking for at least three different pieces of software to see which approach makes the most sense for the way you work.Just be aware that some programs cost a lot in the first instance and will require annual fees to remain operative.For a business user it makes sense to find the one that makes you the most productive and not just to grab the first freebie unless its clearly very efficient.It still causes me a lot of amusement when people post online about using a CAD system to design a piece and then take print to the machine to type in instructions-thats a really eighties approach to machining and so easy to make mistakes.I do suppose if you have offset the shape by the cutter radius it can at least eliminate the calculation errors to derive tool centreline positions.Its also a huge amount slower than hitting the calculate tab in a CAM program and you don't get to watch the simulated machining operation to verify that its doing what you expect.

    With a Bezier curve you can almost certainly specify a chordal deviation tolerance and while it may result in a large number of intermediate points,if you aren't having to type them all in manually it doesn't really matter that much.Some CAM systems have an option to approximate to circular moves-again using a deviation option and this can give a number of G2 and G3 moves rather than a lot of small G1 moves.Of course my ramblings won't make much sense if your machine doesn't have a way to load a program generated on a remote computer.Which can lead to a whole other discussion about data transfer,networking,drip feeding or even bluetooth transfer.

  4. #4
    Join Date
    Jul 2018
    Posts
    6318

    Re: Controller board to cut Bezier curves?!??

    Hi Jimw - What you describe is possible but the CAM system will still discretise the curve (any 3D curve even straight lines) into tiny bits because that's the only way the motors know how to work. This descretisation can also be done via the dxf export. The path the tool takes is calculated in the machine controller. The tool path is not exactly the line you started with. The controller has parameters and the possible toolpath is like a roadway, it could drive down the LHS or RHS or the middle. There are pathway allowable widths that are set up in the controller configuration. It needs to be like this because the tool is moving and motion creates accelerations and these create inertial forces that the motors have to overcome. So the pathway is used by the motion controller to smooth out the road, just like you do in a car, you use a roadway to make large smooth curves not the smallest curve as the road chyanges. Straight lines can be combined together to make long straight lines in the config as well. This reduces program line counts. Read your CAM config instructions and these parameters will be explained to you. The takeaway is that the toolpath at machine level is the sum of many many contiguous small bits, it is not a continuum and never can be. Peter

    here's a list of curve types, they all will be descretised by the controller https://en.wikipedia.org/wiki/List_of_curves

  5. #5
    Join Date
    Aug 2019
    Posts
    339

    Re: Controller board to cut Bezier curves?!??

    Quote Originally Posted by Jimw338 View Post
    Is there such a thing (no - I should say "*where* is there such a thing") as a stepper motor control board that can cut Bezier (or other type) parametric curves "without" doing the "cut it up into a couple hundred line segments"
    Not aware if there are boards equipped with the required processing power to compute fast enough for this purpose, I'd be surprised. Those algorithms are heavily parameterised to work efficiently (vel, accel, decl, jerk, smoothing, tolerances, so many more...). Although very much available on all industrial controls as standard feature for freeform (spline/nurbs, smoothing, advanced surfaces, etc). If you find this board most likely the IC on it would cost as much as an industrial control, if not more due to its low'er manufacturing qty.

    For freeforms with high tolerances (i.e. molds), and/or especially for hsm, it is a mandatory feature to have. Not so much for 2D parts, just a look-ahead on linear motions with 'cam' smoothing is often enough for those.

  6. #6
    Join Date
    Aug 2019
    Posts
    339

    Re: Controller board to cut Bezier curves?!??

    Here goes an example of the algorithm in practice. Note that the points are output as linear moves (standard cam), then converted to nurbs/splines & smooth'ed by the control's algorithm.
    https://www.industry.siemens.com/top...d-surface.aspx

  7. #7
    Join Date
    Jul 2003
    Posts
    1754

    Re: Controller board to cut Bezier curves?!??

    Linuxcnc?

    G Codes

  8. #8
    Join Date
    Jul 2018
    Posts
    6318

    Re: Controller board to cut Bezier curves?!??

    Hi Jimw and Mechanix - Mechanix, Siemens article notes an important thing to consider. There is a forward algorithm and a backward algorithm in play. The controller plans fwd then another algorithm takes this plan and runs it backward to check it is in tolerance and things like smoothing take place. Then the system runs it fwd again to re-check tolerance, velocities, accelerations, jerk (if implemented) etc. It's quite a mathematical juggle. Peter

    re fast enough computing? There are systems that use 5G systems to measure the part vibration (accelerometers are mounted in the fixture) and adjust the speed/feed on the go to mitigate the vibration. So all things are possible. if commercially needed.

    https://www.mmsonline.com/blog/post/...+9%2f18%2f2019

  9. #9
    Join Date
    Aug 2019
    Posts
    339

    Re: Controller board to cut Bezier curves?!??

    Hi peteeng. That real-time chatter control thingy is pretty cool, good find. What's better then not scrapping a $10,000+ part on its finishing pass because chatter sets-in and go wild as the walls gets thinner. There are a lot of bloody useless metrology & gadgets for CNC but this one I'll have to give it a 9.9/10 for innovation and 10/10 for usefulness. Thanks for sharing.

    That Sinumerik kit is pretty mathsmoothy but works amazingly well. Don't use it necessarily for surfaces (I don't machine molds) but for hsm it's really hard to hit the limitations of the machine with that feature turned on.

  10. #10
    Join Date
    Aug 2019
    Posts
    2

    Re: Controller board to cut Bezier curves?!??

    Quote Originally Posted by Jimw338 View Post
    Is there such a thing (no - I should say "*where* is there such a thing") as a stepper motor control board that can cut Bezier
    Spoke too soon: For reference if anyone else chances upon this post wanting to know the same thing:

    https://www.cnczone.com/forums/news-...are-forum.html
    (thread here) New Product: RosettaCNC Motion.

    https://rosettacnc.com/en/scheda-ros...c-board-b.html
    RosettaCNC.

  11. #11

    Re: Controller board to cut Bezier curves?!??

    The RosettaCNC Path Planner has an internal smoothness alogorithm that uses Bezier curves to reduce mechanical stress and
    to try to keep the FEED programmed in programs with heavy vector direction changes, also in multi-axis continous RTCP programs.

    All enters in 2000 blocks look-ahead path planer management of CNC.

    Bezier is active in G64 continuous mode and programmable in g-code using P & Q parameters:

    Eg:

    Code:
    G64 P0.02 Q0.1
    G1 ....
    https://wiki.rosettacnc.com/doku.php..._control_modes

    Anyway actually there is not yet a G code to place a CAD, or handwrited, output bezier matrix points and
    create a toolpath but is only a CNC way to improve mechanical movements.

    Can also used to add extra real-time points in a program poor of infos (like a gcode result of a 3D scan with probe).
    Eg:



    Analyzing tool path speed with RV (Real Path + Feed Velocity Colors) mode you can see improvements in Feed behavior:


    Where no Bezier is active (more angled toolpath) speed fall in feed in corners and low speed are reached.
    Where Bezier is enabled new points are automatically added in real-time by CNC, the toolpath change a little but
    Feed remain for most time at programmed value (red color) and axis acceleration/deceleration (with related jerk) is reduced.
    Attached Thumbnails Attached Thumbnails bezier-sample.jpg  

  12. #12

    Re: Controller board to cut Bezier curves?!??

    PS: a bezier tool path could be manually write using CNC macros to create a new G code to support them.

    https://www.researchgate.net/publica...RO_PROGRAMMING

  13. #13

    Re: Controller board to cut Bezier curves?!??

    Follow a sample code to get a 2 dimension bezier (XY) of 3 degree using RosettaCNC macro language (compliant with Fanuc-B macro language).




    Code:
    G17 G21 G40 G49 G80 G90
    G54
    
    
    G52 X200 Y200
    G0 X0 Y0
    
    
    F1000
    
    
    ; Sample of path with 3 bezier curve (3 degree)
    G65 P1000 T0.01 A0 B0 C0 D50 E100 F50 I100 J0
    G65 P1000 T0.01 A100 B0 C150 D-25 E220 F-10 I180 J0
    G65 P1000 T0.01 A180 B0 C180 D75 E120 F200 I0 J50
    
    
    M2
    
    
    ; create a degree 3 Bezier curve
    ;
    ;   dt      T   #20
    ;   p0.x    A   #1
    ;   p0.y    B   #2
    ;   p1.x    C   #3
    ;   p1.y    D   #7
    ;   p2.x    E   #8
    ;   p2.y    F   #9
    ;   p3.x    I   #4
    ;   p3.y    J   #5
    O1000
    ;   local variables
    ;   #1000 = t
    ;   #1001 = x0
    ;   #1002 = y0
    ;   #1003 = x1
    ;   #1004 = y1
    
    
        #1000 = 0.0
    
    
        ; calc x1 & y1
        G65 P1001 T#1000 A#1 B#3 C#8 D#4
        #1003 = #100
        G65 P1002 T#1000 A#2 B#7 C#9 D#5
        #1004 = #100
        
        ; t = t + dt
        #1000 = [#1000 + #20]
    
    
        WHILE [#1000 LT 1] DO01
            ; x0 = x1
            #1001 = #1003
            ; y0 = y1
            #1002 = #1004
    
    
            ; calc x1 & y1
            G65 P1001 T#1000 A#1 B#3 C#8 D#4
            #1003 = #100
            G65 P1002 T#1000 A#2 B#7 C#9 D#5
            #1004 = #100
    
    
            G1 X#1001 Y#1002
            X#1003 Y#1004
    
    
            ; t = t + dt
            #1000 = [#1000 + #20]
        END01
    M99
    
    
    ; X function for a degree 3 Bezier curve
    ;
    ;   t       T   #20
    ;   x0      A   #1
    ;   x1      B   #2
    ;   x2      C   #3
    ;   x3      D   #7
    ;
    ;   #100 =  x0 * (1 - t) ^ 3 +
    ;           x1 * 3 * t * (1 - t) ^ 2 +
    ;           x2 * 3 * t ^ 2 * (1 - t) +
    ;           x3 * t ^ 3
    O1001
        #100 = [ 0    + [#1 * [[1 - #20] ** 3]] ]
        #100 = [ #100 + [#2 * 3 * #20 * [[1 - #20] ** 2]] ]
        #100 = [ #100 + [#3 * 3 * [#20 ** 2] * [1 - #20]] ]
        #100 = [ #100 + [#7 * [#20 ** 3]] ]
    M99
    
    
    ; Y function for a degree 3 Bezier curve
    ;
    ;   t       T   #20
    ;   y0      A   #1
    ;   y1      B   #2
    ;   y2      C   #3
    ;   y3      D   #7
    ;
    ;   #100 =  y0 * (1 - t) ^ 3 +
    ;           y1 * 3 * t * (1 - t) ^ 2 +
    ;           y2 * 3 * t ^ 2 * (1 - t) +
    ;           y3 * t ^ 3
    O1002
        #100 = [ 0    + [#1 * [[1 - #20] ** 3]] ]
        #100 = [ #100 + [#2 * 3 * #20 * [[1 - #20] ** 2]] ]
        #100 = [ #100 + [#3 * 3 * [#20 ** 2] * [1 - #20]] ]
        #100 = [ #100 + [#7 * [#20 ** 3]] ]
    M99
    You get this:



    The inner macro can be used to creare a new user-defined G code (Eg: G300):

    Code:
    G17 G21 G40 G49 G80 G90
    G54
    
    
    G52 X200 Y200
    G0 X0 Y0
    
    
    F1000
    
    
    ; Sample of path with 3 bezier curve (3 degree)
    G300 T0.01 A0 B0 C0 D50 E100 F50 I100 J0
    G300 T0.01 A100 B0 C150 D-25 E220 F120 I180 J0
    G300 T0.01 A180 B0 C180 D75 E120 F200 I0 J50
    G300 T0.01 A0 B50 C73 D80 E20 F100 I210 J50
    
    
    M2
    And obtain:


    A video of toolpath executed in CNC:


  14. #14

    Re: Controller board to cut Bezier curves?!??

    In this last example I've matched a circle made with bezier with a native circle made with arcs.
    The G300 macro is changed to use K instead of F and missing last segment added.

    G300 Macro code:
    Code:
    ; create a degree 3 Bezier curve
    ;
    ;   dt      T   #20
    ;   p0.x    A   #1
    ;   p0.y    B   #2
    ;   p1.x    C   #3
    ;   p1.y    D   #7
    ;   p2.x    E   #8
    ;   p2.y    K   #6
    ;   p3.x    I   #4
    ;   p3.y    J   #5
    O1000
    ;   local variables
    ;   #1000 = t
    ;   #1001 = x0
    ;   #1002 = y0
    ;   #1003 = x1
    ;   #1004 = y1
    
    
        #1000 = 0.0
    
    
        ; calc x1 & y1
        G65 P1001 T#1000 A#1 B#3 C#8 D#4
        #1003 = #100
        G65 P1002 T#1000 A#2 B#7 C#6 D#5
        #1004 = #100
        
        ; t = t + dt
        #1000 = [#1000 + #20]
    
    
        WHILE [#1000 LT 1] DO01
            ; x0 = x1
            #1001 = #1003
            ; y0 = y1
            #1002 = #1004
    
    
            ; calc x1 & y1
            G65 P1001 T#1000 A#1 B#3 C#8 D#4
            #1003 = #100
            G65 P1002 T#1000 A#2 B#7 C#6 D#5
            #1004 = #100
    
    
            G1 X#1001 Y#1002
            X#1003 Y#1004
    
    
            ; t = t + dt
            #1000 = [#1000 + #20]
        END01
        
        ; connect final point
        #1000 = 1
    
    
        ; x0 = x1
        #1001 = #1003
        ; y0 = y1
        #1002 = #1004
    
    
        ; calc x1 & y1
        G65 P1001 T#1000 A#1 B#3 C#8 D#4
        #1003 = #100
        G65 P1002 T#1000 A#2 B#7 C#6 D#5
        #1004 = #100
    
    
        G1 X#1001 Y#1002
        X#1003 Y#1004
    M99
    
    
    ; X function for a degree 3 Bezier curver
    ;
    ;   t       T   #20
    ;   x0      A   #1
    ;   x1      B   #2
    ;   x2      C   #3
    ;   x3      D   #7
    ;
    ;   #100 =  x0 * (1 - t) ^ 3 +
    ;           x1 * 3 * t * (1 - t) ^ 2 +
    ;           x2 * 3 * t ^ 2 * (1 - t) +
    ;           x3 * t ^ 3
    O1001
        #100 = [ 0    + [#1 * [[1 - #20] ** 3]] ]
        #100 = [ #100 + [#2 * 3 * #20 * [[1 - #20] ** 2]] ]
        #100 = [ #100 + [#3 * 3 * [#20 ** 2] * [1 - #20]] ]
        #100 = [ #100 + [#7 * [#20 ** 3]] ]
    M99
    
    
    ; Y function for a degree 3 Bezier curver
    ;
    ;   t       T   #20
    ;   y0      A   #1
    ;   y1      B   #2
    ;   y2      C   #3
    ;   y3      D   #7
    ;
    ;   #100 =  y0 * (1 - t) ^ 3 +
    ;           y1 * 3 * t * (1 - t) ^ 2 +
    ;           y2 * 3 * t ^ 2 * (1 - t) +
    ;           y3 * t ^ 3
    O1002
        #100 = [ 0    + [#1 * [[1 - #20] ** 3]] ]
        #100 = [ #100 + [#2 * 3 * #20 * [[1 - #20] ** 2]] ]
        #100 = [ #100 + [#3 * 3 * [#20 ** 2] * [1 - #20]] ]
        #100 = [ #100 + [#7 * [#20 ** 3]] ]
    M99
    Sample code:
    Code:
    G17 G20 G40 G49 G80 G90
    G54 F100
    
    
    G52 X2 Y2
    G0 X0 Y1
    
    
    G64 Q.01 P.01
    
    
    ; select T1 color
    M61 Q1
    
    
    ; control point for 1 inch radius
    #1=0.55191502449
    
    
    ; circle of 1 inch with bezier curve
    ;
    ;     dt    p1.X  p1.Y  p2.X  p2.Y  p3.X  p3.Y  p4.X  p4.Y
    ;    =====  ====  ====  ====  ====  ====  ====  ====  ====
    G300 T0.01  A0    B1    C#1   D1    E1    K#1   I1    J0
    G300 T0.01  A1    B0    C1    D-#1  E#1   K-1   I0    J-1
    G300 T0.01  A0    B-1   C-#1  D-1   E-1   K-#1  I-1   J0
    G300 T0.01  A-1   B0    C-1   D#1   E-#1  K1    I0    J1
    
    
    ; select T2 color
    M61 Q2
    
    
    ; circle of 1 inch with g2
    G0 X0 Y1
    G2 X0 Y1 I0 J-1
    
    
    M2
    Result:


    Video:


    In next days I will try to create a macro to manage cycles with NURBS control points eg:

    Code:
    G66 p"nurbs" Q1 L3
         X0 Y1 Q1
         X2 Y2 Q1
         X2 Y0 Q1
         X0 Y0 Q2
    G67
    

Similar Threads

  1. cnc controller board
    By tarek_manja in forum Controller & Computer Solutions
    Replies: 1
    Last Post: 05-25-2019, 11:38 PM
  2. Replies: 0
    Last Post: 07-24-2017, 05:33 PM
  3. Osai controller - problems rendering curves
    By Grant Nicholson in forum Techno CNC
    Replies: 1
    Last Post: 08-05-2015, 08:48 PM
  4. Replies: 1
    Last Post: 11-08-2011, 05:30 PM
  5. CNC Controller board
    By alansmith in forum Commercial CNC Wood Routers
    Replies: 4
    Last Post: 08-31-2009, 12:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •