diff --git a/Firmware/ConfigSamples/SKRv2/config.txt b/Firmware/ConfigSamples/SKRv2/config.txt new file mode 100644 index 00000000..43a1a39d --- /dev/null +++ b/Firmware/ConfigSamples/SKRv2/config.txt @@ -0,0 +1,125 @@ +{ + "Board": "BIGTREETECH SKR v2", + "Modules":[ + { + "Thread": "Servo", + "Type": "Reset Pin", + "Comment": "Reset pin", + "Pin": "PC_4" + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "X - Joint 0 step generator", + "Joint Number": 0, + "Step Pin": "PE_2", + "Direction Pin": "PE_1", + "Enable Pin": "PE_3" + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "Y - Joint 1 step generator", + "Joint Number": 1, + "Step Pin": "PD_5", + "Direction Pin": "PD_4", + "Enable Pin": "PD_6" + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "Z - Joint 2 step generator", + "Joint Number": 2, + "Step Pin": "PA_15", + "Direction Pin": "PA_8", + "Enable Pin": "PD_1" + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "E0 - Joint 3 step generator", + "Joint Number": 3, + "Step Pin": "PD_15", + "Direction Pin": "PD_14", + "Enable Pin": "PC_7" + }, + { + "Thread": "Servo", + "Type": "Temperature", + "Comment": "Extruder tenperature sensor", + "PV[i]": 0, + "Sensor": "Thermistor", + "Thermistor": + { + "Pin": "0.23", + "beta": 3990, + "r0": 100000, + "t0": 25 + } + }, + { + "Thread": "Base", + "Type": "RCServo", + "Comment": "RC servo for probe", + "SP[i]": 3, + "Servo Pin": "2.0" + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "X min", + "Pin": "PC_1", + "Mode": "Input", + "Data Bit": 0 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "X max", + "Pin": "PC_2", + "Mode": "Input", + "Data Bit": 1 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Y min", + "Pin": "PC_3", + "Mode": "Input", + "Data Bit": 2 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Y max", + "Pin": "PA_0", + "Mode": "Input", + "Data Bit": 3 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Z min", + "Pin": "PC_0", + "Mode": "Input", + "Data Bit": 4 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Z max", + "Pin": "PC_15", + "Mode": "Input", + "Data Bit": 5 + }, + { + "Thread": "Servo", + "Type": "Switch", + "Comment": "Extruder fan switch", + "Pin": "PB_7", + "Mode": "On", + "PV[i]": 0, + "SP": 25.5 + } + ] +} diff --git a/Firmware/ConfigSamples/SKRv2_TMC2209/config.txt b/Firmware/ConfigSamples/SKRv2_TMC2209/config.txt new file mode 100644 index 00000000..321c235a --- /dev/null +++ b/Firmware/ConfigSamples/SKRv2_TMC2209/config.txt @@ -0,0 +1,173 @@ +{ + "Board": "BIGTREETECH SKR v2", + "Modules":[ + { + "Thread": "Servo", + "Type": "Reset Pin", + "Comment": "Reset pin", + "Pin": "PC_4" + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "X - Joint 0 step generator", + "Joint Number": 0, + "Step Pin": "PE_2", + "Direction Pin": "PE_1", + "Enable Pin": "PE_3" + }, + { + "Thread": "On load", + "Type": "TMC stepper", + "Comment": "X - Joint 0 TMC driver", + "Driver": "2209", + "RX pin": "PE_0", + "RSense": 0.11, + "Current": 800, + "Microsteps": 16, + "Stealth chop": "on", + "Stall sensitivity":0 + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "Y - Joint 1 step generator", + "Joint Number": 1, + "Step Pin": "PD_5", + "Direction Pin": "PD_4", + "Enable Pin": "PD_6" + }, + { + "Thread": "On load", + "Type": "TMC stepper", + "Comment": "Y - Joint 1 TMC driver", + "Driver": "2209", + "RX pin": "PD_3", + "RSense": 0.11, + "Current": 800, + "Microsteps": 16, + "Stealth chop": "on", + "Stall sensitivity":0 + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "Z - Joint 2 step generator", + "Joint Number": 2, + "Step Pin": "PA_15", + "Direction Pin": "PA_8", + "Enable Pin": "PD_1" + }, + { + "Thread": "On load", + "Type": "TMC stepper", + "Comment": "Z - Joint 2 TMC driver", + "Driver": "2209", + "RX pin": "PD_0", + "RSense": 0.11, + "Current": 800, + "Microsteps": 16, + "Stealth chop": "on", + "Stall sensitivity":0 + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "E0 - Joint 3 step generator", + "Joint Number": 3, + "Step Pin": "PD_15", + "Direction Pin": "PD_14", + "Enable Pin": "PC_7" + }, + { + "Thread": "On load", + "Type": "TMC stepper", + "Comment": "E0 - Joint 3 TMC driver", + "Driver": "2209", + "RX pin": "PC_6", + "RSense": 0.11, + "Current": 800, + "Microsteps": 16, + "Stealth chop": "on", + "Stall sensitivity":0 + }, + { + "Thread": "Base", + "Type": "Stepgen", + "Comment": "E1 - Joint 4 step generator", + "Joint Number": 4, + "Step Pin": "PD_11", + "Direction Pin": "PD_10", + "Enable Pin": "PD_13" + }, + { + "Thread": "On load", + "Type": "TMC stepper", + "Comment": "E1 - Joint 4 TMC driver", + "Driver": "2209", + "RX pin": "PD_12", + "RSense": 0.11, + "Current": 800, + "Microsteps": 16, + "Stealth chop": "on", + "Stall sensitivity":0 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "X min", + "Pin": "PC_1", + "Mode": "Input", + "Data Bit": 0 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "X max", + "Pin": "PC_2", + "Mode": "Input", + "Data Bit": 1 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Y min", + "Pin": "PC_3", + "Mode": "Input", + "Data Bit": 2 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Y max", + "Pin": "PA_0", + "Mode": "Input", + "Data Bit": 3 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Z min", + "Pin": "PC_0", + "Mode": "Input", + "Data Bit": 4 + }, + { + "Thread": "Servo", + "Type": "Digital Pin", + "Comment": "Z max", + "Pin": "PC_15", + "Mode": "Input", + "Data Bit": 5 + }, + { + "Thread": "Servo", + "Type": "Switch", + "Comment": "Extruder fan switch", + "Pin": "PB_7", + "Mode": "On", + "PV[i]": 0, + "SP": 25.5 + } + ] +} diff --git a/Firmware/FirmwareSource/Remora-OS5/.mbed b/Firmware/FirmwareSource/Remora-OS5/.mbed index 87c664b8..81bb3149 100644 --- a/Firmware/FirmwareSource/Remora-OS5/.mbed +++ b/Firmware/FirmwareSource/Remora-OS5/.mbed @@ -1,3 +1,3 @@ ROOT=. -TARGET=LPC1769 +TARGET=LPC1768 TARGET_CODE=1010 diff --git a/Firmware/FirmwareSource/Remora-OS5/modules/pwm/pwm.cpp b/Firmware/FirmwareSource/Remora-OS5/modules/pwm/pwm.cpp index 254929f2..a6e5f84d 100644 --- a/Firmware/FirmwareSource/Remora-OS5/modules/pwm/pwm.cpp +++ b/Firmware/FirmwareSource/Remora-OS5/modules/pwm/pwm.cpp @@ -35,7 +35,9 @@ void PWM::update() // update the speed SP this->SP = *(this->ptrSP); + // ensure SP is within range. LinuxCNC PID can have -ve command value if (this->SP > 100) this->SP = 100; + if (this->SP < 0) this->SP = 0; // the SP is as a percentage (%) // scale the pwm output range (0 - pwmMax) = (0 - 100%)