FluidNC LED Musings

Can you flash firmware via USB with that?

I’m sure it works fine but the WLED discord seems not fond of that brand but like you said with a small number of LEDs, it probably doesn’t matter.

I was also looking at this similar one which can be flashed via USB.

I seem to be headed down that same path.

1 Like

We might be getting enough snow tomorrow where I would need/want my snowblower. So, that was motivation to finish getting that ready. This means I had my propane heater going in my garage which meant it was warm enough for me to play with LEDs some more.

It’s a little hard to see but it tracks the position fairly well. It’s a bit off at high feedrates. Not sure if I want to play with the reporting rate or offset based on feedrate. I do plan on changing the config for the position width to be number of LEDs instead of mm.

That’s about as far as I plan on going with this for now. At least until I talk my wife into letting me make that wall mounted pen plotter and put it in the house. That’s a work in progress.

9 Likes

Dang that is cool!

So if you jog in Y it still happens right, the light just stays in one place? I am making super slow progress on my full sheeter, that thing is going to need some lights for sure. I can’t wait to try this.

3 Likes

Yep, it’s only looking at the X position.

2 Likes

If anyone wants to try this, I pushed up my changes to the usermod-fluidnc branch in my fork. I’m sure I’ll be making some tweaks, but it’s functional.

If you’ve never played with WLED before, you should probably try it out with a standard build before going down this path. There’s a lot to WLED but it’s super fun.

If you’ve compiled FluidNC yourself before, this works the same way using PlatformIO. There are some extra steps for the web portion (like installing Node JS). More details are here:
https://kno.wled.ge/advanced/compiling-wled/

I just added a platform_override.ini file with these contents:

[platformio]
default_envs = esp32dev_fluidnc

[env:esp32dev_fluidnc]
extends = env:esp32dev
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_FluidNC\"
  ${esp32.AR_build_flags}
  -D USERMOD_FLUIDNC

I’m not entirely sure how to apply this otherwise yet. This is on the latest unreleased 0.16 version. If anyone has suggestions, I can try it. This is why I’m hoping to get this added to the official codebase at some point so this can be simplified a bit. I can provide firmware builds if that helps, but I’m not sure what to do with them.

Once it’s installed and WLED is running, you’ll need to set the rest up. I’m certain I’m missing parts here. WLED is super configurable but that means there’s a bit to setup.

Configuration

In the WLED app, under Config menu:

WiFi Setup

Update the settings to connect to the same network as FluidNC.

LED Preferences

Under Hardware setup, setup your strip with the appropriate settings and number of LEDs. These values will differ depending on the controller and strip you are using.

Usermods → FluidNC

  • Enabled - Checkbox to enable the usermod.
  • FluidNC URL - The URL/IP address of the FluidNC controller. I’m currently using an IP address. Originally, I couldn’t get it to work with fluidnc.local and I haven’t tried since.
  • FluidNC Port - The TCP/Telnet port of the FluidNC controller (typically 23).
  • CNC X Width Mm - Usable X width in mm of the CNC machine. Mine is 875.
  • CNC X Position LED Width - Number of LEDs to overlay the position. Use an odd number. I have it set to 5 which on a 60 LED/m strip is about the width of the bottom of the LR3 core.
  • CNC X Position Offset Mm - Offset in mm from the leftmost LED to the endmill. This is hard to measure. It’s easiest to set the position LED width above to 1, and adjust until it looks right. Mine is set to 60.
  • CNC X Position Reverse - Checkbox if the LED strip starts at the max X position. I have this checked because my strip starts at X max.
  • LED Strip Length Mm - Length in mm of the LED strip from the middle of first LED to middle of last LED. I have a 1 meter strip but this measures 973mm.

Presets

Create presets with the following IDs for each state. You can play around with what effect you like. I have some crazy effects right now, because I can.

  1. Idle
  2. Home
  3. Alarm
  4. Hold - I’m using the Breathe effect to blink between yellow and black. This is red would be good for Alarm as well.
  5. Run
  6. Jog
  7. Unknown

Note that if the effects are moving in the wrong direction (like if the effect moves in the opposite direction when homing X), you can check the “Reverse direction” checkbox in the Segment configuration.

If anyone has any questions or suggestions, let me know.

9 Likes

How cool, great job. Hope this get rolled into standard wled somehow

Once I’m confident there are no issues and I’m not tweaking, I’ll submit a PR and see what happens. That will be a bit though. Since it’s a usermod, it will still require a custom compile but they have tools for doing that on a website.

I’m sure this is an incredibly dumb GitHub question. When I clone that repository, I don’t get the FluidNC usermod in the appropriate folder. When I download the ZIP I do get the user mod. Am I doing something wrong with the clone?

When you clone a repo, it’s probably checking out the main branch by default. You likely just need to checkout the usermod-fluidnc branch.

1 Like

Thanks very much. It was indeed the case. I found a way to checkout the right branch. However, now I don’t have a html_ui.h in wled00 so I’m failing. Apparently it’s related to the wled_server.cpp.

image

Might need to come back to it tomorrow. This work is super cool. Thanks for sharing.

1 Like

I figured this one out, and it may be a Mac thing. I had just updated Node.js for a separate project. But I needed to run npm install inside the terminal of VSCode. My guess is the path wasn’t there for my repo.

Thank you so much for sharing this! I got it working today on my machine, with our home-engineered controller and my SK6812s. Its awesome.

I did get the follow working, but it doesn’t track perfectly. I suspect it’s due to my haphazard cut LED strip. Although I did end up with a CNC X Position Offset Mm of -170 to have the lights anywhere near the bottom of the core.

I’ll do a more careful install when I have my permanent strut cut (finally). But I just wanted to thank you for sharing all this work.

3 Likes

Adding a reminder to myself to update my usermod to support the latest WLED changes.

I hope to mess with this again soon.

3 Likes