Replies: 31 comments 70 replies
-
Link to specification? This could be implemented as a plugin that expands these blocks back into standard gcode as the purpose of this compression is mainly to overcome serial port bandwith limitations? FYI I have managed to push the iMXRT1062 driver to > 70.000 mm/min by tuning the planner buffer size. Its native USB CDT transfer speed is > 400kb/s so way beyond the more common 10kb/s that most older board uses. |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio there is no specification as such, but this has been enabled for Smoothie 3 years ago. I've probably done more testing for speed than anyone, iMXRT is so fast it does not need cluster, but is too expensive. Realistically Teensy 4.1 can go up to 40kmm/min for high resolution with a properly tuned planner. For instance at 30kmm/min it takes 8:15 through USB and 7:49 through SD for 423dpi greyscale, 10kmm/s/s xy accel, 100x100mm. Teensy is more than fast enough and not the motivation. Realistically most motors tap out at lower speeds. But we definitely need the 4x performance boost for ESP32 which has all the bells and whistles, but lacks true Teensy like speeds and even 20kmm/min would be excellent. Realistically for 423dpi less than 5kmm/min is achievable with a well tuned ESP32 without cluster. |
Beta Was this translation helpful? Give feedback.
-
@terjeio this looks very promising. For a deep greyscale which means almost no S0's it cuts engraving time by almost 50% Cluster (20MB) file) Check Mode on ESP32 - 6:44 Doing more testing today. |
Beta Was this translation helpful? Give feedback.
-
@terjeio unfortunately something is not working correctly. The X movements are incorrect as the engraving is 100x100mm with 7.5mm overscan, and offset by 50x50mm X,Y. So X travel range should be 42.5 to 100.75mm. In cluster mode it moves to X >300mm. If fixed this could improve the engraving time. Secondly, the Spindle Enable pin is behaving sporadically. In Laser mode I believe that the spindle enable should turn on with M4 and off with M5 only. Even a S0 or misinterpreted gCode should not disable the spindle. This may be an issue with non-cluster, but cluster makes it more apparent. |
Beta Was this translation helpful? Give feedback.
-
@terjeio excellent on fixing the issue with M4, I am doing more testing. I updated but now finding that WebUI has only ESP file upload and Terminal. It lacks jog controls, SD controls and other things. Is there something simple I'm missing? |
Beta Was this translation helpful? Give feedback.
-
ok, happy to report further testing I found the issue with crashing and not finishing processing was a corrupt SD card. 40kmm/min and 10kmm/s/s settings for a 100x100mm at 423dpi. I hope Cluster USB speeds are close to Cluster SD. It is possible to enable a test version so I can compare. The |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio, yes 50 minutes streaming through USB (I edited the comment). There seems to be true benefit to speed to this work. |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio it looks great! |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio I just found out Lightburn will be using up to CLUSTER:16. |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio attached is real Cluster 16 gCode. Using VER:1.1f.20220922 and my_plugin.c It is working great when streaming through SD card but trying to stream this code through USB using Lightburn causes USB to lose connection. I cannot lead the code through IO sender because it barks at me for every line. The code is actually 1/10 of the original code so when running through SD it takes a little less than 2 minutes which means the full code runs in less than 20minutes (compared to just under 40 minutes with non-Cluster). Also Lightburn looks for [CLUSTER:16], not {CLUSTERS:16] Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio I am using ESP32 I am testing to see if this is a latency issue introduced by faster gCode processing. I have been using 40kmm/min max velocity and 10kmm/s/s for max accel in all testing, but obviously not achieving that max velocity VER:1.1f.20220922 and my_plugin.c
VER:1.1f.20220925 with lb_clusters.c OPTION(Laser "Use LB Laser Clustering" ON) CMakeLists.txt |
Beta Was this translation helpful? Give feedback.
-
Ok, to be pendantic: this driver does not have native USB support - it uses UART via a USB <> UART converter chip.
"Connection lost" means what? The ESP32 has crashed or the USB <> UART chip has crashed? The latter sometimes happens for me when I connect through a USB hub - I have to unplug the USB cable to reset, pressing the controller reset button does not fix it. Your test program runs via Candle on my ESP32 and STM32F7xx boards with no issues, but with more sensible settings? 250 steps/mm, 15000 mm/min max speed and 3000 mm/sec^2 accel. BTW have you calculated the max step rate and set $0 accordingly? The default 10 microseconds will only work up to approx. 80KHz. I'll commit an update with a fixed CMakeLists.txt and the laser submodule added a little later. |
Beta Was this translation helpful? Give feedback.
-
@terjeio which H7 are you using, the Mini (H7B0) at 280MHz or the Core (H750) at 480MHz? Does it work with BT and WebUI? |
Beta Was this translation helpful? Give feedback.
-
FYI Little bit info from LB staffhttps://forum.lightburnsoftware.com/t/cluster-mode-for-grblhal/77711 Cluster for Grbl: Cluster on G code devices has also been set up to allow up to 16 brightness values per cluster, and it looks for [CLUSTER:xx] as a response to the $I command. If it sees that response, it pulls the number out of the argument there, and uses that as the cluster size, clamped to be a value between 1 and 16. |
Beta Was this translation helpful? Give feedback.
-
@terjeio and @dresco , first of all, thank you for all of the hard work you do! I'm interested in knowing how long it takes to execute the cluster code on WeAct MiniSTM32H743. Looks like that has 2MB ROM versus the WeAct MiniSTM32H750 which has only 128KB ROM (I think grblHAL is about 64KB) and 743 is no longer available. I will see how fast it will run on Teensy 4.1. |
Beta Was this translation helpful? Give feedback.
-
@dresco awesome. This is exactly the mapping I was looking for. As I looked at the schematics there are a few things that are allocated, but not used unless you install peripherals. I'll want to add a 4th axis. Contact me through email... my username [email protected] so I can know where to ship a prototype to you if you're interested. I usually wire a prototype into an existing board, but this looks mature enough to start layout. I tend to design for lasers with common enable pin for all motors other minor simplifications, but I've got a good power system, transceivers for outputs and optocouplers for inputs, so I may try to keep it generic for even CNC for not. As far as used pins, I understand your point, but oddly the chip alone costs more than the dev board with chip installed at least the way you or I would purchase it (small quantities). I see enough spare pins to be more than enough for 6 axes and all grbl functions and TMC UART. Can PA9, PA10 be used for bluetooth? WebUI would be nice to have to upload to SD. Anything wireless would be the icing on the cake. Just an idea :) |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio for some reason IO Sender can run the cluster gCode pefectly but I cannot run cluster from Lightburn using ESP32 Wroom with the Silabs 2102 USB to UART. Non-Cluster code works great, cluster code loses USB connection. Did you add any flow control with the Oct 9 build? |
Beta Was this translation helpful? Give feedback.
-
@terjeio, yes the 2102 crashes and needs a power cycle. I am not connecting through a USB hub, but I will check with a different power supply setup. |
Beta Was this translation helpful? Give feedback.
-
@terjeio and @dresco I just tried with the STMH750 and same behavior... it looses connection in Lightburn. Runs great through IO sender and SD card. I am also reaching out to the Lightburn developers. BTW, great job on STMH7 @dresco! If we can figure out a way with @terjeio's help to bridge WiFi it would be the complete package. The WiFi bridge may need dedicated pins for Tx & Rx it is listening for data. |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio. I'm still testing trying to determine why the ESP32 crashes in Lightburn. As part of the testing I had to develop a test to see if data was being lost. As far as I can tell for non-Cluster all the data is being read properly. But there seems to be an issue with float precision. This is relative code and most of the movements are in the same direction to see if errors accumulate. This code at the end of engraving should return exactly to 0,0. But instead returns to 0.413,0. This is true for SP32 and STM32H7. I also modified the gCode so that the S values proceed the movements, This placed the movements at the end of each line to see if data is being lost as losing a digit of a S value is not as apparent as a loss of a digit for movement. As far as I can tell there is no lost digits and the issue is precision. Please run this code and you'll see the finish position is 0.413,0 instead of 0,0. Also Lightburn gCode uses 3 digits and it does require the 3rd digit to move correctly. For instance a scan gap of 0.06mm with Cluster16 would look like this. These 2 issues do not fix the Cluster issue as I've been trying to debug this for the past 3 weeks and still looking. |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio. The gCode I uploaded is a little bit modified by me by mistake but in fact it does return to zero due to an extra movement I added at then end. I wrote a python program that confirms return to zero is enable by the gCode. I do my best to filter out my mistakes before reporting to you. The good news is that the adjustments to cluster.c eliminated the accuracy introduced by cluster but there is still 0.3mm error at the end of the engraving which is now the exact same amount for both cluster and non-cluster in IOSender. Still Lightburn streaming does not work for both ESP32 and STM32H7. Can you please download a 30day demo from here to test on your end. If you contact me though the gmail address I sent @dresco above I will pay for a License key for you. It's the least I can do for all of your help. @dresco. I don't know how much testing you've done on the STM32H7, but today I built an adapter that enabled me to pug into my existing 4 axis design and it works great! Limits and homing works, 4 axes all moving as they should . I completed an engraving today and movement is accurate and PWM looks very clean. Pause/Resume/Stop do what they should. I did not test probe or safety, but I did test Mist with a relay. I also did not test UART. It's quite fast and frankly quite adequate. I did see one issue but I did not get a chance to see if it is a core grblHAL issue or a driver issue. But when any stepper is active all steppers are locked. I don't believe that is the intended behavior. If STEPPERS_ENABLE_PORT and STEPPERS_ENABLE_PIN is defined then it make sense that any single active stepper will lock all steppers. However even when I define individual enable pins for each motor, anytime I have an active stepper, all steppers are locked. You guys are awesome!!! Thank you! |
Beta Was this translation helpful? Give feedback.
-
@dresco I will email you. Almost done with adapter board. It won't have all the features due to limitations with my current base board, but I am working on UART and will enable a WIFI module for development. I previously had issues with addressing using UART (single pin for all drivers) and due to time constraint had to drop it. Due to available IO on STM32H7 I will be using your proposed UART pins. @terjeio I finally figured it out!!! Cluster processing is sending an OK response after the first Svalue. This is expected behavior. But then a second OK response after the second SValue for the same line and only 2 OK responses per line. Due to the way Lighburn sends, each OK response from the controller triggers more sending from Lightburn. However if the other Svalues are still being processed by the controller and the controller is not ready for a new line a pile up occurs. This is probably so simple thing for you to fix. Thank you!! |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio, I've been tracking down theses issues for a while. Any engraving in Lightburn that uses Start from: Current Position will use relative coordinates. The Lightburn developers track 3 digits (not traditional 2). In prior versions of LB they only used 2 digits but added the 3rd to eliminate banding. Most people don't understand stepper movement and magic numbers (don't get me started). Any image not perfectly aligned to a grid based on the line interval will require this treatment. So it happens most of the time. In the function you pointed out should I experiment with changing if c<=9 to c<=11 or adjust MAX_INT_DIGITS in nuts_bolts.c? Attached is typical gCode, Unidirectional to highlight the precision and a utility script I wrote that will track relative movement you can adjust the number of digits between 2 and 3 in the function call. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio, during testing 2209 UART on STM32H7 I am finding some bugs with both H7 and ESP32. The implementation is different as H7 uses a single pin per axis (thanks for the tip @dresco) and ESP32 uses addressing with single pin for each driver and 2 pin UART on the controller end. I tried defining only a RX pin for ESP32 and it did compile but would not communicate to the 2209s. Here's the ESP32 implementation... In addition to the settings in CMakeLists.txt, ESP32 I added the board to trinamic_if.c and added these lines to map file For ESP32, it seems M122 is only reading from the x-axis driver for microsteps. For instance if you all axes set to default of 16 microsteps, if you set $150 to 8. All axes will report 8 microsteps with the M122 command. Also I believe the axes are not just reporting the same microsteppering as X, but also physically using the same microstepping as X based on movement. The H7 reports separate microsteps for each driver according to 15x setting as it should. I don't know if this is related to the addressing used only on the ESP32 or perhaps how the $ values are setting the driver. For both ESP32 and H7 at any time I can unplug PDN_UART from any axis and M122 will continue to report for all axes (as if the axis is still connected). However M122i will indicate it cannot communicate with the stepper. Also @dresco indicated to me that he can read realtime stallguard readings from each axis, so I'll experiment a little more with the debug output especially M122 X S1 and so on. I believe these ESP32 addressing were issues were part of what I was reporting near the end of this issue grblHAL/ESP32#33 Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio, yes it was 2209 addressing that was causing the problem on the ESP32 device. I have not started testing H7 yet. Also stallguard slow threshold (sgst) does not seem to be read even with $339 set. In the case below $339 is set to 1 Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio I will try IO sender. I'm expecting a lot of tuning work is needed. When using debug M122 X S1, SG value while moving with no resistance on the motor is >350. Moving with resistance on the motor several times the SG value goes below the threshold and the limit is not triggered. I'll verify with a scope the diag pin output. |
Beta Was this translation helpful? Give feedback.
-
Not a concern, I'm using single pin limit per diag pin. |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio, I set $5 to zero, set $26 to 0. $338 and $339 are both set to 15 (xyza axes). M122 does not read a SG threshold. $200-$203 and $220-$223 are both set to 22. I also verified that the diag pin does not go high when SG result is higher than SG threshold. Please note that in my comment 2 days ago SG threshold was set and I don't know why it can't be set now. I found the same behavior for STM32H7 and ESP32. M122 |
Beta Was this translation helpful? Give feedback.
-
Hi @terjeio it seems STM32H7 and ESP32 have the same response. Hard limits ($21=1) will not trigger either NO ($5=15) pulling limit pins to ground and will not trigger NC ($5=0) pulling limit pins to 3.3V or 5V. In all cases $18 is set appropriately. The above code was added and did not change the results for ESP32. I will test for STM32H7. Update: STM32H7 does not trigger hard limits either. Homing works on both ESP and STM. Further Update STM32F1xx does not trigger hard limits, but with earlier builds hard limits are triggered. "Earlier builds" I only went back to GRBL_VERSION_BUILD "20210604" for the STM32F103 and did not have any more recent versions to test. So hard limits stopped working sometime between June 2021 and current. |
Beta Was this translation helpful? Give feedback.
-
I realize I'm late to the party here, but I'm the LightBurn developer who came up with clustered GCode, originally to get around the speed limits of Smoothieware's CPU constraints. I don't have a specification, but I could write something up relatively quickly if you think it would be useful for you, and feel free to ask me questions if you have any. |
Beta Was this translation helpful? Give feedback.
-
@terjeio any possibility to support cluster mode?
Lightburn has enabled cluster mode starting with version 1.2.02.
This eliminates issues with slow planner and allows rastering >20,000mm/min greyscale with smaller dot size which is likely 4x improvement.
Additional motivation is that lasers are now using compressed beams enabling smaller dot size and higher resolution.
The implementation is as follows...
S values for each dot colon delimited up tp 8 values per line.
In this case a Svalue is given for every dot at 0.06mm spacing.
G1 Y-0.48S0.875:0:0:0:0.875:0:0:0.875
G1 Y-0.18S0:0:0.875
G1 Y-0.24S0:0:0:0.875
I can test for you.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions