Welcome to Our Community

Some features disabled for guests. Register Today.

Blackbox moves servo on serial disconnect

Discussion in 'Controller Boards' started by Jackson Seal, Apr 18, 2023.

  1. Jackson Seal

    Builder

    Joined:
    Sep 28, 2022
    Messages:
    2
    Likes Received:
    0
    I have an 2 axis ACRO system w/servo controlled by a Blackbox x4, with a python script utilizing michaelfranzl/gerbil for motion planning.

    The general workflow is:
    • open serial port and initiate connection
    • start polling
    • wait for grbl 'welcome message'
    • unlock alarm
    • move pen up
    • home
    • move between series of points, pen up, sleep, pen down, etc
    • return to home
    • disconnect
    Rarely, as the script is disconnecting from the serial port, the pen will move up farther than I ever command it to, jamming the system mechanically.

    I know you wouldn't support 3rd party libraries, but is this something that's been seen before with BlackBox or grbl? Something I could be missing?
    Could this be something that happens when the PWM output stops suddenly before the power does, and the servo interprets this is a different commanded position? If so, how could I work around that?
     
  2. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,047
    Likes Received:
    4,313
    As servos rely on pulse trains for position, resets etc (times when firmware is not running) stops pulse trains. Design your hardware so m3S0 does not result in a crash
     
  3. Jackson Seal

    Builder

    Joined:
    Sep 28, 2022
    Messages:
    2
    Likes Received:
    0
    Okay, thanks for the response. I suppose I could feed the 5V for the servo through the relay to cut power when the pulse train is not ready, right?
     
  4. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,454
    Likes Received:
    1,915
    with GRBL's servo control it will always move the servo to whichever end is PWM level 0 when an M5 is received. (common at the end of gcode programs)
    M5 is sometimes different position to M3 S0, but close to it.
    This means that your mechanical setup must allow the servo to move to that extreme, AND that end of movement should be 'pen up' so it is safe.

    So, the disconnect is sometimes triggering a 'M5' condition which I believe sets the PWM level to 0. different servos will react differenly to that condition, most will drive to one end of travel, some will just maintain current position (probably the expensive digital ones :) )

    Better to configure the hardware so any movement is safe.
     
    Peter Van Der Walt likes this.

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