Problem controlling a cnc spindle



  • Hello,

    I'm trying to build a 3dprinter/cnc machine with the Duet wifi but i can't manage to control the spindle.

    The cnc spindle is made by an esc and an rc motor, i tested the esc with a servo tester and it is fully working but when i connect it to the fan header i get no movement.

    Here's what i did:

    Connect the esc using only signal and ground wires to the fan2 pin

    Disabled the pwm fan 2
    M106 P2 I-1

    Load a new tool
    M563 P2 S"Spindle"

    Set the board to CNC mode using pwm fan 2 as servo output
    M453 P22 R15000

    Using M3 or M280 command doesn't produce any movement in the motor.

    The esc is a skywalker 80A UBEC and it works with 5v signals, the fan jumpers are set to internal 5v.

    Am i doing anything wrong?

    Can PWM fans output 5v PWM signal?


  • administrators

    Try this:

    • Common the grounds of the ESC and the Duet
    • Connect FAN- on the FAN2 connector to the ESC PWM input
    • Connect a pullup resistor (e.g. 1K) between the ESC PWM input and +5V

    You will need to use the I1 parameter in M453 to invert the PWM polarity.

    You will probably find that when you start the Duet, the motor runs at full speed for a short while as the Duet starts up. You could use Fan1 instead of Fan2 to avoid this.



  • Thank you for the reply, but i'm not shure I understood.

    The esc pwm imput must be connected to the negative of the fan and at the same time should be connected to the positive of the same fan with a resistor.

    Did i misunderstood?


  • administrators

    @stoneking said in Problem controlling a cnc spindle:

    Thank you for the reply, but i'm not shure I understood.

    The esc pwm imput must be connected to the negative of the fan and at the same time should be connected to the positive of the same fan with a resistor.

    Did i misunderstood?

    If VFAN is set to 5V then you can do that. But if instead you connect the resistor to the 5V pin on the expansion connector, then you can set VFAN to be VIN instead if that is more convenient for driving actual fans.



  • Thank you so much, I'll try with the expansion connector.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.