Odd PWM Fan Output Behaviour

  • I've been trying to utilise the Fan0 PWM output with a PWM DC spindle controller today and have noticed the following -

    With the digital oscilloscope connected to the two pins and send M106 I1 F2000 S0 the voltage floats at about 1.7V rather than 0V. If I send M106 I1 F2000 S100 the PWM peaks are at 5V and troughs are at 1.7V (with the fan jumper set to 5V). If I just connect the V_FAN pin and place the ground connector from the probe to ground on the board the PWM is gone and I just get a constant 5V so I assume it is the FAN negative pin that is doing all the switching? I understand that this is all being driven through a MOSFET of some sort, however I was wondering if there is something I need to do to get a clean PWM that sits at 0V with S0 and has the troughs at 0V for all higher values? As it is the DC spindle controller does not fully stop the motor if the fan is set to S0 due to the presence of the 1.7V. I tried placing a low ohm resistor in series which seems to stop the motor at S0 however S255 then behaves like S20.

    If I change the fan jumper to use the input voltage (12V) then the PWM highs and lows are 12V and 10V so in this case there is only a 2V drop so as far as the DC controller is concerned it's getting 100% PWM

    For those interested this is the spindle/controller I picked up - http://www.ebay.com.au/itm/121702880131. Would help if the Chinese supplier had some form of documentation?? The listing description says "MACH3 -PWM speed control signal input, external PWM input requirements: level 3.5-12V VPP, frequency 1K-10KHZ, suitable for MACH3 spindle speed control." Fairly sure the Gecko G540 controller I use on my main CNC router uses a 0-10V analogue output to drive a VFD speed rather than PWM so perhaps the seller has a misunderstanding of PWM?

  • Just found this http://otocoup.com/aql/#hlp:allb/connecting_servo. Hoping that wiring setup will give me the correct PWM?

  • administrators

    You need to:

    1. Connect a pullup resistor across the fan output pins, or between the fan negative output and +5V.

    2. Measure the output voltage at the fan negative output and ground with your oscilloscope. Oscilloscope ground must only be connected to Duet ground, connecting it anywhere else will short something out. Don't connect anything to the fan +ve output, it will be permanently at +5V or whatever you have the fan voltage jumper set to.

    3. Send M106 P0 I1 to invert the PWM signal.

    Caution: at power up, the FAN- output will be at +5V or whatever voltage the pullup resistor goes to, until the M106 P1 I1 command has been executed. If you want an output that is low at power up, use FAN1 instead.

  • Thanks David. Glad you mentioned the inverted output at power up on Fan0 as I have no idea if the PWM on this DC motor controller uses diodes to protect the polarity. Will go with Fan1 instead and use M106 P1 I1. I assume fan1 will also require the same 470ohm pullup circuit? This PWM output will go via a switch to redirect the PWM to either the spindle controller or the laser controller depending on the mode I'm running with.

    BTW, how is the new DUEX expansion board going for the Duet Wifi?

  • administrators

    Yes you will need a pull up resistor. You will also need to cancel thermostatic mode for fan 1 so use M106 P1 I1 H-1 S0 at the start of config.g.

    Another way is to use one of the heater outputs on the expansion bus. If you will be using a DueX5 then it will provide 5V PWM outputs for you already.

    We are waiting for the prototype DueX5 PCBs, they should be ready any day now.

Log in to reply