Denvi / Candle

GRBL controller application with G-Code visualizer written in Qt.
GNU General Public License v3.0
1.37k stars 548 forks source link

Problem with resetting COM port! #255

Open Jodank opened 5 years ago

Jodank commented 5 years ago

Hi! I have a strange situation. When I open a file for working with, and I start to calibrate my cnc coordinates, unpredictable the machine just resets the COM port. I'm hearing a small "tick" on the motors and the actual XYZ coordinates are reset to 0 and so I lose the coordinates I set.

This issue is not happening until the CNC is milling, engraving, or whatever...

What can happen here? Any idea? Thanks.

Jodank commented 5 years ago

Very interesting, I restarted my PC and now is everything fine. Does anybody have such a situation in the paste?

ondras12345 commented 5 years ago

Check your wiring. There could be some inductions from the motor signals and/or the spindle power. I had to disable hard limits on my machine because they were stopping the milling process. It could be some induction from the wiring to the controller's board. What is your controller board? You could try adding a capacitor between 5v and GND (eg. 10uF - 47uF). This situation could also be caused by vibrations. Try checking the connectors and solder joints - there could be a cold solder joint.

Jodank commented 5 years ago

I think this kind of end switching think is really bad. I was trying with caps but didn't solved the problem as expected. It was unpredictable when it would be triggered.

For now I didn't use this function on my cnc, maybe I will build a debouncing circuit and then I will give it a try.

My suggestion is to make a hardware switch debouncing circuit and then use it with the controller. I think this would be a nice IC to solve the problem really: https://datasheets.maximintegrated.com/en/ds/1896.pdf

My best regards.

On Wed, Jan 2, 2019 at 5:28 PM ondras12345 notifications@github.com wrote:

Check your wiring. There could be some inductions from the motor signals and/or the spindle power. I had to disable hard limits on my machine because they were stopping the milling process. It could be some induction from the wiring to the controller's board. What is your controller board? You could try adding a capacitor between 5v and GND (eg. 10uF - 47uF). This situation could also be caused by vibrations. Try checking the connectors and solder joints - there could be a cold solder joint.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Denvi/Candle/issues/255#issuecomment-450910633, or mute the thread https://github.com/notifications/unsubscribe-auth/AqRWs6mvxhQ1U1EpLzC6NKAabWJGbJpAks5u_N4WgaJpZM4YYmxN .

ondras12345 commented 5 years ago

For hardware debounce, I like to use 74HC14 hex schmidt inverter, a capacitor and resistor. It's hysteresis prevents the output state changes when the voltage of the cap hits the threshold. (For testing, you can use the classic 555 timer IC with the trig and threshold pins connected instead of the inverter). I tested the circuit with the CNC, but it didn't solve the problem (induction or vibrations or whatewer else). The circuit is described here. https://hackaday.com/2015/12/09/embed-with-elliot-debounce-your-noisy-buttons-part-i/ image

I also tried to use an PC817 optocoupler instead, as suggested here https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches, but it didn't help with the debounce.

Jodank commented 5 years ago

Opto can't do the job but the ne555 maybe but the 74HC14 will do the trick. But don't was your time, if you can order the mentioned debouncing ic and finish your job and enjoy the result.

My best regards.

On Wed, Jan 2, 2019 at 7:24 PM ondras12345 notifications@github.com wrote:

For hardware debounce, I like to use 74HC14 hex schmidt inverter, a capacitor and resistor. It's hysteresis prevents the output state changes when the voltage of the cap hits the threshold. (For testing, you can use the classic 555 timer IC with the trig and threshold pins connected instead of the inverter). I tested the circuit with the CNC, but it didn't solve the problem (induction or vibrations or whatewer else). The circuit is described here. https://hackaday.com/2015/12/09/embed-with-elliot-debounce-your-noisy-buttons-part-i/ [image: image] https://user-images.githubusercontent.com/44524735/50605751-91db7100-0ec3-11e9-9163-95cf936f84dc.png

I also tried to use an PC817 optocoupler instead, as suggested here https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches, but it didn't help with the debounce.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Denvi/Candle/issues/255#issuecomment-450941993, or mute the thread https://github.com/notifications/unsubscribe-auth/AqRWs6AZ0VJqKFVyl9T9QqQm8m0ek0U6ks5u_PlfgaJpZM4YYmxN .

ondras12345 commented 5 years ago

I found my old logic analyzer measurement. image CH0 = button CH1 = schidt inverter (I think I used the 555 timer alternative) CH2 = optocoupler

ondras12345 commented 5 years ago

I tried the optocoupler method because it was suggested in the wiring limit switches tutorial. The 555 timer forms a schmidt inverter with thresholds in 1/3 and 2/3 of the supply voltage. It works without problems.

ondras12345 commented 5 years ago

When I open a file for working with, and I start to calibrate my cnc coordinates, unpredictable the machine just resets the COM port. I'm hearing a small "tick" on the motors and the actual XYZ coordinates are reset to 0 and so I lose the coordinates I set.

The hard limits should not cause this behaviour. I guess the ATmega is resetting because of BOD (brown-out detection), or the reset pin being pulled low (you can capture that using an digital oscilloscope).

ondras12345 commented 5 years ago

For example the woodpecker controller board I have has both reset and 5v pins on the main header, so you can probe it easily. More info about the pinout here https://github.com/gnea/grbl/issues/123. image