1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-03 19:32:39 +02:00

Moved step/dir/enable timing to global

This commit is contained in:
bdring
2021-05-28 10:29:24 -05:00
parent b82b55695e
commit e0c0ccb26e
7 changed files with 48 additions and 16 deletions

View File

@@ -201,7 +201,7 @@ bool user_defined_homing(AxisMask cycle_mask) {
} while (!switch_touched); } while (!switch_touched);
#ifdef USE_I2S_STEPS #ifdef USE_I2S_STEPS
if (current_stepper == ST_I2S_STREAM) { if (config->_stepType == ST_I2S_STREAM) {
if (!approach) { if (!approach) {
delay_ms(I2S_OUT_DELAY_MS); delay_ms(I2S_OUT_DELAY_MS);
} }

View File

@@ -1,14 +1,46 @@
name: "Debug config" name: "ESP32 Dev Controller V4"
board: Debug-board board: "ESP32 Dev Controller V4"
yaml_wiki: "https://github.com/bdring/Grbl_Esp32/wiki/YAML-Config-File"
idle_time: 250
step_type: rmt
dir_delay_microseconds: 1
pulse_microseconds: 2
disable_delay_us: 0
axes: axes:
number_axis: 3 number_axis: 3
shared_stepper_disable: gpio.13:low
x:
limit: gpio.32:high
gang0:
stepstick:
direction: gpio:14
step: gpio.12
gang1:
null_motor:
y:
limit: gpio.4:low
gang0:
stepstick:
direction: gpio:15
step: gpio.26
gang1:
stepstick:
direction: gpio:33
step: gpio.27
laser_mode: true laser_mode: true
coolant: coolant:
flood: gpio.26:low flood: gpio.25:low
mist: gpio.4 mist: gpio.21
probe: probe:
pin: gpio.12:high:pu pin: gpio.32:high:pu

View File

@@ -369,6 +369,8 @@ void MachineConfig::handle(Configuration::HandlerBase& handler) {
handler.handle("coolant", _coolant); handler.handle("coolant", _coolant);
handler.handle("probe", _probe); handler.handle("probe", _probe);
handler.handle("pulse_microseconds", _pulseMicroSeconds); handler.handle("pulse_microseconds", _pulseMicroSeconds);
handler.handle("dir_delay_microseconds", _directionDelayMicroSeconds);
handler.handle("disable_delay_us", _disableDelayMicroSeconds);
handler.handle("board", _board); handler.handle("board", _board);
handler.handle("name", _name); handler.handle("name", _name);
handler.handle("idle_time", _idleTime); handler.handle("idle_time", _idleTime);

View File

@@ -66,8 +66,7 @@ namespace Motors {
rmtConfig.tx_config.carrier_level = RMT_CARRIER_LEVEL_LOW; rmtConfig.tx_config.carrier_level = RMT_CARRIER_LEVEL_LOW;
rmtConfig.tx_config.idle_output_en = true; rmtConfig.tx_config.idle_output_en = true;
auto stepPulseDelay = _direction_delay_us; rmtItem[0].duration0 = config->_directionDelayMicroSeconds < 1 ? 1 : config->_directionDelayMicroSeconds * 4;
rmtItem[0].duration0 = stepPulseDelay < 1 ? 1 : stepPulseDelay * 4;
rmtItem[0].duration1 = 4 * config->_pulseMicroSeconds; rmtItem[0].duration1 = 4 * config->_pulseMicroSeconds;
rmtItem[1].duration0 = 0; rmtItem[1].duration0 = 0;

View File

@@ -29,9 +29,6 @@ namespace Motors {
Pin _dir_pin; Pin _dir_pin;
Pin _disable_pin; Pin _disable_pin;
int _direction_delay_us = 0;
int _enable_delay_us = 0;
// Configuration handlers: // Configuration handlers:
void validate() const override { void validate() const override {
Assert(!_step_pin.undefined(), "Step pin should be configured."); Assert(!_step_pin.undefined(), "Step pin should be configured.");
@@ -42,8 +39,6 @@ namespace Motors {
handler.handle("step", _step_pin); handler.handle("step", _step_pin);
handler.handle("direction", _dir_pin); handler.handle("direction", _dir_pin);
handler.handle("disable", _disable_pin); handler.handle("disable", _disable_pin);
handler.handle("direction_delay_us", _direction_delay_us);
handler.handle("enable_delay_us", _enable_delay_us);
} }
// Name of the configurable. Must match the name registered in the cpp file. // Name of the configurable. Must match the name registered in the cpp file.

View File

@@ -353,7 +353,13 @@ void stepper_init() {
busy.store(false); busy.store(false);
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Axis count %d", config->_axes->_numberAxis); grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Axis count %d", config->_axes->_numberAxis);
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Step type: %s", stepTypes[config->_stepType].name); grbl_msg_sendf(CLIENT_SERIAL,
MsgLevel::Info,
"Step type:%s Pulse:%dus Dsbl Delay:%dus Dir Delay:%dus",
stepTypes[config->_stepType].name,
config->_pulseMicroSeconds,
config->_disableDelayMicroSeconds,
config->_directionDelayMicroSeconds);
#ifdef USE_I2S_STEPS #ifdef USE_I2S_STEPS
// I2S stepper stream mode use callback but timer interrupt // I2S stepper stream mode use callback but timer interrupt

View File

@@ -39,8 +39,6 @@ enum stepper_id_t {
extern uint64_t stepper_idle_counter; extern uint64_t stepper_idle_counter;
extern bool stepper_idle; extern bool stepper_idle;
extern stepper_id_t current_stepper;
void stepper_init(); void stepper_init();
void stepper_switch(stepper_id_t new_stepper); void stepper_switch(stepper_id_t new_stepper);