V4.96 Pro supports multiple spindles on one machine. Spindles can be controlled by different hardware interfaces like relays, PWM, DACs, or RS485 serial interfaces to VFDs. Lasers are treated as spindles.
Each spindle is assigned a range of tool numbers. You change spindles by issuing the GCode command “M6 Tn”, where n is the tool number. Tool numbers within the assigned range for a given spindle will activate that spindle - and the detailed number within the range could be used to select the specific tool on the spindle. This lets you have, for example, a single machine with an ATC spindle and a laser. A single GCode file could allow you to etch and cut out a part. Most CAM programs support tool numbers. You could also have a gantry with both a low-speed high-torque pulley spindle and also a high-speed direct drive spindle.
If you want a particular spindle to be the default spindle upon power-on, simply set it as T0.
Due to differences in wiring diagrams provided by various manufacturers, always consult the relevant manual for detailed instructions. Below are key points to keep in mind:
For functions such as forward rotation and reverse rotation, please refer to the relevant documentation provided by the manufacturer and conduct appropriate testing.
When you input the command M3 S24000, relay I2SO.23 will be triggered, and the 0-10V voltage will be output via GPIO.13.
You can also use the onboard relay for control, which is managed by controlling the output of GPIO.26.
# Begin 10V 10V: forward_pin: NO_PIN reverse_pin: NO_PIN pwm_hz: 5000 output_pin: gpio.13 enable_pin: I2SO.23 # direction_pin: NO_PIN disable_with_s0: false s0_with_disable: true # spinup_ms: 0 # spindown_ms: 0 tool_num: 3 speed_map: 0=0.000% 1000=0.000% 24000=100.000% off_on_alarm: false
# Begin Laser Laser: pwm_hz: 5000 output_pin: gpio.12 enable_pin: NO_PIN disable_with_s0: false s0_with_disable: true tool_num: 2 speed_map: 0=0.000% 255=100.000% off_on_alarm: true
BESC means “Brushless Electronic Speed Controller” of the type used to power propeller motors for hobby-type radio-controlled planes, helicopters, and drones. Those motors can be used for high-speed spindles on light-duty machines that do not have substantial tool side loads. They use the same type of PWM signal as an RC servo. Conventional PWM controls power by adjusting the duty cycle between 0% and 100%, whereas RC servo PWM adjusts the pulse length between (typically) 1 ms (for motor off) and 2 ms (motor full on) within a pulse repetition period of about 20 ms. Only one PWM-capable I/O pin is required. It must be a digital output pin that presents the raw PWM waveform, not a PWM-to-analog output that creates a variable DC voltage by low-pass filtering the PWM waveform.
Earlier versions of FluidNC had a special BESC spindle type, but we realized that, with suitable config settings for pwm_hz and speed_map, the PWM spindle type works perfectly for BESCs.
The usual pulse repetition rate for BESCs is 20ms which is 50 Hz in frequency units, so set the pwm_hz config item to 50 (some BESCs can operate with higher pulse repetition rates, up to perhaps 200Hz). Let's assume that the minimum pulse time is the typical 1ms (motor off) and the maximum time is 2 ms (motor full on). 1ms is 5% of 20ms and 2ms is 10%. Let's also assume that you wish to set the motor speed with GCode S values between 0 and 1000. Therefore, the speed_map config item would have the value “0=5% 1000=10%”.
pwm: pwm_hz: 50 # direction_pin: NO_PIN output_pin: gpio.4 # enable_pin: NO_PIN # disable_with_s0: false # s0_with_disable: true # spinup_ms: 0 # spindown_ms: 0 tool_num: 1 speed_map: 0=5% 1000=10% # off_on_alarm: false
z: steps_per_mm: 100.000 max_rate_mm_per_min: 5000.000 acceleration_mm_per_sec2: 100.000 max_travel_mm: 5.000 soft_limits: true homing: cycle: 1 positive_direction: true mpos_mm: 5.000 motor0: rc_servo: pwm_hz: 50 output_pin: gpio.27 min_pulse_us: 1000 max_pulse_us: 2000
example with rotation reversed
rc_servo: pwm_hz: 60 output_pin: gpio.27 min_pulse_us: 2000 max_pulse_us: 1000
Please visit: http://wiki.fluidnc.com/en/config/config_spindles
Please visit: http://wiki.fluidnc.com/en/config/axes