Skip to content

Commit

Permalink
G91.1 and help updates
Browse files Browse the repository at this point in the history
ArcIJ needs to be in incremental mode, provide a way to set G91.1
similar to setting G61
  • Loading branch information
swarfer committed Jan 13, 2017
1 parent d9d6885 commit 3787a99
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 19 deletions.
10 changes: 8 additions & 2 deletions Plugins/Phlatboyz/PhlatMill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,22 @@ def job_start(optim, extra=@extr)
unit_cmd, @precision, @is_metric = ["G20", 4, false]
end

stop_code = $phoptions.use_exact_path? ? " G61" : "" # G61 - Exact Path Mode
stop_code = $phoptions.use_exact_path? ? "G61" : "" # G61 - Exact Path Mode
ij_code = $phoptions.use_incremental_ij? ? "G91.1" : "" # G91.1 - set incremental IJ mode
if (@gforce) # output the header on separate lines for Marlin
cncPrint("G90\n#{unit_cmd}\nG49\nG17\n"); # G90 - Absolute programming (type B and C systems)
if (stop_code != "")
cncPrint("#{stop_code}\n")
end
if (ij_code != "")
cncPrint("#{ij_code}\n")
end
cncPrint(format_feed(@speed_plung).strip) #output an initial feed rate so system always has it defined
cncPrint("\n")
else
cncPrint("G90 #{unit_cmd} G49 G17#{stop_code}") # G90 - Absolute programming (type B and C systems)
cncPrint("G90 #{unit_cmd} G49 G17") # G90 - Absolute programming (type B and C systems)
cncPrint(" #{stop_code}") if (stop_code != "")
cncPrint(" #{ij_code}") if (ij_code != "")
cncPrint(format_feed(@speed_plung)) #output an initial feed rate so system always has it defined
cncPrint("\n")
end
Expand Down
21 changes: 21 additions & 0 deletions Plugins/Phlatboyz/html/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<ul style="padding-left: 3px;">
<li><a href="afterinstall.html" style="color: red">After install - things to do</a>
<li><a href="sketchucamtoolbar.html"><b>The Toolbar</b></a> very important!
<li><a href="machelp.html">Help for MAC users</a>
</ul>
<b>HOWTO:</b><br>
<ul style="padding-left: 2px;">
Expand Down Expand Up @@ -135,6 +136,25 @@
<tbody>
<tr>
<td width="90%">

<div class="intro">
<h4>New in V1.4d (Jan 2017)</h4>
<dl>
<dd>
<dl>
<dt>Help updates
<dd>added <a href="machelp.html">MAC help section</a>
<dt>arcmoveij() is INCREMENTAL mode.
<dd>the 'incremental' form of IJ is used so make sure you set your controller to incremental mode by issuing G91.1
<dd>you can add this code to the G-code via the <a href="howto_options.html#a4">Options menu</a>
<dd>an option to output G91.1 as part of the Gcode header has been added to the Feature Options menu.
<dt>Solve failure to find <a href="howto_profileexchange.html">profile path</a> on Mac (for real this time)
<dd>Sketchup on MAC still has the old .openpanel bug that prevents the use of wildcards. Mac platform is now detected and wildcards avoided.
<dd>Note that the file select dialog allows selection of a flder, but the profiles folder will always be used no matter what you select.
</dl>
</dl>
</div>

<div class="intro">
<h4>New in V1.4c (Dec 2016)</h4>
<dl>
Expand All @@ -144,6 +164,7 @@ <h4>New in V1.4c (Dec 2016)</h4>
<dd>added <a href="howto_3d.html">3D section</a>
<dt>arcmoveij() now always used for arc outputs
<dd>this improves arc accuracy and keeps Marlin happy
<dd>the 'incremental' form of IJ is used so make sure you set your controller to incremental mode by issuing G91.1
<dt>Old files with arcs that have no center property will be rejected, they have to be recoded
<dd>Early versions did not store the arc centers and they are needed for arcmoveij()
<dt>Errant G0 move with no code removed from plungebore in Marlin mode.
Expand Down
10 changes: 9 additions & 1 deletion Plugins/Phlatboyz/html/howto_options.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,15 @@ <h2><a id="a4">Feature Options</a></h2>
very noticeable but anything over 200 starts to generate large radii so
that the momentum of the machine can be maintained.<br>
Turn this off for GRBL and related controllers.


<dt>Use_Incremental_IJ (G91.1)
<dd>Set this to true to put a G91.1 in th eG-code header.
<dd>G91.1 sets the G2/G3 arc commands to incremental mode. Some controllers default to absolute mode but since our G-code uses incremental mode,
we have to change the controller mode to incremental mode by giving a G91.1 command.
<dd>Note that this is modal, your controller should remember it once you have set it so you probably do not need it in every G-code file.
<dd>You know you need this command if your controller displays very large circles instead of sort arc segments for curved sections of your drawing.
<dd>G-plot cannot display a file that contains this code. (yet)

<dt>Always_show_safearea
<dd>Set this to true, if you want the safe area to always show, when parameters are saved.<br>
Otherwise the safe area will only show, if it's size has been changed.
Expand Down
Binary file modified Plugins/Phlatboyz/html/images/options-feature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions Plugins/Phlatboyz/html/machelp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SketchUcam: HOWTO use Ramping</title>
<link type="text/css" rel="stylesheet" href="style.css">

</head>
<body>


<div class="shell">

<br>
<div class="intro-name">Phlatboyz SketchUcam(PhlatScripT)
<div>
<b>SketchUcam Version 1.4d</b><br>Jan 2017
</div>
</div>
<hr width="100%">
<div class="intro">
<span style="float: right;"><a href="help.html">Back to help index</a></span>
<h2>Help for MAC users</h2>

<h3>Special keys:</h3>
<p>Some Mac keyboards do not have the HOME and END keys (and ALT may not be labelled).</p>
<p>There are alternate combinations that simulate those keys:</p>
<ul>
<li>HOME = "FN-LEFT ARROW"
<li>END = "FN-RIGHT ARROW"
<li>ALT = OPTION
</ul>
<p>Sometimes you may have to hit the FN-LEFT twice before the dialog comes up. </p>
<p>Thanks to <a href="http://openbuilds.com">OpenBuilds</a> user <u>andycbrklyn</u> for help with this.</p>
<br clear=all>
</div>
<hr><br>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions Plugins/Phlatboyz/tools/HelpTool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def select
" Use_compatible_dialogs = #{$phoptions.use_compatible_dialogs?}\n" +
" Use_vtab_speed_limit = #{$phoptions.use_vtab_speed_limit?}\n" +
" Use_exact_path = #{$phoptions.use_exact_path?}\n" +
" Use_incremental_ij = #{$phoptions.use_incremental_ij?}\n" +
" Always_show_safearea = #{$phoptions.always_show_safearea?}\n" +
" Use_reduced_safe_height = #{$phoptions.use_reduced_safe_height?}\n" +
" Use_pocket_CW = #{$phoptions.use_pocket_cw?}\n" +
Expand Down
51 changes: 35 additions & 16 deletions Plugins/Phlatboyz/tools/PhOptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def initialize(phoptions)
#features
@use_vtab_speed_limit = (phoptions.use_vtab_speed_limit? ? '1' : '0')
@use_exact_path = (phoptions.use_exact_path? ? '1' : '0')
@use_incremental_ij = (phoptions.use_incremental_ij? ? '1' : '0')
@always_show_safearea = (phoptions.always_show_safearea? ? '1' : '0')
@use_pocket_cw = (phoptions.use_pocket_cw? ? '1' : '0')
@use_plunge_cw = (phoptions.use_plunge_cw? ? '1' : '0')
Expand Down Expand Up @@ -130,6 +131,7 @@ def initialize
#features
@use_vtab_speed_limit = Use_vtab_speed_limit
@use_exact_path = Use_exact_path
@use_incremental_ij = false
@always_show_safearea = Always_show_safearea
@use_reduced_safe_height = Use_reduced_safe_height
@use_pocket_cw = Use_pocket_CW
Expand Down Expand Up @@ -261,6 +263,11 @@ def initialize
value = getvalue(optin['use_exact_path']) if (optin.has_key?('use_exact_path'))
@use_exact_path = value > 0 ? true : false if (value != -1)

# Use_incremental_ij = false
value = -1
value = getvalue(optin['use_incremental_ij']) if (optin.has_key?('use_incremental_ij'))
@use_incremental_ij = value > 0 ? true : false if (value != -1)

# Always_show_safearea = true
value = -1
value = getvalue(optin['always_show_safearea']) if (optin.has_key?('always_show_safearea'))
Expand Down Expand Up @@ -662,6 +669,14 @@ def use_exact_path=(newval)
@use_exact_path = newval
end

def use_incremental_ij?
@use_incremental_ij
end
def use_incremental_ij=(newval)
@use_incremental_ij = newval
end


def always_show_safearea?
@always_show_safearea
end
Expand Down Expand Up @@ -1182,6 +1197,7 @@ def select
# prompts
prompts=[
'Use_exact_path (G61) ',
'Use_Incremental_IJ (G91.1)',
'Always_show_safearea ',
'Use_pocket_CW ',
'Use_plunge_CW ',
Expand All @@ -1200,6 +1216,7 @@ def select
];
defaults=[
@options.use_exact_path?.inspect(),
@options.use_incremental_ij?.inspect(),
@options.always_show_safearea?.inspect(),
@options.use_pocket_cw?.inspect(),
@options.use_plunge_cw?.inspect(),
Expand All @@ -1225,6 +1242,7 @@ def select
'true|false',
'true|false',
'true|false',
'true|false',
'',
'true|false',
'',
Expand All @@ -1242,27 +1260,28 @@ def select
end # input is nil if user cancelled
if (input)
@options.use_exact_path = (input[0] == 'true')
@options.always_show_safearea = (input[1] == 'true')
@options.use_pocket_cw = (input[2] == 'true')
@options.use_plunge_cw = (input[3] == 'true')
@options.use_outfeed = (input[4] == 'true')
@options.use_vtab_speed_limit = (input[5] == 'true')
@options.profile_save_material_thickness = (input[6] == 'true')
@options.use_home_height = (input[7] == 'true')
@options.default_home_height = input[8] # length

@options.use_end_position = (input[9] == 'true')
@options.use_incremental_ij = (input[1] == 'true')
@options.always_show_safearea = (input[2] == 'true')
@options.use_pocket_cw = (input[3] == 'true')
@options.use_plunge_cw = (input[4] == 'true')
@options.use_outfeed = (input[5] == 'true')
@options.use_vtab_speed_limit = (input[6] == 'true')
@options.profile_save_material_thickness = (input[7] == 'true')
@options.use_home_height = (input[8] == 'true')
@options.default_home_height = input[9] # length

@options.use_end_position = (input[10] == 'true')
if (@options.use_outfeed?) # only one of them
@options.use_end_position = false
end
@options.end_x = input[10] #length
@options.end_y = input[11] #length
@options.end_x = input[11] #length
@options.end_y = input[12] #length

@options.use_fuzzy_pockets = (input[12] == 'true')
@options.use_fuzzy_pockets = (input[13] == 'true')

@options.ramp_angle = input[13] #float
@options.must_ramp = (input[14] == 'true')
@options.gforce = (input[15] == 'true')
@options.ramp_angle = input[14] #float
@options.must_ramp = (input[15] == 'true')
@options.gforce = (input[16] == 'true')
#puts "saving must_ramp = #{@options.must_ramp?}"

@options.save
Expand Down

0 comments on commit 3787a99

Please sign in to comment.