Wiki Search Terms
debounce limit switch
Controller Board
MKS tinybee 1.0
Machine Description
gantry machine, laser and embroidery machine
Input Circuits
https://reprapproject.nl/images/optical%20endstop.jpg
Configuration file
name: Bordadora
meta: AMS 05/02/25
planner_blocks: 120
kinematics: {}
stepping:
engine: I2S_STATIC
idle_ms: 255
pulse_us: 4
dirdelayus: 1
disabledelayus: 0
i2so:
bck_pin: gpio.25
data_pin: gpio.27
ws_pin: gpio.26
spi:
miso_pin: gpio.19
mosi_pin: gpio.23
sck_pin: gpio.18
sdcard:
cs_pin: gpio.5
carddetectpin: gpio.34:low
start:
must_home: false
axes:
homing_runs: 1
x:
stepspermm: 20
maxratemmpermin: 9000
accelerationmmper_sec2: 900
maxtravelmm: 500
homing:
cycle: 1
positive_direction: false
feedmmper_min: 1500
seekmmper_min: 1500
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limitallpin: NO_PIN
limitnegpin: gpio.33:pd
limitpospin: NO_PIN
hard_limits: false
pulloff_mm: 10
stepstick:
step_pin: i2so.1
direction_pin: i2so.2
disablepin: NOPIN
ms1pin: NOPIN
ms2pin: NOPIN
ms3pin: NOPIN
y:
stepspermm: 20
maxratemmpermin: 9000
accelerationmmper_sec2: 900
maxtravelmm: 500
homing:
cycle: 1
positive_direction: false
feedmmper_min: 1500
seekmmper_min: 1500
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limitallpin: NO_PIN
limitnegpin: gpio.32:pd
limitpospin: NO_PIN
hard_limits: false
pulloff_mm: 10
stepstick:
step_pin: i2so.4
direction_pin: i2so.5
disablepin: NOPIN
ms1pin: NOPIN
ms2pin: NOPIN
ms3pin: NOPIN
z:
stepspermm: 40
maxratemmpermin: 500
accelerationmmper_sec2: 100
maxtravelmm: 10000
motor0:
limitallpin: NO_PIN
limitnegpin: NO_PIN
limitpospin: NO_PIN
hard_limits: false
pulloff_mm: 1
stepstick:
step_pin: i2so.13
direction_pin: i2so.14:low
disablepin: NOPIN
ms1pin: NOPIN
ms2pin: NOPIN
ms3pin: NOPIN
PWM:
output_pin: gpio.2:pd
tool_num: 1
Startup Messages
name: Bordadora
meta: AMS 05/02/25
planner_blocks: 120
kinematics: {}
stepping:
engine: I2S_STATIC
idle_ms: 255
pulse_us: 4
dirdelayus: 1
disabledelayus: 0
i2so:
bck_pin: gpio.25
data_pin: gpio.27
ws_pin: gpio.26
spi:
miso_pin: gpio.19
mosi_pin: gpio.23
sck_pin: gpio.18
sdcard:
cs_pin: gpio.5
carddetectpin: gpio.34:low
start:
must_home: false
axes:
homing_runs: 1
x:
stepspermm: 20
maxratemmpermin: 9000
accelerationmmper_sec2: 900
maxtravelmm: 500
homing:
cycle: 1
positive_direction: false
feedmmper_min: 1500
seekmmper_min: 1500
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limitallpin: NO_PIN
limitnegpin: gpio.33:pd
limitpospin: NO_PIN
hard_limits: false
pulloff_mm: 10
stepstick:
step_pin: i2so.1
direction_pin: i2so.2
disablepin: NOPIN
ms1pin: NOPIN
ms2pin: NOPIN
ms3pin: NOPIN
y:
stepspermm: 20
maxratemmpermin: 9000
accelerationmmper_sec2: 900
maxtravelmm: 500
homing:
cycle: 1
positive_direction: false
feedmmper_min: 1500
seekmmper_min: 1500
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
motor0:
limitallpin: NO_PIN
limitnegpin: gpio.32:pd
limitpospin: NO_PIN
hard_limits: false
pulloff_mm: 10
stepstick:
step_pin: i2so.4
direction_pin: i2so.5
disablepin: NOPIN
ms1pin: NOPIN
ms2pin: NOPIN
ms3pin: NOPIN
z:
stepspermm: 40
maxratemmpermin: 500
accelerationmmper_sec2: 100
maxtravelmm: 10000
motor0:
limitallpin: NO_PIN
limitnegpin: NO_PIN
limitpospin: NO_PIN
hard_limits: false
pulloff_mm: 1
stepstick:
step_pin: i2so.13
direction_pin: i2so.14:low
disablepin: NOPIN
ms1pin: NOPIN
ms2pin: NOPIN
ms3pin: NOPIN
PWM:
output_pin: gpio.2:pd
tool_num: 1
User Interface Software
webui
What happened?
on homing, the endstop is triggered but sometimes is kept “floating” (due to bounce on input line)
$Message/Level=Debug
GCode File
No response
Other Information
评论 (26)
#2 – MitchBradley 于 2025-02-05
I have also heard of cases where optical endstops were false-triggering due to ambient light. It was mostly in the context of K40 lasers, but I can imagine it happening on any system. At any rate, this sounds like a hardware problem.
#3 – MitchBradley 于 2025-02-05
The only other suggestion I have is to make sure that the pulloff is far enough to completely clear the optical path.
#4 – Ams-Laser 于 2025-02-05
> Why do you have :pd on the limit pins? pulldown is only useful for switches that connect to V+, not to GND. The pulldown will fight with the pullup and reduce the noise margin.
already tried PU, PD and disabled and have same result,
#5 – Ams-Laser 于 2025-02-05
> I have also heard of cases where optical endstops were false-triggering due to ambient light. It was mostly in the context of K40 lasers, but I can imagine it happening on any system. At any rate, this sounds like a hardware problem.
it is not ambient light already tried shielding light off same result
#6 – Ams-Laser 于 2025-02-05
> The only other suggestion I have is to make sure that the pulloff is far enough to completely clear the optical path. tried upto 25mm pulloff same thing happens, lokks like al the instant it gets triggered it stays in a third state like floatong even the debug output keeps oscilating between 0 and 1 and that makes fluidnc non responsive to any other command
#7 – MitchBradley 于 2025-02-05
Sounds like the signal is noisy for some reason. Check the grounds, and put a scope on the signal to see what it looks like.
#8 – Ams-Laser 于 2025-02-24
Hello, it looks like it IS a bounce issue, tested with GRBL-hal firmware and the homming problem goes away,
please help
Ed
#9 – MitchBradley 于 2025-02-24
I would need to see scope traces to understand the nature of the bounce.
#10 – Ams-Laser 于 2025-02-24
i will need to get a scope, it will take me some time, BTW this can be fixed if you continue for 2 or 3 steps more after detecting the limit
so the optical endstop does not stop on a “floating level”
ed
#11 – MitchBradley 于 2025-02-24
Continuing after detecting the limit is sort of a troublesome tradeoff. Continuing past a limit would be very bad for some types of sensors. And how do you decide how much farther to go? The coding would be pretty difficult. I went to quite a bit of effort to ensure rapid response to events.
I suppose that it would be possible to add a configurable detection delay to gpio pins, but the though of documenting it and explaining it to new users makes me sick to my stomach.
#12 – MitchBradley 于 2025-02-24
This is the sort of problem that is handled by hysteresis in well-designed sensors. Their on threshold is slightly higher than their off threshold, so once it reports on, it stays on until you back off a little before the on point.
#13 – Ams-Laser 于 2025-02-24
im using very common optical endstops from china, i managed to do a hardware fix on the laser endstops on my other machines by making sure the flag enters straight into the sensor , this reduced but not ended the problem, i still have to turn off on the machine on some homming runs, however this embroidery machine has the optical flags on a circular wheel so it is impossible to make the flag go in straight since its coming in at an angle it seems to me that it causes an analog or slow ramp output on the sensor output, this makes the movement to stop on a critical value that is oscilating just enough to hang the mcu
i will see if i can have the scope measurements asap
thanks
Ed
#14 – MitchBradley 于 2025-02-24
There is probably not a lot I can do to fix this in the short term. A robust fix will take time and risks introducing other problems, so it will have to be done very carefully. I have too much on my plate at the moment.
#15 – MitchBradley 于 2025-02-25
One possible hardware solution would be to interpose a schmitt trigger circuit between the endstop and the tinybee input. Some MCUs have hysteresis on their GPIO inputs, and some input modules have schmitt triggers sensing circuits, but ESP32 does not have GPIO hysteresis, and I think that Tinybee has only rudimentary signal conditioning on its inputs.
74HC14 is a suitable Schmitt Trigger part, and you can also configure a 555 timer as a Schmitt trigger.
#16 – Ams-Laser 于 2025-02-25
> One possible hardware solution would be to interpose a schmitt trigger circuit between the endstop and the tinybee input. Some MCUs have hysteresis on their GPIO inputs, and some input modules have schmitt triggers sensing circuits, but ESP32 does not have GPIO hysteresis, and I think that Tinybee has only rudimentary signal conditioning on its inputs.
>
> 74HC14 is a suitable Schmitt Trigger part, and you can also configure a 555 timer as a Schmitt trigger.
will go the 74hc14 way, will let you know how it goes,
Thanks
Ed
#17 – MitchBradley 于 2025-02-25
It just occurred to me that going faster might help, so there is a little mechanical overshoot.
#18 – MitchBradley 于 2025-02-25
I though of an easy way to make a mechanical bistable device. You need an L-shaped piece that pivots at the corner. when a rod pushes the upward leg of the L, it falls into the opto slot and blocks the light, and the leg that used to be horizontal is now vertical, so when the rod retracts, it pulls the L back into its original position. It should be easy to 3d print something like that.
#19 – Ams-Laser 于 2025-02-25
> It just occurred to me that going faster might help, so there is a little mechanical overshoot.
this might be of help, i will now give a try
thanks
Ed
#20 – Ams-Laser 于 2025-02-25
> I though of an easy way to make a mechanical bistable device. You need an L-shaped piece that pivots at the corner. when a rod pushes the upward leg of the L, it falls into the opto slot and blocks the light, and the leg that used to be horizontal is now vertical, so when the rod retracts, it pulls the L back into its original position. It should be easy to 3d print something like that.
i dont quite catch the idea
#21 – Ams-Laser 于 2025-02-25
Hello
im happy it now works every time
the solution was not only the speed but the settle ms value
feedmmper_min: 6000
seekmmper_min: 6000
settle_ms: 5
previously i had:
feedmmper_min: 1500
seekmmper_min: 1500
settle_ms: 500
seek_scaler: 1.1
feed_scaler: 1.1
going back to 1500 speed to see if it was the settle ms value
thanks
Ed
#22 – Ams-Laser 于 2025-02-25
@MitchBradley i dont want to open a issue for just this question, does “M66 P1 L1 Q30” can work in fluidnc now ?
#23 – MitchBradley 于 2025-02-25
Only immediate mode (L0). That will store the value in a numbered parameter and you can loop on that in a macro.
#24 – MitchBradley 于 2025-02-25
This is probably moot now but here is the idea for a mechanism. The small push rod is connected to the moving axis. It pushes on the L-shaped piece until it falls into the opto slot. Then when it retracts, it restores the L piece to its original position. The geometry could be adjusted to achieve the desired dynamics.
!Image
#25 – Ams-Laser 于 2025-02-25
> Only immediate mode (L0). That will store the value in a numbered parameter and you can loop on that in a macro.
i will try sending a feed hold and making the cycle start button the user input, hope it works
#26 – Ams-Laser 于 2025-02-25
got it working
Thanks
#1 – MitchBradley 于 2025-02-05
Why do you have :pd on the limit pins? pulldown is only useful for switches that connect to V+, not to GND. The pulldown will fight with the pullup and reduce the noise margin.