lynxis / laserusb

a libusb based implementation to control chinese lasers replacing oem software (e.g. NewlyDraw)
2 stars 0 forks source link

Mapping out the commands. #1

Open tatarize opened 1 year ago

tatarize commented 1 year ago

This is some really solid work and helped slingshot passed a few hurdles reading this code for the protocol when trying to write a driver for a newlydraw device. These are fairly rare so it's progress is hard. I don't specifically own the device myself. But, I'm coding a cursory driver for it.

https://github.com/meerk40t/meerk40t/tree/newly

Commands found as stings in software: PA (HPGL), PU (HPGL), PD (HPGL), SP1 (HPGL), SP2 (HPGL), PR (HPGL), IN (HPGL), UL, DW, ZED, BT8, TO#, DA#, PL#, BC#, BD#, TX#, ZZZFile#, VS#, BT#, VQ#, VP#, CV#, WV#, WU#, WR#, VX#, VY#, VM#, VJ#, VK#, CU#, WV#, WU#, WR#, CR#, ZQ, ZT, ZG, RS, ZH#, ZK#, ZG#, YF, YZ.

Also the raster protocol involves sending YF and YZ commands followed by 00 and the bits length of the scanline and then the actual bits of the scanline (padded to the nearest full byte).

There was also a closed request for a driver on visicut. https://github.com/t-oster/VisiCut/issues/466

tatarize commented 1 year ago

I've mostly finished out most of the mapping:

https://github.com/meerk40t/meerk40t/wiki/Tech:-Newlydraw-Commands

DA doesn't activate laser, it sets the power level. DW flags the frame part of the data. GZ - this actually flags this as the data portion of the file being sent. VJ24 - VJ is actually the acceleration length rather than the acceleration. VK100 - VK actually set the current to the stepper motor for a cut. VP100 - VP sets the current to the steppers for a move. VQ15 - VQ is the corner speed. Basically the speed at which it moves from the end of one acceleration length to the next acceleration lenght. VS10 - This is actually pen speed/velocity. Though this is 100 mm/s and has some weird scaling for really low speeds. ZG1 - The starts given file. This executes file 1. ZED - Ends a section more specifically. The DW will end with ZED and the GZ will end with ZED too. If you define both the outline frame and the file in question, you'll have a ZED in the middle of the file. ZZZFile[0-9] - With the notable note that file 0 executes instantly. So realtime commands are always in file0. Whereas if you define things in a File2 you'd actually need to send a ZG2 to execute that data. Or a ZH or ZK to perform the framing part of that file you sent.