Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
playing with beam dynamics
  • Loading branch information
stefanix committed Feb 13, 2013
1 parent 7a6fed6 commit 899df43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config.h
Expand Up @@ -53,9 +53,9 @@
// of actual to nominal speed and uses this to also reduce the nominal laser intensity.
// The diminution profile can also be fine-tuned (as a linear mapping is too aggressive).
// It uses this function: y=x^2*d+(1-d) where d is the diminution (0.0 to 1.0).
// 0.0 is no diminution and anything > 0.7 is more aggresive than linear.
#define CONFIG_BEAM_DIMINUTION 0
// #define CONFIG_BEAM_DIMINUTION 0.3
// 0 is no diminution and anything > 0.7 is more aggresive than linear.
#define CONFIG_BEAM_DIMINUTION 0.4
#define CONFIG_LASER_MIN_INTENSITY 40 // min intensity at which the laser fires, 0-255

#define SENSE_DDR DDRD
#define SENSE_PORT PORTD
Expand Down
6 changes: 4 additions & 2 deletions stepper.c
Expand Up @@ -470,8 +470,10 @@ static void adjust_speed( uint32_t steps_per_minute ) {
// We could use slowdown_pct directly but this tends to be too aggressive and leads
// to corners getting too little power (opposite problem). To get a sense of the
// dynamic factor simply graph y=x^2*d+(1-d) for d in [0.0, 1.0]
double dynamic_factor = slowdown_pct*slowdown_pct*(CONFIG_BEAM_DIMINUTION)+(1-CONFIG_BEAM_DIMINUTION);
control_laser_intensity(current_block->nominal_laser_intensity * dynamic_factor);
// double dynamic_factor = slowdown_pct*slowdown_pct*(CONFIG_BEAM_DIMINUTION)+(1-CONFIG_BEAM_DIMINUTION);
double dynamic_factor = slowdown_pct*(CONFIG_BEAM_DIMINUTION)+(1-CONFIG_BEAM_DIMINUTION);
int s_value = max(current_block->nominal_laser_intensity * dynamic_factor, CONFIG_LASER_MIN_INTENSITY);
control_laser_intensity(min(s_value, current_block->nominal_laser_intensity));
} else {
// run at constant intensity
control_laser_intensity(current_block->nominal_laser_intensity);
Expand Down

0 comments on commit 899df43

Please sign in to comment.