Raster is now tested and working great

parent 6ecfabca
...@@ -218,7 +218,8 @@ void laser_fire(float intensity = 100.0){ ...@@ -218,7 +218,8 @@ void laser_fire(float intensity = 100.0){
// In the case that the laserdriver need at least a certain level "LASER_REMAP_INTENSITY" // In the case that the laserdriver need at least a certain level "LASER_REMAP_INTENSITY"
// to give anything, the intensity can be remapped to start at "LASER_REMAP_INTENSITY" // to give anything, the intensity can be remapped to start at "LASER_REMAP_INTENSITY"
// At least some CO2-drivers need it, not sure about laserdiode drivers. // At least some CO2-drivers need it, not sure about laserdiode drivers.
#if(ENABLED(LASER_REMAP_INTENSITY))
#if(ENABLED(LASER_REMAP_INTENSITY) && ENABLED(LASER_PULSE_METHOD))
#if LASER_REMAP_INTENSITY != 0 #if LASER_REMAP_INTENSITY != 0
float OldRange, NewRange; float OldRange, NewRange;
OldRange = (255.0 - 0.0); OldRange = (255.0 - 0.0);
......
...@@ -899,7 +899,21 @@ float junction_deviation = 0.1; ...@@ -899,7 +899,21 @@ float junction_deviation = 0.1;
block->steps_l = labs(block->millimeters*laser.ppm); block->steps_l = labs(block->millimeters*laser.ppm);
if (laser.mode == RASTER) { if (laser.mode == RASTER) {
for (int i = 0; i < LASER_MAX_RASTER_LINE; i++) { for (int i = 0; i < LASER_MAX_RASTER_LINE; i++) {
block->laser_raster_data[i] = laser.raster_data[i]; #if (!ENABLED(LASER_PULSE_METHOD))
float OldRange, NewRange;
float NewValue;
OldRange = (255.0 - 0.0);
NewRange = (laser.rasterlaserpower - LASER_REMAP_INTENSITY);
NewValue = (float)(((((float)laser.raster_data[i] - 0) * NewRange) / OldRange) + LASER_REMAP_INTENSITY);
//If less than 7%, turn off the laser tube.
if(NewValue == LASER_REMAP_INTENSITY)
NewValue = 0;
block->laser_raster_data[i] = NewValue;
#else
block->laser_raster_data[i] = laser.raster_data[i];
#endif
} }
} }
} else { } else {
......
...@@ -1829,6 +1829,9 @@ ...@@ -1829,6 +1829,9 @@
#endif #endif
#if ENABLED(LASER) #if ENABLED(LASER)
#if (!ENABLED(LASER_REMAP_INTENSITY) && ENABLED(LASER_RASTER))
#error DEPENDENCY ERROR: You have to set LASER_REMAP_INTENSITY with LASER_RASTER enabled
#endif
#if (!ENABLED(LASER_CONTROL) || ((LASER_CONTROL > 0) && (LASER_CONTROL < 2))) #if (!ENABLED(LASER_CONTROL) || ((LASER_CONTROL > 0) && (LASER_CONTROL < 2)))
#error DEPENDENCY ERROR: You have to set LASER_CONTROL to 1 or 2 #error DEPENDENCY ERROR: You have to set LASER_CONTROL to 1 or 2
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment