mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-27 00:05:06 +02:00
Rc servo updates (#794)
* Initial release with custom machine * initial release * Wrong addition corrected. AmoutOfToolChanges counts up now. * pressing Z probe button once is fine, not a second time. reporting not in sequence to function flow * First working FreeRTOS task with static text. Send "471" every second to all outputs * Z Probe triggered correctly at button pressed. Can read out all values * gitignore * running with state machine, repeatable results in test environment * works, except that function "user_tool_change" starts the tool change and it will interfer with further g code running in parallel. tbd * typo * back to without RTOS.But doesnt move * RTOS but only with "T1 m06". not with g code program * hold is better than door * initial wifi settings * umlaute * gitignore * Fehler bei Limit_Mask * Spindle_Type angepasst * lower debounding after adding capacitor * Revert "lower debounding after adding capacitor" This reverts commiteadbec2359
. * remove customized gitignore * Revert "remove customized gitignore" This reverts commitce44131c7a
. * reduce debounding period due to adding capacitor * uncomment all tool change source code * Tets Fräse 2.6 ok * Fräse 2.6 * Falscher GPIO Pin für Fräse * test * Revert "test" This reverts commit1265435786
. * No Bluetooth necessary * OTA update (watch Windows firewall!) * - rename custom machine file name -added "4axis_xyza.txt" to store Grbl_ESP32 config parameters. So programming fits to parameters - added 2 buttons (#1 hold/resume), #2 homing and tool change position * new Z probe button * Z probe corretion * Z probe correction * Z probe correction * Fixed Grbl.h - I think I deleted the GRBL_VERSION line by accident when using the web based conflict editor * Revert "Merge branch 'Devt' of https://github.com/bdring/Grbl_Esp32 into Devt" This reverts commit361558b6b7
, reversing changes made to811646f5e7
. * Revert "Merge remote-tracking branch 'Grbl_Esp32_JH/master' into Devt" This reverts commit811646f5e7
, reversing changes made toa61ab51c0b
. * RcServo Updates - Improved disable. It was not always initially set correctly. - Improved calibration. Now a calibration value greater than 1 moves the motor in a positive direction and a value less than 1 moves it in a negative direction regardless of min/max and direction inverts. * Update Grbl.h Update grbl.h Co-authored-by: Jens Hauser <44340656+JensHauser@users.noreply.github.com> Co-authored-by: Mitch Bradley <wmb@firmworks.com> Co-authored-by: JensHauser <jens@hauser-digital.de>
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
// Grbl versioning system
|
||||
const char* const GRBL_VERSION = "1.3a";
|
||||
const char* const GRBL_VERSION_BUILD = "20210305";
|
||||
const char* const GRBL_VERSION_BUILD = "20210306";
|
||||
|
||||
//#include <sdkconfig.h>
|
||||
#include <Arduino.h>
|
||||
|
@@ -50,7 +50,7 @@ namespace Motors {
|
||||
ledcSetup(_channel_num, SERVO_PULSE_FREQ, SERVO_PULSE_RES_BITS);
|
||||
ledcAttachPin(_pwm_pin, _channel_num);
|
||||
_current_pwm_duty = 0;
|
||||
|
||||
_disabled = true;
|
||||
config_message();
|
||||
startUpdateTask();
|
||||
}
|
||||
@@ -78,10 +78,6 @@ namespace Motors {
|
||||
|
||||
// sets the PWM to zero. This allows most servos to be manually moved
|
||||
void RcServo::set_disable(bool disable) {
|
||||
if (_disabled == disable) {
|
||||
return;
|
||||
}
|
||||
|
||||
_disabled = disable;
|
||||
if (_disabled) {
|
||||
_write_pwm(0);
|
||||
@@ -107,11 +103,6 @@ namespace Motors {
|
||||
if (_disabled)
|
||||
return;
|
||||
|
||||
if (sys.state == State::Alarm) {
|
||||
set_disable(true);
|
||||
return;
|
||||
}
|
||||
|
||||
read_settings();
|
||||
|
||||
mpos = system_convert_axis_steps_to_mpos(sys_position, _axis_index); // get the axis machine position in mm
|
||||
@@ -127,10 +118,14 @@ namespace Motors {
|
||||
}
|
||||
|
||||
void RcServo::read_settings() {
|
||||
_pwm_pulse_min = SERVO_MIN_PULSE * rc_servo_cal_min->get();
|
||||
_pwm_pulse_max = SERVO_MAX_PULSE * rc_servo_cal_max->get();
|
||||
if (bitnum_istrue(dir_invert_mask->get(), _axis_index)) {
|
||||
// swap the pwm values
|
||||
_pwm_pulse_min = SERVO_MAX_PULSE * (1.0 + (1.0 - rc_servo_cal_min->get()));
|
||||
_pwm_pulse_max = SERVO_MIN_PULSE * (1.0 + (1.0 - rc_servo_cal_max->get()));
|
||||
|
||||
if (bitnum_istrue(dir_invert_mask->get(), _axis_index)) // normal direction
|
||||
swap(_pwm_pulse_min, _pwm_pulse_max);
|
||||
} else {
|
||||
_pwm_pulse_min = SERVO_MIN_PULSE * rc_servo_cal_min->get();
|
||||
_pwm_pulse_max = SERVO_MAX_PULSE * rc_servo_cal_max->get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user