MetalWorkerTools / grbl-L-Mega

An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on an Arduino Mega2560. Forked from GRBL modified for use on a lathe with spindle sync threading
https://github.com/MetalWorkerTools/grbl-L-Mega/wiki
Other
15 stars 9 forks source link

lcd dro+ sdcard+ keypad =autonomous lathe #4

Closed how-eee closed 2 years ago

how-eee commented 3 years ago

Almost finish combining this project with https://github.com/bdurbrow/grbl-Mega Everything is working on the table. Here is what I have for the moment https://youtu.be/N7hlYoIhV2g Here you can see what parts it consist of https://youtu.be/8M4gzLkSXls

Feel free to comment and ask if you have something. If you want to be betatester I'll appreciate your help.

photo_2021-03-30_07-54-57

HuubBuis commented 3 years ago

I have seen the video's and it is looking good. Place a link to the video's in your text so others can benefit.

I think the way you made your encoder (big red knob) is also usable for a spindle encoder.

Good work

I hope to see a video testing on a lathe soon.

how-eee commented 3 years ago

Have tried it on lathe. It has so many issues. Sad (

I am very disappointed. Understood that cant figure out it all by myself only. Need help of someone who did it many times...

Here is short video in the begining of testing, so no any issue is on video. https://youtu.be/dcXR74F-ByY When time permit I'll shoot video with my issues. Thanks

HuubBuis commented 3 years ago

I am very disappointed.

Developing software and hardware isn't easy. It takes a lot of effort to get things working. Solve problems one at a time until they are all done.

Interference and electrical noises inducted in all lines. So many

To avoid interference:

Grounded lathe base

Make sure all parts are grounded at one point (star ground) to avoid ground loops through the control cables. Keep the sensitive logic signals far away from the high voltage/current cables.

Limit switches. I solder NC mechanical switshes with pullup 5kohm to +5 and 0.1mF (104) capasitor to ground.

You can use 1k pullups on the input, works just a bit better

But XZ pins still triggered regardless their switch position. You should connect unused inputs to GND (NC) or +5V (NO)

it cuts too deep. display dro shows x=13mm, but actual position is x=13.5 for example

Try first to get normal turning and facing working. Then move on to threading. You could usage a caliper on the lathe to check the repeatability of the positioning.

HuubBuis commented 3 years ago

There is also a grbl compiler option to reduce noise GRBL-L-Mega WiKi, the chapter Changed Compiler options:

in file config.h Electrical interference caused by powering the lathe on and off (starting the spindle motor), can trigger the limit switches. By enabling GRBL software debounce, false triggers can be prevented.

define ENABLE_SOFTWARE_DEBOUNCE // Default disabled. Uncomment to enable

how-eee commented 3 years ago

try first to get normal turning and facing This lathe worked good enoth with plain arduino uno and clean grbl via usb. No any issues was detected. NO any backlash also.

I will check one more time all that items you pointed to. Thanks for the help.

HuubBuis commented 3 years ago

This lathe worked good enoth with plain arduino uno and clean grbl via usb

This is very good to hear. First try the setup that has proved to be working OK. If it still is working OK, than you must be able to get your software working. The procedure to follow is to start by using the good working code and implement your changes one by one. Test after every change if it is still working OK.

Enabling debouncing was the only way I could get may larger lathe working stable. It is worth to try first!!!

how-eee commented 3 years ago

Main problems was solved/

how-eee commented 3 years ago

Noticed that sd_detect (port L0) pin on same port as CTR_Door(L6) CTR_FeedHLD(L4) CTR_reset(L2). Maybe here is problem somewhere...

HuubBuis commented 3 years ago

Now it has 1/8steps and only 320 steps/mm

320 steps/mm is enough for decent turning.

State_alarm is still active after homind with menu. Cant find reason.

Homing on a lathe is normally 2 axis. Grbl defaults to 3 axis. You should set the homing sequence for a lathe: https://github.com/MetalWorkerTools/grbl-L-Mega/wiki/Changed-Compiler-options

It is important that grbl is in an error free state before sending commands. I sometimes use UGS (platform version) for diagnostics. The output window can be set to verbose (right mouse button) so you can see all errors reported by grbl. It also shows the pin states that makes it easier to identify pins that are in an alarm or active state.

Depending on homing settings in config.h grbl could require homing first before running any commands.

I have no experience in using a sd card on grbl controllers.

how-eee commented 3 years ago

I have created repository with a project here on github. https://github.com/how-eee/grbl_lathe_UI_threading

have read out almost all code. cant find difference of parsing $H sended via usb and via lcd menu. But via lcd menu I have alarm in the end of homing cycle, via usb all is ok.

HuubBuis commented 3 years ago

have read out almost all code. cant find difference of parsing $H sended via usb and via lcd menu. But via lcd menu I have alarm in the end of homing cycle, via usb all is ok

I remember I had such an issue using grbl_ESP32 sending commands using USB and Bluetooth was OK, using WiFi didn't work. The cause was the line termination used. cr of lf didn't work. I don't remember witch caused the problem. The solution was sending crlf.

how-eee commented 3 years ago

I have fixed almost all issues. Tested on my lathe. No any remarks at the moment. But I didnt test threading on machine yet. On the table it was good. I hope next week Ill make video with all main features demonstrated.

HuubBuis commented 3 years ago

Sounds good