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

Link to this comparison view

Both sides previous revision Previous revision
spindle-module [2018/07/09 17:58] [Basics]
spindle-module [2019/05/06 18:52] (current) [PWM Spindle] added hobby ESC block - V1pr
Line 52: 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 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.
 +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
 </​callout>​ </​callout>​