<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4623070096183449009</id><updated>2012-01-02T22:13:46.933-08:00</updated><category term='Machining'/><category term='Ubuntu'/><category term='GERBER'/><category term='EMC2'/><category term='PCB'/><category term='GCODE'/><category term='CNC'/><category term='EAGLE'/><category term='CNC EMC2 Machining'/><title type='text'>The Super Electromechanical Software Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-7867444518911236191</id><published>2012-01-02T17:19:00.000-08:00</published><updated>2012-01-02T22:13:36.470-08:00</updated><title type='text'>Creating a Production Rails 3.1 Server (Ubuntu 10.04 LTS)</title><content type='html'>&lt;STYLE&gt;&lt;/STYLE&gt;The following are instructions on how to create a production Rails 3.1 Server using Ubuntu 10.04 LTS&lt;BR&gt;&lt;BR&gt;&lt;DIV class='step'&gt;  Download the Ubuntu 10.04.3 LTS 64 bit Server ISO from &lt;a href="http://www.ubuntu.com/download/server/download"&gt;here&lt;/a&gt; and install it.  Install the "LAMP Server" and "OpenSSH Server" packages when prompted.&lt;/DIV&gt;&lt;DIV class='step'&gt;Install prerequisites  &lt;DIV class='bash'&gt;    sudo apt-get install build-essential libyaml-dev zlib1g-dev libcurl4-openssl-dev libssl-dev libopenssl-ruby apache2-prefork-dev libapr1-dev libaprutil1-dev&lt;BR&gt;  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Download the Ruby source code and compile it  &lt;DIV class='bash'&gt;    cd ~&lt;BR&gt;    mkdir ruby_src&lt;BR&gt;    cd ruby_src&lt;BR&gt;    wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz&lt;BR&gt;    tar -zxvf ruby-1.9.3-p0.tar.gz&lt;BR&gt;    cd ruby-1.9.3-p0&lt;BR&gt;    ./configure&lt;BR&gt;    make&lt;BR&gt;    sudo make install&lt;BR&gt;  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Verify Ruby installed correctly  &lt;DIV class='bash'&gt;    ruby -v&lt;BR&gt;  &lt;/DIV&gt;  &lt;DIV class='expectedoutput'&gt;    Expected output is "ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]"  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Download the RubyGems source code and compile it  &lt;DIV class='bash'&gt;    cd ~&lt;BR&gt;    mkdir rubygems_src&lt;BR&gt;    cd rubygems_src&lt;BR&gt;    wget http://rubyforge.org/frs/download.php/75573/rubygems-1.8.12.tgz&lt;BR&gt;    tar -zxvf rubygems-1.8.12.tgz&lt;BR&gt;    cd rubygems-1.8.12&lt;BR&gt;    sudo ruby setup.rb&lt;BR&gt;  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Verify RubyGems installed correctly  &lt;DIV class='bash'&gt;    gem -v&lt;BR&gt;  &lt;/DIV&gt;  &lt;DIV class='expectedoutput'&gt;    Expected output is "1.8.12"  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Install Rails  &lt;DIV class='bash'&gt;    sudo gem install rails&lt;BR&gt;  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Verify Rails installed correctly  &lt;DIV class='bash'&gt;    rails -v&lt;BR&gt;  &lt;/DIV&gt;  &lt;DIV class='expectedoutput'&gt;    Expected output is "Rails 3.1.3"  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Install Phusion Passenger  &lt;DIV class='bash'&gt;    sudo gem install passenger&lt;BR&gt;    sudo passenger-install-apache2-module&lt;BR&gt;  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Configure Apache by adding these lines to /etc/apache2/apache2.conf  &lt;DIV class='bash'&gt;    LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.11/ext/apache2/mod_passenger.so    PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.11    PassengerRuby /usr/local/bin/ruby  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Configure your rails application by adding these lines to /etc/apache2/apache2.conf, assuming the name of your app is Mytest.  Make sure to change the ServerName to the name of the server.  &lt;DIV class='bash'&gt;    &lt;PRE&gt;&lt;br /&gt;      &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;        ServerName www.yourhost.com&lt;br /&gt;        DocumentRoot /usr/local/mytest/public&lt;br /&gt;        &amp;lt;Directory /usr/local/mytest/public&amp;gt;&lt;br /&gt;           AllowOverride all&lt;br /&gt;           Options -MultiViews&lt;br /&gt;        &amp;lt;/Directory&amp;gt;&lt;br /&gt;      &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;    &lt;/PRE&gt;  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Restart Apache  &lt;DIV class='bash'&gt;    sudo /etc/init.d/apache2 restart  &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class='step'&gt;Modify the Gemfile to include execjs and therubyracer if needed.  Then run "sudo bundle install"&lt;/DIV&gt;&lt;DIV class='step'&gt;Rails application housekeeping  &lt;DIV class='bash'&gt;    sudo bundle update&lt;BR&gt;    RAILS_ENV=production rake db:create db:schema:load&lt;BR&gt;    rake assets:precompile&lt;BR&gt;    sudo /etc/init.d/apache2 restart&lt;BR&gt;  &lt;/DIV&gt;&lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-7867444518911236191?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/7867444518911236191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2012/01/creating-production-rails-31-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/7867444518911236191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/7867444518911236191'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2012/01/creating-production-rails-31-server.html' title='Creating a Production Rails 3.1 Server (Ubuntu 10.04 LTS)'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-7633349522721294659</id><published>2011-10-16T21:36:00.000-07:00</published><updated>2011-10-16T21:36:19.459-07:00</updated><title type='text'>Ruby On Rails 3.1 Cheat Sheet</title><content type='html'>* To create a new application use the rails new command.  Replace MyApp with the actual name of your application.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;rails new MyApp&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;* If running Ruby On Rails 3.1 on Ubuntu, you will encounter an error stating " Could not find a JavaScript runtime".  To fix this locate the Gemfile in the root of your application and append the following two lines&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;gem 'execjs'&lt;br /&gt;gem 'therubyracer'&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;then, to update the bundles run the following command &lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;bundle install&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;* To run the development webserver for your application use the following command&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;rails server&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Then from any web browser, navigate to port 3000 of your Ruby on Rails server.  In my case the machine name is testror.  Substitute with your server name or ip address.&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;http://testror:3000&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;* To manually work with the sqlite database, use the sqlite3 command followed by the name of the database file&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;sqlite3 development.sqlite3&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To show a list of tables while inside sqlite use the .tables command&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;.tables&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To exit sqlite use the .exit command&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;.exit&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;* To search for the first record which matches in a database table bound to a model use&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;@info = Info.find(:first, :conditions =&gt; [ "name = ?", "a"])&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;* Variable Scoping&lt;PRE&gt;&lt;br /&gt;$ - a global variable&lt;br /&gt;@ - an instance variable&lt;br /&gt;[a-z] - local variable&lt;br /&gt;[A-Z] - constant&lt;br /&gt;@@ - class static variable&lt;br /&gt;&lt;/PRE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-7633349522721294659?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/7633349522721294659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2011/10/ruby-on-rails-31-cheat-sheet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/7633349522721294659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/7633349522721294659'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2011/10/ruby-on-rails-31-cheat-sheet.html' title='Ruby On Rails 3.1 Cheat Sheet'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-5216436467842212046</id><published>2011-07-04T10:03:00.000-07:00</published><updated>2011-07-04T10:03:19.960-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>How to shutdown ubuntu server properly</title><content type='html'>The right way to shutdown an ubuntu server is simply&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 4px 4px 4px 4px;"&gt;sudo shutdown -h now&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Notice the -h option.  Without that the system doesn't really shutdown and you end up at the Recovery Menu which is really annoying on a headless server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-5216436467842212046?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/5216436467842212046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2011/07/how-to-shutdown-ubuntu-server-properly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/5216436467842212046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/5216436467842212046'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2011/07/how-to-shutdown-ubuntu-server-properly.html' title='How to shutdown ubuntu server properly'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-8996144943112867744</id><published>2011-07-04T09:48:00.000-07:00</published><updated>2011-07-04T09:48:23.767-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EAGLE'/><category scheme='http://www.blogger.com/atom/ns#' term='PCB'/><category scheme='http://www.blogger.com/atom/ns#' term='GERBER'/><title type='text'>2.3 Drill Format in Eagle</title><content type='html'>Just a tidbit for anyone else who runs into this problem.  To change EAGLE 4.16r2 to use a 2.3 leading zero drill format modify the following sections of the eagle.def file in your installation of eagle. &amp;nbsp;The eagle.def file is located in the bin directory of your eagle installation. &amp;nbsp;Relevant changes are shown highlighted in red.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: lightyellow; border: 1px solid black; font: 12px courier; padding: 10px 10px 10px 10px;"&gt;[EXCELLON]&lt;br /&gt;&lt;br /&gt;Type &amp;nbsp; &amp;nbsp; = DrillStation&lt;br /&gt;Long &amp;nbsp; &amp;nbsp; = "Excellon drill station"&lt;br /&gt;Init &amp;nbsp; &amp;nbsp; = "%%\nM48\nM72\n"&lt;br /&gt;Reset &amp;nbsp; &amp;nbsp;= "M30\n"&lt;br /&gt;ResX &amp;nbsp; &amp;nbsp; = &lt;span style="background-color: pink;"&gt;1000&lt;/span&gt;&lt;br /&gt;ResY &amp;nbsp; &amp;nbsp; = &lt;span style="background-color: pink;"&gt;1000&lt;/span&gt;&lt;br /&gt;;Rack &amp;nbsp; &amp;nbsp; = ""&lt;br /&gt;DrillSize &amp;nbsp;= "%sC%0.4f\n" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; (Tool code, tool size)&lt;br /&gt;AutoDrill &amp;nbsp;= "T%02d" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; (Tool number)&lt;br /&gt;FirstDrill = 1&lt;br /&gt;BeginData &amp;nbsp;= "%%\n"&lt;br /&gt;Units &amp;nbsp; &amp;nbsp;= Inch&lt;br /&gt;Select &amp;nbsp; = "%s\n" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; (Drill code)&lt;br /&gt;Drill &amp;nbsp; &amp;nbsp;= "X%05.0fY%05.0f\n" &amp;nbsp; &amp;nbsp; &amp;nbsp;; (x, y)&lt;br /&gt;Info &amp;nbsp; &amp;nbsp; = "Drill File Info:\n"\&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"\n"\&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;" Data Mode &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : Absolute\n"\&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;" Units &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 1/&lt;span style="background-color: pink;"&gt;1000&lt;/span&gt; Inch\n"\&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"\n"&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;Just&amp;nbsp;Why does 2.3 leading zero even matter? &amp;nbsp;I'm not sure it really even does anymore. &amp;nbsp;Many years ago when batchpcb and golden phoenix PCB first hit the scene they were pretty stringent on the drill file being a specific format. &amp;nbsp;I think the process of submitting PCBs has advanced far enough now that nobody may even care how screwed up the drill file is, but since I have always had good success sending it in the required 2.3 leading zero format, i figure why change a good thing. &amp;nbsp;I did recently send some boards to SeeedStudio in a quite messed up drill format and they processed it just fine so maybe nobody really does care anymore.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-8996144943112867744?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/8996144943112867744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2011/07/23-drill-format-in-eagle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/8996144943112867744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/8996144943112867744'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2011/07/23-drill-format-in-eagle.html' title='2.3 Drill Format in Eagle'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-154950078920487657</id><published>2010-04-08T01:40:00.000-07:00</published><updated>2010-04-08T11:03:26.621-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CNC'/><category scheme='http://www.blogger.com/atom/ns#' term='EMC2'/><category scheme='http://www.blogger.com/atom/ns#' term='Machining'/><category scheme='http://www.blogger.com/atom/ns#' term='GCODE'/><title type='text'>CGCC now at version 1.01</title><content type='html'>CGCC v1.01 is now available&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;small bug fixes&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Fixed a problem with postfix decrementor i.e. "x--" not working&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;Added instructions in README to create symbolic link for CGCC.py&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#CC6600;"&gt;Link&lt;/span&gt;&lt;/b&gt;: &lt;a href="http://sites.google.com/site/cgcccompiler/CGCC_v101.zip?attredirects=0"&gt;CGCC v1.01&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-154950078920487657?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/154950078920487657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2010/04/cgcc-now-at-version-101.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/154950078920487657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/154950078920487657'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2010/04/cgcc-now-at-version-101.html' title='CGCC now at version 1.01'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-1665759961097189628</id><published>2010-04-07T12:51:00.000-07:00</published><updated>2010-04-08T11:02:30.147-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CNC'/><category scheme='http://www.blogger.com/atom/ns#' term='EMC2'/><category scheme='http://www.blogger.com/atom/ns#' term='Machining'/><category scheme='http://www.blogger.com/atom/ns#' term='GCODE'/><title type='text'>Some CGCC Features and Examples</title><content type='html'>&lt;b&gt;Some features of CGCC&lt;/b&gt;&lt;br /&gt;If it works in C or C99 give it a try in CGCC&lt;br /&gt;&lt;br /&gt;See the original posting for more info on what CGCC is&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;Link:&lt;/span&gt;&lt;/b&gt; &lt;a href="http://tsemsb.blogspot.com/2010/04/cgcc-gcode-with-c-constructs.html"&gt;Original CGCC Post&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;This page should give some examples of the capabilities that CGCC already supports. &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;C Style comments&lt;/b&gt;&lt;br /&gt;Multiline block comments can be used to comment out large sections of GCode&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;// Single Line Comment&lt;br /&gt;/*&lt;br /&gt;    Multiline Comment&lt;br /&gt;*/&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Declare functions with return values&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;float AddFive(float i) {&lt;br /&gt;    return i + 5&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Evaluate expressions inside GCode&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;float x = 1;&lt;br /&gt;float r = 2;&lt;br /&gt;G00 X[x + r / 4]&lt;/div&gt;&lt;br /&gt;&lt;b&gt;#Include is supported&lt;/b&gt;&lt;br /&gt;Useful for making libraries of functions in header files and including them in your GCode programs.&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;#include "lib.h"&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Assignment from native GCode numbered variables&lt;/b&gt;&lt;br /&gt;This is useful in probing operations&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;x = #1&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Directly Emit GCode with the __gcode__ keyword&lt;/b&gt;&lt;br /&gt;Useful if you run into a situation where CGCC doesn't handle exactly what you need.  You can just emit the correct GCode manually.&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;__gcode__("(DEBUG, THIS IS A TEST)");&lt;/div&gt;&lt;br /&gt;&lt;b&gt;The const keyword to declare constants&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;const float Radius = 5;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Comparison Operators&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;== != &amp;lt; &amp;lt;= &amp;gt;= &amp;gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Arithmatic Operators&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;+ - * /&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Compiler detects the use of uninitialized variables&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Compiler detects use of undeclared variables&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Postfix Increment and Decrement&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;x++&lt;br /&gt;x--&lt;/div&gt;&lt;br /&gt;&lt;b&gt;If else statements&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;if (x == y) {&lt;br /&gt;} else {&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;b&gt;While statements&lt;/b&gt;&lt;br /&gt;&lt;div style="background-color: seashell; border: black solid 1px; font-family: monospace; margin: 5px 20px 5px 20px; padding: 10px 10px 10px 10px;"&gt;while (x != y) {&lt;br /&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-1665759961097189628?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/1665759961097189628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2010/04/some-cgcc-features-and-examples.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/1665759961097189628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/1665759961097189628'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2010/04/some-cgcc-features-and-examples.html' title='Some CGCC Features and Examples'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-8671184468440465387</id><published>2010-04-06T15:52:00.000-07:00</published><updated>2010-04-08T01:39:40.292-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CNC'/><category scheme='http://www.blogger.com/atom/ns#' term='EMC2'/><category scheme='http://www.blogger.com/atom/ns#' term='Machining'/><category scheme='http://www.blogger.com/atom/ns#' term='GCODE'/><title type='text'>CGCC -- GCode with C constructs</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;CGCC (C GCode Compiler)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Not interested in CNC machining?  Please skip this post.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Got a question or found a bug?  Post it in the comments.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:orange;"&gt;&lt;b&gt;Link: &lt;/b&gt;&lt;/span&gt;&lt;a href="http://sites.google.com/site/cgcccompiler/CGCC_v101.zip"&gt;Download the latest CGCC&lt;/a&gt;&lt;br /&gt;Includes instructions on how to integrate it with the EMC2 AXIS GUI as a filter.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Update&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CGCC has now been updated to v1.01&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Fixed a problem with postfix decrementor i.e. "x--" not working&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Added instructions in README to create symbolic link for CGCC.py&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;More information on how to use CGCC and what it can do are now available in a separate posting&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 165, 0); "&gt;&lt;b&gt;Link: &lt;/b&gt;&lt;/span&gt;&lt;a href="http://tsemsb.blogspot.com/2010/04/some-cgcc-features-and-examples.html"&gt;Some CGCC Features and Examples&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Nutshell&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_TbxRLHtVsjk/S7uln2oKHsI/AAAAAAAABvg/JQcA0igUyOk/s1600-h/CGCC.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="270" src="http://2.bp.blogspot.com/_TbxRLHtVsjk/S7uln2oKHsI/AAAAAAAABvg/JQcA0igUyOk/s320/CGCC.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;CGCC Screenshot&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The CGCC compiler allows the use of C and C99 style variables, Functions, Looping Constructs, If Then statements, etc. in GCode with a compiler that converts GCode with C constructs into pure GCode.  Written in Python.  Use your favorite code editor and get C style syntax highlighting for free in your programs ( I use Eclipse on Ubuntu when creating my GCode programs)&lt;br /&gt;&lt;br /&gt;As an example if you wanted to drill a grid of a 100 holes in a 10 inch by 10 inch grid you would repeat the following chunk of code in your GCode file 100 times with different X and Y coordinates.  Add in skipping a line of holes down the diagonal where the x equals the y and you have a big headache on your hands.&lt;br /&gt;&lt;br /&gt;&lt;div    style="background- border: 1px gray solid;   line-height: 100%; margin-bottom: 10px; margin-left: 20px; margin-right: 20px; margin-top: 10px; padding-bottom: 5px; padding-left: 5px; padding-top: 5px;font-family:monospace;font-size:small;color:ivory;"&gt;G00 Z1&lt;br /&gt;G00 X0 Y0&lt;br /&gt;G01 Z0 F1&lt;br /&gt;G00 Z1&lt;br /&gt;(Repeat 99 more times with different X and Y coordinates)&lt;/div&gt;&lt;br /&gt;The CGCC way (excuse the bad indents, blogger doesn't seem to like the way I write code)&lt;br /&gt;&lt;div face="monospace" size="small" color="ivory" style="background- border: 1px gray solid;   line-height: 100%; margin-bottom: 10px; margin-left: 20px; margin-right: 20px; margin-top: 10px; padding-bottom: 5px; padding-left: 5px; padding-top: 5px;"&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:#38761d;"&gt;// Constants&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:#38761d;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:blue;"&gt;const float&lt;/span&gt; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;X_Holes&lt;/span&gt; = &lt;span class="Apple-style-span"  style="color:magenta;"&gt;10&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:blue;"&gt;const float&lt;/span&gt; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;Y_Holes&lt;/span&gt; = &lt;span class="Apple-style-span"  style="color:magenta;"&gt;10&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:#38761d;"&gt;// Loop&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:#38761d;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:blue;"&gt;for&lt;/span&gt; (&lt;span class="Apple-style-span"  style="color:blue;"&gt;float&lt;/span&gt; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;y&lt;/span&gt; = &lt;span class="Apple-style-span"  style="color:magenta;"&gt;0&lt;/span&gt;; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;y &amp;lt;&lt;/span&gt; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;Y_Holes&lt;/span&gt;; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;y&lt;/span&gt;++) {    &lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:blue;"&gt;for&lt;/span&gt; (&lt;span class="Apple-style-span"  style="color:blue;"&gt;float&lt;/span&gt; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;x&lt;/span&gt; = &lt;span class="Apple-style-span"  style="color:magenta;"&gt;0&lt;/span&gt;; x &amp;lt; X&lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;_Holes&lt;/span&gt;; &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;x&lt;/span&gt;++) {&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:blue;"&gt;        if&lt;/span&gt; (&lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;x&lt;/span&gt; != &lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;y&lt;/span&gt;) {&lt;/pre&gt;&lt;pre&gt;            G00 Z1&lt;/pre&gt;&lt;pre&gt;            G00 X[&lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;x&lt;/span&gt;] Y[&lt;span class="Apple-style-span"  style="color:#b45f06;"&gt;y&lt;/span&gt;]&lt;/pre&gt;&lt;pre&gt;            G01 Z0 F1&lt;/pre&gt;&lt;pre&gt;            G00 Z1&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre&gt;}}&lt;/pre&gt;&lt;/div&gt;Nifty, no?&lt;br /&gt;&lt;br /&gt;You could do the same using the o-word extensions in EMC2 GCode and I tried but almost ended up in the looney bin trying to keep everything straight with the global naming conventions of the o-words.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:orange;"&gt;&lt;b&gt;Link: &lt;/b&gt;&lt;/span&gt;&lt;a href="http://www.linuxcnc.org/"&gt;More Information about LinuxCNC&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Why&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;At the time I was building a SMT pick and place machine robot and needed to mill lots and lots of custom pieces for the machine.  I was hand writing a lot of GCode and after a week I thought that there had to be a better way to do this.  If I only had to do a few parts then it wouldn't have been worth the time to write a compiler, it would have been faster to just tough it out with standard GCode.  But I had around 30 different parts that needed to be machined so spending a week writing a compiler seemed like it would be the faster solution.&lt;br /&gt;&lt;br /&gt;Here is a video of the finished machine assembling boards&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:orange;"&gt;&lt;b&gt;Link: &lt;/b&gt;&lt;/span&gt;&lt;a href="http://www.youtube.com/watch?v=xUEPkOa2BNM"&gt;Youtube Video&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Background&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;CNC milling machines and CNC lathes are programmed to cut parts using a language called GCode.  Invented around the 1960s and first run off of punched paper tapes.  The langauge hasn't evolved much although EMC2 has added variables, functions, and looping constructs through the use of o-words.  Functionally the EMC2 enhanced variant of GCode can do everything a C Language can do, but syntactically it is not easy to write good programs.  So I decided to build a compiler which can take C syntax mixed in with GCode and emit pure EMC2 GCode.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Architecture&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Finally, something I learned in college comes in useful.  C is an old language so why not use old tools that were best suited for it.  Bust out the &lt;a href="http://www.amazon.com/Compilers-Principles-Techniques-Alfred-Aho/dp/0201100886"&gt;old dragon compiler book&lt;/a&gt; and go to town.&lt;br /&gt;&lt;br /&gt;An open source python version of lex and yacc are used to do the lexical analysis and some of the final code generation along with custom glue code to make this work with GCode.  It basically works just like a standard C compiler except that instead of targeting the ISA of a particular CPU it targets the EMC2 variant of GCode.&lt;br /&gt;&lt;br /&gt;I wrote this quite a while ago but just got around to publishing it now.  It may need a little bit of clean up but it should work.  I don't know how much time I will have to improve on this but other people are welcome to make it better.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:orange;"&gt;&lt;b&gt;Link: &lt;/b&gt;&lt;/span&gt;&lt;a href="http://www.dabeaz.com/ply/"&gt;PLY an open source Python Lex-Yacc Implementation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-8671184468440465387?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/8671184468440465387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2010/04/cgcc-gcode-with-c-constructs.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/8671184468440465387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/8671184468440465387'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2010/04/cgcc-gcode-with-c-constructs.html' title='CGCC -- GCode with C constructs'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_TbxRLHtVsjk/S7uln2oKHsI/AAAAAAAABvg/JQcA0igUyOk/s72-c/CGCC.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623070096183449009.post-7522834182091478866</id><published>2010-04-06T15:14:00.000-07:00</published><updated>2010-04-06T15:14:31.682-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CNC EMC2 Machining'/><title type='text'>CNC Milling Machine</title><content type='html'>Here is a picture of my CNC mill.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_TbxRLHtVsjk/S7usP0m8YOI/AAAAAAAABvk/AyNuyA5gyIc/s1600-h/CNC_Mill.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/_TbxRLHtVsjk/S7usP0m8YOI/AAAAAAAABvk/AyNuyA5gyIc/s320/CNC_Mill.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;CNC Mill&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;In the Beginning...&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;It started off life as a small manual &lt;a href="http://www.siegind.com/product.php?id=10"&gt;Sieg X1 Micro Mill&lt;/a&gt; bought from Harbor Freight (discontinued now)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.siegind.com/images/products/20090624175316_722.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://www.siegind.com/images/products/20090624175316_722.jpg" width="184" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Then it got CNCed...&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;CNC is accomplished by NEMA23 Stepper motors from&amp;nbsp;&lt;a href="http://www.kelinginc.net/"&gt;Keling&lt;/a&gt;&amp;nbsp;and Stepper Drivers and 2 parallel port breakout boards of my own design along with a custom 42V switching power supply. &amp;nbsp;One parallel port didn't provide enough inputs and outputs to control the 3 stepper motors, home / limit switches, spindle encoder, touch probes, and flood cooling.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The motor mounting brackets and spacers were all made on the mill itself when it was still a manual mill. &amp;nbsp;The solid couplers were made on a manual mini lathe. &amp;nbsp;Not fun and I'm glad I will never have to make anything manually on this mill again.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The mill runs a closed loop spindle so the spindle speed can be set from GCode programs.&lt;/div&gt;&lt;div&gt;The mill uses dynamic tool sensing so everytime a tool is changed the length of the tool is measured on a touch off plate automatically.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Software for controlling the CNC mill is EMC2 available at&amp;nbsp;&lt;a href="http://www.linuxcnc.org/"&gt;LinuxCNC&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When everything was first put together and nicely maintained, the X and the Y would do 60 IPM rapids all day long with no problems. &amp;nbsp;Sadly after a few years of just enough maintenance to keep it running for one more job and not having the time to really take the mill apart and clean and realign everything performance has dropped down to 30 IPM rapids.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;Then it got upgraded...&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Along the way it got upgraded with these parts from LittleMachineShop&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: 'Trebuchet MS', Arial, Helvetica; font-size: 16px; font-weight: bold;"&gt;&lt;a href="http://littlemachineshop.com/products/product_view.php?ProductID=2297&amp;amp;category=1057823482" style="color: #3366cc; font-family: 'Trebuchet MS', Arial, Helvetica;"&gt;2297 Extended Y-Axis Travel Kit, Micro Mill&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: 'Trebuchet MS', Arial, Helvetica; font-size: 16px; font-weight: bold;"&gt;&lt;a href="http://littlemachineshop.com/products/product_view.php?ProductID=2642&amp;amp;category=1057823482" style="color: #3366cc; font-family: 'Trebuchet MS', Arial, Helvetica;"&gt;2642 Long Table Kit, Micro Mill&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', Arial, Helvetica; font-size: 16px; font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', Arial, Helvetica; font-size: 16px; font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', Arial, Helvetica; font-size: 16px; font-weight: bold;"&gt;&lt;table border="0" cellpadding="0" cellspacing="" style="border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); color: black; font-family: 'Trebuchet MS', Arial, Helvetica; font-style: normal;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="head_c" style="border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); font-family: 'Trebuchet MS', Arial, Helvetica; font-size: 12pt; font-style: normal; font-weight: bold; margin-bottom: 0px; margin-top: 0px;"&gt;&lt;a href="http://littlemachineshop.com/products/product_view.php?ProductID=3488&amp;amp;category=1057823482" style="color: #3366cc; font-family: 'Trebuchet MS', Arial, Helvetica;"&gt;3488 Belt Drive Conversion Kit, Micro Mill&lt;/a&gt;&lt;/td&gt;&lt;td style="border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-color: rgb(0, 0, 0); font-family: 'Trebuchet MS', Arial, Helvetica;" width="5%"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;And then I went nuts with flood cooling...&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It has a plastic enclosure surrounding the mill with doors. &amp;nbsp;The mill has flood cooling which pours a continuous stream of coolant at the cutting tool. &amp;nbsp;Before flood cooling the mill really struggled to make good clean cuts at any decent speed. &amp;nbsp;Heavy cuts would make horrible noises and it felt like the machine would shake itself apart. &amp;nbsp;With flood cooling, cuts with end mills come out very nice and machining speed has drastically improved with very little noise. &amp;nbsp;The belt drive and cutting at 6000RPM helps immensely also. &amp;nbsp;I do most of my milling in aluminum and the coolant helps carry away hot chips and keeps them from welding to the end mill especially at high RPMs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Protip:&lt;/b&gt; &amp;nbsp;Never ever ever do high speed machining and flood cooling without an enclosure. &amp;nbsp;Coolant ends up sprayed all over the room. &amp;nbsp;Don't ask how I know this...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;One day I was at Harbor Freight and there was a clearance sale...&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I was at harbor freight to pick up some tools and noticed they were clearing out all of their MT2 drill chucks for something like $10 each. &amp;nbsp;I bought all they had left. &amp;nbsp;You can see them neatly arrayed in the tool holding rack on the right side of the picture along with a bunch of end mill holders.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623070096183449009-7522834182091478866?l=tsemsb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tsemsb.blogspot.com/feeds/7522834182091478866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tsemsb.blogspot.com/2010/04/cnc-milling-machine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/7522834182091478866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623070096183449009/posts/default/7522834182091478866'/><link rel='alternate' type='text/html' href='http://tsemsb.blogspot.com/2010/04/cnc-milling-machine.html' title='CNC Milling Machine'/><author><name>Lawrence</name><uri>http://www.blogger.com/profile/04442937541322441390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TbxRLHtVsjk/S7usP0m8YOI/AAAAAAAABvk/AyNuyA5gyIc/s72-c/CNC_Mill.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
