Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
9008eeb4
Commit
9008eeb4
authored
May 16, 2016
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug preventing multiple consecutive raster in one sequence
parent
b8cef095
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
7 deletions
+29
-7
MK_Main.cpp
MK/module/MK_Main.cpp
+8
-1
planner.cpp
MK/module/motion/planner.cpp
+1
-1
planner.h
MK/module/motion/planner.h
+3
-1
stepper.cpp
MK/module/motion/stepper.cpp
+17
-4
No files found.
MK/module/MK_Main.cpp
View file @
9008eeb4
...
@@ -4909,8 +4909,11 @@ inline void gcode_G92() {
...
@@ -4909,8 +4909,11 @@ inline void gcode_G92() {
#if ENABLED(LASER) && ENABLED(LASER_FIRE_SPINDLE)
#if ENABLED(LASER) && ENABLED(LASER_FIRE_SPINDLE)
if
(
laser
.
status
!=
LASER_OFF
)
{
if
(
laser
.
status
!=
LASER_OFF
)
{
laser
.
status
=
LASER_OFF
;
laser
.
status
=
LASER_OFF
;
laser
.
mode
=
CONTINUOUS
;
laser
.
duration
=
0
;
lcd_update
();
lcd_update
();
prepare_move
();
prepare_move
();
if
(
laser
.
diagnostics
)
ECHO_LM
(
INFO
,
"Laser M5 called and laser ON"
);
}
}
#endif
#endif
}
}
...
@@ -7555,13 +7558,17 @@ inline void gcode_M503() {
...
@@ -7555,13 +7558,17 @@ inline void gcode_M503() {
#if ENABLED(LASER)
#if ENABLED(LASER)
// M649 set laser options
// M649 set laser options
inline
void
gcode_M649
()
{
inline
void
gcode_M649
()
{
// do this at the start so we can debug if needed!
if
(
code_seen
(
'D'
)
&&
IsRunning
())
laser
.
diagnostics
=
(
bool
)
code_value
();
// Wait for the rest
//st_synchronize();
if
(
code_seen
(
'S'
)
&&
IsRunning
())
{
if
(
code_seen
(
'S'
)
&&
IsRunning
())
{
laser
.
intensity
=
(
float
)
code_value
();
laser
.
intensity
=
(
float
)
code_value
();
laser
.
rasterlaserpower
=
laser
.
intensity
;
laser
.
rasterlaserpower
=
laser
.
intensity
;
}
}
if
(
code_seen
(
'L'
)
&&
IsRunning
())
laser
.
duration
=
(
unsigned
long
)
labs
(
code_value
());
if
(
code_seen
(
'L'
)
&&
IsRunning
())
laser
.
duration
=
(
unsigned
long
)
labs
(
code_value
());
if
(
code_seen
(
'P'
)
&&
IsRunning
())
laser
.
ppm
=
(
float
)
code_value
();
if
(
code_seen
(
'P'
)
&&
IsRunning
())
laser
.
ppm
=
(
float
)
code_value
();
if
(
code_seen
(
'D'
)
&&
IsRunning
())
laser
.
diagnostics
=
(
bool
)
code_value
();
if
(
code_seen
(
'B'
)
&&
IsRunning
())
laser_set_mode
((
int
)
code_value
());
if
(
code_seen
(
'B'
)
&&
IsRunning
())
laser_set_mode
((
int
)
code_value
());
if
(
code_seen
(
'R'
)
&&
IsRunning
())
laser
.
raster_mm_per_pulse
=
((
float
)
code_value
());
if
(
code_seen
(
'R'
)
&&
IsRunning
())
laser
.
raster_mm_per_pulse
=
((
float
)
code_value
());
if
(
code_seen
(
'F'
))
{
if
(
code_seen
(
'F'
))
{
...
...
MK/module/motion/planner.cpp
View file @
9008eeb4
...
@@ -896,7 +896,7 @@ float junction_deviation = 0.1;
...
@@ -896,7 +896,7 @@ float junction_deviation = 0.1;
static
const
float
Factor
=
F_CPU
/
(
LASER_PWM
*
2
*
100.0
*
255.0
);
static
const
float
Factor
=
F_CPU
/
(
LASER_PWM
*
2
*
100.0
*
255.0
);
block
->
laser_raster_intensity_factor
=
laser
.
intensity
*
Factor
;
block
->
laser_raster_intensity_factor
=
laser
.
intensity
*
Factor
;
#endif
#endif
block
->
steps_l
=
labs
(
block
->
millimeters
*
laser
.
ppm
);
block
->
steps_l
=
(
unsigned
long
)
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
++
)
{
#if (!ENABLED(LASER_PULSE_METHOD))
#if (!ENABLED(LASER_PULSE_METHOD))
...
...
MK/module/motion/planner.h
View file @
9008eeb4
...
@@ -104,7 +104,7 @@ typedef struct {
...
@@ -104,7 +104,7 @@ typedef struct {
bool
laser_status
;
// LASER_OFF, LASER_ON
bool
laser_status
;
// LASER_OFF, LASER_ON
float
laser_ppm
;
// pulses per millimeter, for pulsed and raster firing modes
float
laser_ppm
;
// pulses per millimeter, for pulsed and raster firing modes
unsigned
long
laser_duration
;
// laser firing duration in microseconds, for pulsed and raster firing modes
unsigned
long
laser_duration
;
// laser firing duration in microseconds, for pulsed and raster firing modes
long
steps_l
;
// step count between firings of the laser, for pulsed firing mode
unsigned
long
steps_l
;
// step count between firings of the laser, for pulsed firing mode
float
laser_intensity
;
// Laser firing instensity in clock cycles for the PWM timer
float
laser_intensity
;
// Laser firing instensity in clock cycles for the PWM timer
#if ENABLED(LASER_RASTER)
#if ENABLED(LASER_RASTER)
unsigned
char
laser_raster_data
[
LASER_MAX_RASTER_LINE
];
unsigned
char
laser_raster_data
[
LASER_MAX_RASTER_LINE
];
...
@@ -121,6 +121,8 @@ typedef struct {
...
@@ -121,6 +121,8 @@ typedef struct {
#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
#define MAX_EVENTS_COUNT 2147483648 // max for a signed 32 bit number
// Initialize the motion plan subsystem
// Initialize the motion plan subsystem
void
plan_init
();
void
plan_init
();
...
...
MK/module/motion/stepper.cpp
View file @
9008eeb4
...
@@ -630,9 +630,7 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -630,9 +630,7 @@ ISR(TIMER1_COMPA_vect) {
// going from darkened paper to burning through paper.
// going from darkened paper to burning through paper.
laser_fire
(
current_block
->
laser_raster_data
[
counter_raster
]);
laser_fire
(
current_block
->
laser_raster_data
[
counter_raster
]);
#endif
#endif
if
(
laser
.
diagnostics
)
{
if
(
laser
.
diagnostics
)
ECHO_EMV
(
"Pixel: "
,
(
float
)
current_block
->
laser_raster_data
[
counter_raster
]);
ECHO_MV
(
"Pixel: "
,
(
float
)
current_block
->
laser_raster_data
[
counter_raster
]);
}
counter_raster
++
;
counter_raster
++
;
}
}
#endif // LASER_RASTER
#endif // LASER_RASTER
...
@@ -640,12 +638,27 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -640,12 +638,27 @@ ISR(TIMER1_COMPA_vect) {
}
}
#if !ENABLED(LASER_PULSE_METHOD)
#if !ENABLED(LASER_PULSE_METHOD)
if
(
current_block
->
laser_duration
!=
0
&&
(
laser
.
last_firing
+
current_block
->
laser_duration
<
micros
()))
{
if
(
current_block
->
laser_duration
!=
0
&&
(
laser
.
last_firing
+
current_block
->
laser_duration
<
micros
()))
{
if
(
laser
.
diagnostics
)
ECHO_LM
(
INFO
,
"Laser firing duration elapsed, in interrupt fast loop"
);
if
(
laser
.
diagnostics
)
{
ECHO_MV
(
"X: "
,
counter_X
);
ECHO_MV
(
", Y: "
,
counter_Y
);
ECHO_MV
(
", L: "
,
counter_L
);
ECHO_MV
(
", Z: "
,
counter_L
);
ECHO_MV
(
", E: "
,
counter_E
);
ECHO_MV
(
", steps done: "
,
step_events_completed
);
ECHO_MV
(
", event count: "
,
current_block
->
step_event_count
);
ECHO_EM
(
", <--------------------"
);
ECHO_LM
(
INFO
,
"Laser firing duration elapsed, in interrupt fast loop "
);
}
laser_extinguish
();
laser_extinguish
();
}
}
#endif
#endif
#endif // LASER
#endif // LASER
// safe check for erroneous calculated events count
if
(
current_block
->
step_event_count
>=
MAX_EVENTS_COUNT
)
{
kill_current_block
();
break
;
}
step_events_completed
++
;
step_events_completed
++
;
if
(
step_events_completed
>=
current_block
->
step_event_count
)
break
;
if
(
step_events_completed
>=
current_block
->
step_event_count
)
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment