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
8d8c62d8
Commit
8d8c62d8
authored
Nov 11, 2014
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Laser beam width PWM modulation
parent
769d1ec6
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
193 additions
and
131 deletions
+193
-131
Marlin.h
MarlinKimbra/Marlin.h
+4
-0
Marlin_main.cpp
MarlinKimbra/Marlin_main.cpp
+21
-6
language.h
MarlinKimbra/language.h
+136
-124
pins.h
MarlinKimbra/pins.h
+2
-1
planner.cpp
MarlinKimbra/planner.cpp
+18
-0
planner.h
MarlinKimbra/planner.h
+3
-0
ultralcd.cpp
MarlinKimbra/ultralcd.cpp
+9
-0
No files found.
MarlinKimbra/Marlin.h
View file @
8d8c62d8
...
...
@@ -288,6 +288,10 @@ extern float retract_length, retract_length_swap, retract_feedrate, retract_zlif
extern
float
retract_recover_length
,
retract_recover_length_swap
,
retract_recover_feedrate
;
#endif
#ifdef LASERBEAM
extern
int
laser_ttl_modulation
;
#endif
extern
unsigned
long
starttime
;
extern
unsigned
long
stoptime
;
...
...
MarlinKimbra/Marlin_main.cpp
View file @
8d8c62d8
...
...
@@ -90,6 +90,7 @@
// M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
// M1 - Same as M0
// M03 - Put S<value> in laser beam control
// M04 - Turn on laser beam
// M05 - Turn off laser beam
// M17 - Enable/Power all stepper motors
// M18 - Disable all stepper motors; same as M84
...
...
@@ -379,6 +380,10 @@ bool cancel_heatup = false ;
int
meas_delay_cm
=
MEASUREMENT_DELAY_CM
;
//distance delay setting
#endif
#ifdef LASERBEAM
int
laser_ttl_modulation
=
0
;
#endif
//===========================================================================
//=============================Private Variables=============================
//===========================================================================
...
...
@@ -661,9 +666,11 @@ void setup()
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
setup_photpin
();
#endif
#if defined(LASERBEAM_PIN) && LASERBEAM_PIN > -1
pinMode
(
LASERBEAM_PIN
,
OUTPUT
);
digitalWrite
(
LASERBEAM_PIN
,
LOW
);
// turn it off
#ifdef LASERBEAM // Initialize Laser beam
SET_OUTPUT
(
LASER_PWR_PIN
);
digitalWrite
(
LASER_PWR_PIN
,
LOW
);
SET_OUTPUT
(
LASER_TTL_PIN
);
digitalWrite
(
LASER_TTL_PIN
,
LOW
);
#endif
#if defined(NUM_SERVOS)
servo_init
();
...
...
@@ -3026,12 +3033,20 @@ void process_commands()
case
03
:
// M03 S - Setting laser beam
{
if
(
code_seen
(
'S'
))
{
digitalWrite
(
LASERBEAM_PIN
,
code_value
());
laser_ttl_modulation
=
constrain
(
code_value
(),
0
,
255
);
}
else
{
laser_ttl_modulation
=
0
;
}
}
break
;
case
05
:
// M05 - Setting laser beam off
digitalWrite
(
LASERBEAM_PIN
,
0
);
case
04
:
// M04 - Turn on laser beam
digitalWrite
(
LASER_PWR_PIN
,
HIGH
);
laser_ttl_modulation
=
0
;
break
;
case
05
:
// M05 - Turn off laser beam
digitalWrite
(
LASER_PWR_PIN
,
LOW
);
laser_ttl_modulation
=
0
;
break
;
#endif // LASERBEAM
...
...
MarlinKimbra/language.h
View file @
8d8c62d8
This diff is collapsed.
Click to expand it.
MarlinKimbra/pins.h
View file @
8d8c62d8
...
...
@@ -3057,7 +3057,8 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif // END NPR2
#ifdef LASERBEAM
#define LASERBEAM_PIN 6
#define LASER_PWR_PIN 42
#define LASER_TTL_PIN 44
#endif
#ifdef FILAMENT_END_SWITCH
...
...
MarlinKimbra/planner.cpp
View file @
8d8c62d8
...
...
@@ -459,6 +459,9 @@ void check_axes_activity()
unsigned
char
tail_valve_pressure
=
ValvePressure
;
unsigned
char
tail_e_to_p_pressure
=
EtoPPressure
;
#endif
#ifdef LASERBEAM
unsigned
char
tail_laser_ttl_modulation
=
laser_ttl_modulation
;
#endif
block_t
*
block
;
if
(
block_buffer_tail
!=
block_buffer_head
)
...
...
@@ -469,6 +472,10 @@ void check_axes_activity()
tail_valve_pressure
=
block_buffer
[
block_index
].
valve_pressure
;
tail_e_to_p_pressure
=
block_buffer
[
block_index
].
e_to_p_pressure
;
#endif
#ifdef LASERBEAM
tail_laser_ttl_modulation
=
block_buffer
[
block_index
].
laser_ttlmodulation
;
#endif
while
(
block_index
!=
block_buffer_head
)
{
block
=
&
block_buffer
[
block_index
];
...
...
@@ -523,6 +530,12 @@ void check_axes_activity()
analogWrite
(
HEATER_2_PIN
,
tail_e_to_p_pressure
);
#endif
#endif
// add Laser TTL Modulation(PWM) Control
#ifdef LASERBEAM
analogWrite
(
LASER_TTL_PIN
,
tail_laser_ttl_modulation
);
#endif
}
...
...
@@ -632,6 +645,11 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
block
->
valve_pressure
=
ValvePressure
;
block
->
e_to_p_pressure
=
EtoPPressure
;
#endif
// Add update block variables for LASER BEAM control
#ifdef LASERBEAM
block
->
laser_ttlmodulation
=
laser_ttl_modulation
;
#endif
// Compute direction bits for this block
block
->
direction_bits
=
0
;
...
...
MarlinKimbra/planner.h
View file @
8d8c62d8
...
...
@@ -67,6 +67,9 @@ typedef struct {
#ifdef BARICUDA
unsigned
long
valve_pressure
;
unsigned
long
e_to_p_pressure
;
#endif
#ifdef LASERBEAM
unsigned
long
laser_ttlmodulation
;
#endif
volatile
char
busy
;
}
...
...
MarlinKimbra/ultralcd.cpp
View file @
8d8c62d8
...
...
@@ -716,6 +716,15 @@ static void lcd_prepare_menu()
MENU_ITEM
(
gcode
,
MSG_BED_SETTING
,
PSTR
(
"G28 M"
));
MENU_ITEM
(
function
,
MSG_SET_HOME_OFFSETS
,
lcd_set_home_offsets
);
//MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
//Add Preset menu for LASER setting '14. 7. 22
#ifdef LASERBEAM
MENU_ITEM_EDIT
(
int3
,
MSG_LASER
,
&
laser_ttl_modulation
,
0
,
255
);
if
(
laser_ttl_modulation
==
0
)
{
digitalWrite
(
LASER_PWR_PIN
,
LOW
);
}
else
{
digitalWrite
(
LASER_PWR_PIN
,
HIGH
);
}
#endif
#if TEMP_SENSOR_0 != 0
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0
MENU_ITEM
(
submenu
,
MSG_PREHEAT_PLA
,
lcd_preheat_pla_menu
);
...
...
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