Skip to content

Instantly share code, notes, and snippets.

@Bouni
Last active August 29, 2015 14:19
Show Gist options
  • Save Bouni/236e38efe9d31f897772 to your computer and use it in GitHub Desktop.
Save Bouni/236e38efe9d31f897772 to your computer and use it in GitHub Desktop.
Smothieboard Spindle improvement

Smoothieboard Spindle improvements

Modules

  • SpindleMaker: loads the right spindle module depending on the config, deletes itself after thats done. (Like the ExtruderMaker)
  • SpindleControl: Baseclass for other spindles
  • PWMSpindleControl: For DC spindles that are directly driven by one of the MOSFET outputs (the old spindle module)
  • AnalogSpindleControl: For controlling a VFD driven spindle with an analog 0-10V signal. Some additional electronic is required to convert the 3.3V PWM signal into a 0-10V signal
  • ModbusSpindleControl: For controling a VFD via Modbus-RTU over RS485. This is for VFD's that can be controlled via Modbus telegrams. This is also used for VFD's that claim to support Modbus but use a crippled RS485 Modbus like protocol. Some additional electronic is required to translate RS232 3.3V into RS485.

##Config

What a config for a certain spindle type should look like.

General config options

spindle.enable                                     true|false 

PWM spindle

spindle.mode                                       pwm
spindle.pwm_pin                                    2.0|2.1|2.2|2.3|2.4|2.5    // Must be one of these pins because we need HW PWM 
spindle.pwm_period                                 1000
spindle.feedback_pin                               2.4                        // Must be an interrupt capable pin (0.X | 2.X)
spindle.pulses_per_rev                             1
spindle.default_rpm                                5000
spindle.control_P                                  0.0001
spindle.control_I                                  0.0001
spindle.control_D                                  0.0001
spindle.control_smoothing                          0.1

Analog VFD spindle

spindle.mode                                       analog
spindle.pwm_pin                                    2.0|2.1|2.2|2.3|2.4|2.5    // Must be one of these pins because we need HW PWM 
spindle.pwm_period                                 1000
spindle.switch_on_pin                              2.4                        // Any free pin that can be used as an digital output pin

Modbus VFD spindle

spindle.mode                                       modbus
spindle.type                                       omron_mx2 | huanyang       // VFD type (must be implemented)
spindle.rx_pin                                     2.4                        // Must be an interrupt capable pin (0.X | 2.X)
spindle.tx_pin                                     2.6                        // Any free pin that can be used as an digital output pin
spindle.dir_pin                                    2.5                        // Any free pin that can be used as an digital output pin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment