-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ruida: various driver bug fixes and improvments (#197)
* Ruida: use sweep mode for engraving The ruida controller supports multiple movement modes. These can be set using the 0xCA01 and 0xCA41 commands. There are two types of movement modes: regular and sweep. Both types have seperate hardware settings for acceleration. The regular mode (0x0) is used for regular cuts. The sweeping modes are used for engraving: - (0x1) bidirectional x-sweep - (0x2) unidirectional x-sweep - (0x?) unidirectional y-sweep - (0x?) bidirectional y-sweep The controller automatically adds appropriately sized padding on both sides, so the padding code generation of LibLaserCut is removed entirely. The sweeping modes only support straight moves. However, due to the imprecision of relative moves, slightly skewed raster lines might occur, which cause the controller to do the padding moves twice (first to reach the relative offset, and then again to reach the same height as the destination). Work around this issue by only generating absolute moves. The movement mode is set using the 0xCA01 command. The vendor software also sets the movement mode via 0xCA41 for every layer, without any obvious effect on the controllers behavior. To keep the machine code as close to the vendors software as possible, generate 0xCA41 as well. Annoyingly, the mode ids are swapped for 0xCA41. * Ruida: fix 0xC902 speed conversion The speed value for 0xC902 has to be given in µm/s as a 32 bit integer. Use absoluteMM() to scale the internal speed value by a factor of 1000. * Ruida: calculate speed percentage from maximum cutting speed Fixes: #190 * Ruida: round instead of flooring * Rudia: remove unnecessary array stop command The 0xEB command is used to end an array opened with the 0xEA command, but the array feature of the Ruida controller is currently not utilized by LibLaserCut at all. Therefore, remove the unnecessary and probably wrong array stop command. * Ruida: fix layer property code generation Previously only the first layer properly generated the layer property code, due to missing resets of layer-specific variables. Reset the layer-specific variables after every layer. Fixes: #194 * Ruida: force first movement When the machine code is generated, the initial position of the laser is unknown. The initial state of the hardware might differ from [0,0]. Even worse: the instantiation of the driver is reused across multiple laser runs, so the driver retains the position of the last movement, but the controller might move to a different position after execution has finished. Instead of assuming a laser position, always force the generation of machine code for the first movement by setting last_xy to NaN and adding code to handle moves from an unknown position. Fixes: #189 * Ruida: add missing reset of instance variables vector_count and travel_distance should only count a single run, but the instance of the driver is reused. Therefore, both variables are reset when a new machine code generation is started.
- Loading branch information
Showing
2 changed files
with
48 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters