The bug is dead! It applies to all versions of driveboardapp, and if you are running your own fork you probably will want to cherry pick
my git commit with the fix.
This resolves the "image raster cuts off some 5mm at the end" note that Stefan had put into the TODO, so it's definitely long-lingering.
Surprise surprise, my last fix above only lasted a few months before I saw the issue again, and this time doing a Windows refresh had no effect. I basically resigned myself to not being able to do rastering over the past year, until I got a spurt of inspiration in the lead-up to Christmas to try and make presents again. As it goes. It took 3 days this time around to figure out what was going on, but here's the cause of the bug:
The firmware calculates trapezoidal velocity profiles for each line it draws. As new lines get added to the queue, it calculates a smooth acceleration/deceleration between each successive pair of lines. This is why we have lead-in and lead-out distances for fills and rasters - so that you don't have to have an acceleration or deceleration region in your image, and can spend the full distance engraving at the 'plateau' velocity.
For the last line in the queue, it assumes a ramp down to 0 velocity. If more lines get added, this calculation gets updated.
However, for raster data, the pixels are streamed over the serial connection during the engraving pass, blocking the lead-out line from getting transmitted until the pixel data has all been sent. What was happening was that the raster engraving was hitting the placeholder 'deceleration point' necessary to slow down 0 velocity. Once it did this, it saw that it isn't able to continue engraving at the target speed, begins its deceleration, and discards all following raster data. Once the raster data is cleared from the input buffer, it reads in the lead-out line, recalculates the deceleration profile, and ramps back up to the intended speed (meaning that there isn't a visual slowdown).
The fix was simply to assume that in the case of no additional lines in the queue, assume that a raster line will not decelerate at all.
I am still confused as to:
a) why rastering ever worked making complete images at all
b) what the finicky discrepancy between versions of Windows on my laptop had to do with anything
I believe that the answer is something to do with the speed of serial interface buffer handling at a low level - if the feedrate is low enough or if data was transmitted to the arduino quickly enough then this issue doesn't occur. I must have been on the borderline with my setup.
Phew. That was one of the hardest bugs I've ever had to track down, and I'm glad it's dead.
Scott