Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
spindle-module [2017/01/25 23:16]
arthur
spindle-module [2019/05/06 18:52] (current)
89.134.146.217 [PWM Spindle] added hobby ESC block - V1pr
Line 6: Line 6:
  
 The spindle module supports different types of spindles which are described in the following subsections. The spindle module supports different types of spindles which are described in the following subsections.
 +
 +<callout type="​info"​ icon="​true">​
 +**NOTE** the spindle module is NOT compiled into the normal smoothie build, you need to use the CNC build.
 +</​callout>​
  
 === General === General
Line 25: Line 29:
 === PWM Spindle === PWM Spindle
  
-> TODO : Transfer the information of the old [[spindle-control]] into this section 
  
 <callout type="​info"​ icon="​true">​ <callout type="​info"​ icon="​true">​
Line 49: Line 52:
 <callout type="​info"​ icon="​true">​ <callout type="​info"​ icon="​true">​
 Check the [[http://​smoothieware.org/​pinout |pinout]] to verify if a pin is capable for a certain functionality! Check the [[http://​smoothieware.org/​pinout |pinout]] to verify if a pin is capable for a certain functionality!
 +</​callout>​
 +
 +<callout type="​info"​ icon="​true"​ title="​Hobby servo ESC as spindle control">​
 +Since I'm expiriencing with hobby esc+motor combos (1:8 scale 3 phase 4068 like motor) I wanted to share it's config. ESCs act like hobby servos - 20 ms period time, 1.5-2ms duty cycle time -, so insted of having modified the spindle code, I've created a switch for commands M3/M5. Due to the very small duty cycle window you won't have much control over the motor: S7.5 is neutral, S12.5 is "​fastest"​ after calibrating the ESC manually with bCNC (read ESC's manual; below S7.5 is breaking for now).
 +
 +The following code is working, setting neutral upon boot - ESC init.
 +<​code>​
 +switch.servo.enable ​                         true             # Servo module for PWM control
 +switch.servo.input_on_command ​               M3
 +switch.servo.input_off_command ​              M5
 +switch.servo.output_pin ​                     1.23o! ​            # spare pin with PWM capability, 3.25 should also work from EXP2, maybe needed to set it to 1.23o!
 +switch.servo.output_type ​                    hwpwm
 +#​switch.servo.pwm_period_ms ​                 20                #set PWM period to 20ms (50 Hz)
 +switch.servo.startup_state ​                  ​true ​               # turn on the output to have neutral for ESC
 +switch.servo.startup_value ​                  ​7.5 ​              # this is default_off_value
 +switch.servo.default_on_value ​               7.5
 +switch.servo.failsafe_set_to ​                0
 +</​code>​
 +
 +</​callout>​
 +
 +<callout type="​default"​ icon="​true"​ title="​Going further">​
 +If you want to learn more about this module, or are curious how it works, Smoothie is Open-Source and you can simply go look at the code, [[https://​github.com/​Smoothieware/​Smoothieware/​blob/​edge/​src/​modules/​tools/​spindle/​PWMSpindleControl.cpp|here]].
 </​callout>​ </​callout>​
  
Line 85: Line 111:
 </​html>​ </​html>​
  
- 
-[[div ]] 
 This is an example of a small extension PCB that contains a circuit to convert the 3.3V PWM signal into a 0-10V analog signal. This is an example of a small extension PCB that contains a circuit to convert the 3.3V PWM signal into a 0-10V analog signal.
  
Line 99: Line 123:
  
  
-[[div]] 
 This is the related circuit diagram for the converter This is the related circuit diagram for the converter
  
Line 112: Line 135:
  
  
- 
-[[div]] 
 This example shows how to wire the Smoothieboard to an Huanyang VFD using the PCB shown above. ​ This example shows how to wire the Smoothieboard to an Huanyang VFD using the PCB shown above. ​
  
Line 127: Line 148:
 </​div>​ </​div>​
 </​html>​ </​html>​
 +</​callout>​
  
 +<callout type="​default"​ icon="​true"​ title="​Going further">​ 
 +If you want to learn more about this module, or are curious how it works, Smoothie is Open-Source and you can simply go look at the code, [[https://​github.com/​Smoothieware/​Smoothieware/​blob/​edge/​src/​modules/​tools/​spindle/​AnalogSpindleControl.cpp|here]].
 </​callout>​ </​callout>​
 +
 === Modbus Spindle === Modbus Spindle
  
Line 204: Line 228:
 [[div]] [[div]]
 This example shows how to wire the Smoothieboard to an Huanyang VFD using the PCB shown above. ​ This example shows how to wire the Smoothieboard to an Huanyang VFD using the PCB shown above. ​
 +
 +<callout type="​default"​ icon="​true"​ title="​Going further">​
 +If you want to learn more about this module, or are curious how it works, Smoothie is Open-Source and you can simply go look at the code, [[https://​github.com/​Smoothieware/​Smoothieware/​blob/​edge/​src/​modules/​tools/​spindle/​ModbusSpindleControl.cpp|here]].
 +</​callout>​