Shop OBEX P1 Docs P2 Docs Learn Events
Stepper motor jerk --> Motion Planner? — Parallax Forums

Stepper motor jerk --> Motion Planner?

RaymanRayman Posts: 15,035
edited 2025-03-14 14:27 in Propeller 2

Chip just introduced me to "jerk" as it relates to stepper motors at the last Live Forum.
Liking the idea of using 128 bit math to make CNC/3DPrinter/PNP type things go faster.

Just got an email from Ultimaker about their new "Cheetah motion planner" which sounds like they are working on something like this too.

This stuff seems like it can get pretty complicated...
But, I guess the ultimate goal here is a "motion planner", right?

Comments

  • evanhevanh Posts: 16,345

    Pick'n'place is quite a bit different to CNC motion in that there is no need for performing coordinated surface machining. PnP is all about gauging then adjusting the destination to suit. Each axis can be operated independently. Like simple cut-to-length but with ongoing calibrations. You can throw away most of the maths.

  • Christof Eb.Christof Eb. Posts: 1,295
    edited 2025-03-14 17:03

    @Rayman said:
    Chip just introduced me to "jerk" as it relates to stepper motors at the last Live Forum.
    Liking the idea of using 128 bit math to make CNC/3DPrinter/PNP type things go faster.

    Just got an email from Ultimaker about their new "Cheetah motion planner" which sounds like they are working on something like this too.

    This stuff seems like it can get pretty complicated...
    But, I guess the ultimate goal here is a "motion planner", right?

    Hi,
    In my experience there is a very big difference between a 3d printer and a cnc mill in that the type of the load is very different.
    In a 3d printer all the load comes from acceleration. The relevant parameters like mass are well known and repeat very well.

    In a cnc mill or lathe most of the load comes from cutting force and friction. And both of these are widely unkown. Also you need stiffness not only for the force of your drive but also for the forces of the cutting process. Those might have different directions.

  • RaymanRayman Posts: 15,035

    So, for CNC, was thinking of simple 2.5D ones like the Shapeoko we have. Not the big ones...
    Don't think these have a lot of force during cutting as you barely need to hold down the material you are working one.

  • RaymanRayman Posts: 15,035

    One thing that would be nice with Shapeoko, for example is if do homing faster. This is painful to wait for... Not sure if this idea works with belt driven axis though. Maybe it's just for direct lead screw type things?

    Beyond homing, the advantage of this for Shapeoko might be questionable, because it spends most if it's time doing slow, steady movements...

    Seems like Pick and Place does the most running back and forth at full speed of anything can thing of...

  • ManAtWorkManAtWork Posts: 2,190
    edited 2025-03-15 13:11

    @Rayman said:
    One thing that would be nice with Shapeoko, for example is if do homing faster. This is painful to wait for... Not sure if this idea works with belt driven axis though. Maybe it's just for direct lead screw type things?

    The max. speed for homing mainly depends on the brake distance reserve you have behind the trigger point of your home switch. If you run onto a proximity switch in the axial direction or have a hard stop there is no reserve and you need to go slow. If you have the switch mouted sideways with a sloped notch the switch can't be damaged.

    For 2m/s² acceleration and 100mm/s the braking distance is 5mm. If you have 20mm braking distance available you can home at 0.2m/s = 12m/min which is quite fast. Precision comes from the trigger point when inching away from the switch. 1mm/s provides 1µm accuracy assuming 1ms timing resolution.

    Also remember, you need to home only once per day. Most 3D printers do a homing before every job. But that's not necessary if your drives are strong enough so you can be sure not to loose steps. I start the homing immediately after switching on power. So when I'm done collecting the tools I need and loading the program it's already completed.

    BTW, Chinese servo drives have become ridiculously cheap. There are 1HP servos with multi-turn absolute encoder for $150 including driver and cables. I'm currently working on MODBUS communication so I can read the absolute position while providing position commands with step/dir signals. (yes, I abandonned EtherCat for near future). This will make homing completely unnecessary.

  • MicksterMickster Posts: 2,764

    S-Curve Acceleration:

    dim as integer res,samptime, time_to_accel_ms,intspeed
    dim as float f,ramp_segments,frac
    
    time_to_accel_ms = 125
    
    ramp_segments = 1/time_to_accel_ms
    
    sync 1,M
    
    do
      inc samptime,1
      sync 'wait for next ms
      frac = samptime*ramp_segments
    
      f=(3-2*frac)*frac^2
    
      intspeed = f * 5000
    
      print samptime, intspeed
    
    loop until samptime=time_to_accel_ms
    
    

    Trajectory Planner

  • MicksterMickster Posts: 2,764
    edited 2025-03-15 22:03

    @ManAtWork said:
    This will make homing completely unnecessary.

    For regular incremental encoders, @T Chap uses the LS7366, powered separately with a 5V UPS. The counters stay alive when the P1 is powered-down. It is SPI and features a power-fail flag :+1:

  • GenetixGenetix Posts: 1,763

    I think an important feature that would be nice to have for CNC is automatic chatter adjustment where if a vibration sensor detects chatter the depth of cut is reduced.

    One the flip side you could also have the software continually adjust the depth of cut so it never exceeds the chatter threshold.

  • cgraceycgracey Posts: 14,276

    @Genetix said:
    I think an important feature that would be nice to have for CNC is automatic chatter adjustment where if a vibration sensor detects chatter the depth of cut is reduced.

    One the flip side you could also have the software continually adjust the depth of cut so it never exceeds the chatter threshold.

    I have heard that some newer CNC mills and lathes will continuously vary speed speed rates to avoid sympathetic vibrations from building up.

  • @Mickster said:
    For regular incremental encoders, @T Chap uses the LS7366, powered separately with a 5V UPS. The counters stay alive when the P1 is powered-down. It is SPI and features a power-fail flag :+1:

    Yes, but if you don't have very stiff holding brakes you have to also power the encoder with the UPS to avoid loosing small movements while powered down. Some clever encoders from SanyoDenki solve that with a Wiegand wire sensor. If the encoder moves while powered down the Wiegand wire generates pulses that wake up the (extremely low power consumption) µC.

  • MicksterMickster Posts: 2,764

    @ManAtWork said:

    @Mickster said:
    For regular incremental encoders, @T Chap uses the LS7366, powered separately with a 5V UPS. The counters stay alive when the P1 is powered-down. It is SPI and features a power-fail flag :+1:

    Yes, but if you don't have very stiff holding brakes you have to also power the encoder with the UPS to avoid loosing small movements while powered down. Some clever encoders from SanyoDenki solve that with a Wiegand wire sensor. If the encoder moves while powered down the Wiegand wire generates pulses that wake up the (extremely low power consumption) µC.

    Sure. He keeps the encoders powered via the UPS. Obviously, the UPS will eventually discharge but in most cases, a few days is fine.

  • ErNaErNa Posts: 1,800
    edited 2025-03-17 14:22

    Found this video that may show some interesting aspects as a starter ;-)

  • MicksterMickster Posts: 2,764

    Trapezoidal Profile

    REM Move parameters
    speed = 750
    acceleration = 1000
    deceleration = 500
    move_distance = 2110
    
    time_to_accel = speed / acceleration
    time_to_decel = speed / deceleration
    
    distance_to_accel = (time_to_accel * speed)/2
    distance_to_decel = (time_to_decel * speed)/2
    
    REM Check if move_distance is sufficient for trapezoidal profile
    if (distance_to_accel + distance_to_decel) > move_distance then
      speed = sqr((2 * move_distance * acceleration * deceleration) / (acceleration + deceleration))
      time_to_accel = speed / acceleration
      time_to_decel = speed / deceleration
      distance_to_accel = (time_to_accel * speed)/2
      distance_to_decel = (time_to_decel * speed)/2
    end if
    
    slew_distance = move_distance - (distance_to_accel + distance_to_decel)
    slew_time = slew_distance / speed
    
Sign In or Register to comment.