axlan / K40WebServer

A webserver to allow controlling a K40 laser cutter over the network through an attached computer
MIT License
6 stars 1 forks source link

How fully featured? #1

Open tatarize opened 5 years ago

tatarize commented 5 years ago

The lower level stuff is pretty fully fleshed out, so a lot of the functionality just requires a little bit hooking up for a lot of it. As part of my due diligence I hacked together a mockup gui based a bit on Whisperer. Didn't bother to hook the stuff up.

myappy.zip

mockapi

Some of these elements are dirt easy to hook up. Like moving the laser head around with some buttons. I have similar functionality in the KeyBurn example (and really, those same keydown hooks could be used here to move the laser head position). Or the homing or rail unlocking, etc. It could even fire the laser. Though the fact you can turn the laser on and leave it sitting in one place, while turned on, indefinitely, sortof scares me.

Trace is a feature I've sort of wanted for a while, many embroidery machines let you run the needle head around the outer edge of the design (or as a rectangle the design fits in) to make sure it doesn't hit the hoop. It's part of the reason I bothered to write a Egv parser, so that you could measure the size of a given project to trace the edge.

The basic controls can be rigged up in no time (home, rail, move position, fire laser), but a lot of people want things like being able to cut a 5x5 grid of the same design or whatnot. And the way Whisperer assigns a difference between vector cut and vector engrave is pretty arbitrary, they do the same thing but at different speeds (which you yourself set, but only in a global fashion).

Not sure the best way to actually set that stuff up. Though rebuilding Whisperer in a web interface might actually be a somewhat reasonable thing to do. Making a preview image or canvas or svg canvas work would seem to be the hardest element of that. Most of the rest of the code just sends a command to the api or has something parsed or whatnot. Might be best to do something like running a command stack: go to this location, run this particular file, go to this other location, run this other file, go a third location and run the first file again, wait 40 seconds, then do this other thing. Bit like how my CLI ended up working.

Though even the thing you have now with some buttons hooked up to move the head position, or home the device would be pretty powerful.

tatarize commented 5 years ago

Figured the dirt easy controller was kinda worth hooking up. I might even put this in tools as it's not too complex and pretty cool. Not sure how your code threw the error correctly. But, you gotta click initialize for it to open the NanoPlotter. Everything else should just control the device perfectly fine.

Move the device around from the interface and hit the button to start (assuming you add a start button).

basic_controller.zip

simple_controller