<?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>Beaglebone Archives - www.iagent.no</title>
	<atom:link href="https://www.iagent.no/category/beaglebone/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.iagent.no/category/beaglebone/</link>
	<description>High end 3D printer electronics</description>
	<lastBuildDate>Thu, 12 May 2016 15:30:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.iagent.no/wp-content/uploads/2024/07/cropped-plain-logo-blue-32x32.png</url>
	<title>Beaglebone Archives - www.iagent.no</title>
	<link>https://www.iagent.no/category/beaglebone/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Flashing a BeagleBone Black with etcher.io</title>
		<link>https://www.iagent.no/2016/05/12/flashing-beaglebone-black-etcher-io/</link>
					<comments>https://www.iagent.no/2016/05/12/flashing-beaglebone-black-etcher-io/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Thu, 12 May 2016 15:30:27 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Kamikaze]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=1428</guid>

					<description><![CDATA[<p>The instructions for flashing a BeagleBone Black has long been in dire need of an update, and that day has finally come! The etcher.io (Etcher by RESIN.IO) is a beautifully designed app that runs on Linux, Windows and OS X alike and it does one thing: Burn images to SD cards. Since Kamikaze is based [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2016/05/12/flashing-beaglebone-black-etcher-io/">Flashing a BeagleBone Black with etcher.io</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2016/05/kamikaze-microsd-1.png"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-1434" src="http://www.thing-printer.com/wp-content/uploads/2016/05/kamikaze-microsd-1.png" alt="kamikaze-microsd" width="343" height="350" srcset="https://www.iagent.no/wp-content/uploads/2016/05/kamikaze-microsd-1.png 343w, https://www.iagent.no/wp-content/uploads/2016/05/kamikaze-microsd-1-294x300.png 294w" sizes="(max-width: 343px) 100vw, 343px" /></a></p>
<p>The instructions for flashing a BeagleBone Black has long been in dire need of an update, and that day has finally come! The etcher.io <a href="http://www.etcher.io/">(Etcher by RESIN.IO)</a> is a beautifully designed app that runs on Linux, Windows and OS X alike and it does one thing: Burn images to SD cards.</p>
<p><iframe title="Using Etcher.io for making an SD card to flash a BeagleBone" width="1290" height="726" src="https://www.youtube.com/embed/23Id20_8hWs?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>Since Kamikaze is based on the regular BeagleBone Debian distro, the instructions here should work equally well for anyone wanting to flesh the software on their BegleBones. However, keep in mind that newer versions of BeagleBone Debian distros do not have the flasher script enabled by default and will therefore only run from the microSD card on first boot.</p>
<p>The <a href="http://wiki.thing-printer.com/index.php?title=Kamikaze">Thing-printer wiki</a> has already been updated with the new burning instructions, but for reference, here are the copy-paste instructions from the video so the one other person using Linux can save an extra click. Windows and OS X users can simply install in the normal manner!</p>
<pre>cd ~/Downloads
chmod +x Etcher-linux-x64.AppImage
sudo ./Etcher-linux-x64.AppImage
</pre>
<p>The video also shows a quick run through on what to expect when flashing the BeagleBone. It&#8217;s important to note that the video is cut, and so there will be a significant delay from the first LED light-up until the cylon/night rider patterns starts.</p>
<p>Hopefully a new video will come out soon showing the second part of getting started with a run down of how to connect the BeagleBone to your network and showing the first move. There was recently a poll on the <a href="https://plus.google.com/communities/104577360369030938514">Thing printer G+ page</a>, and so documentation is still a priority for many.</p>
<p>The post <a href="https://www.iagent.no/2016/05/12/flashing-beaglebone-black-etcher-io/">Flashing a BeagleBone Black with etcher.io</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2016/05/12/flashing-beaglebone-black-etcher-io/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Filament sensor on 3D printer with Replicape</title>
		<link>https://www.iagent.no/2016/04/23/filament-sensor-3d-printer-replicape/</link>
					<comments>https://www.iagent.no/2016/04/23/filament-sensor-3d-printer-replicape/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 16:11:28 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Redeem]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=1312</guid>

					<description><![CDATA[<p>Increased reliability with a filament sensor One of the most annoying things that can happen when printing with 3D-printers is running out of filament or a filament jam. Both are almost unavoidable. There is no infinite filament (yet) and even the best filament manufacturers some times end up with foreign objects in their plastic batches. [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2016/04/23/filament-sensor-3d-printer-replicape/">Filament sensor on 3D printer with Replicape</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><iframe title="Filament sensor using rotary encoder on Replicape" width="1290" height="726" src="https://www.youtube.com/embed/v7Xa20eVqRM?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p><strong>Increased reliability with a filament sensor</strong></p>
<p>One of the most annoying things that can happen when printing with 3D-printers is running out of filament or a filament jam. Both are almost unavoidable. There is no infinite filament (yet) and even the best filament manufacturers some times end up with foreign objects in their plastic batches. The thing that will separate current and future 3D-printers is most likely more sensors for monitoring stuff. Take a leap into the future right away by adding a rotary encoder based filament monitor to your <a href="http://www.thing-printer.com/product/replicape/">Replicape</a> controlled 3D-printer!</p>
<p>Replicape has support for incremental <a href="https://en.wikipedia.org/wiki/Rotary_encoder">rotary encoders</a> that can be used to monitor the movement of filament past the encoder. Typically a rotary encoder will give off discrete signals as a result of angular movement in one direction. The signals can be used to sense the direction and amount of angular movement the rotary encoder has done, which in turn can be converted into amount of filament consumed by knowing the diameter of the rotary encoders shaft. This information will need to be given to Redeem, in the section <a href="http://wiki.thing-printer.com/index.php?title=Redeem#Rotary-encoders">Rotary-encoders</a>.</p>
<p><b>Software side</b><br />
Behind the scenes, <a href="http://wiki.thing-printer.com/index.php?title=Redeem">Redeem</a> uses Linux&#8217;s <a href="https://www.kernel.org/doc/Documentation/input/rotary-encoder.txt">rotary encoder kernel driver</a>, which simplifies the development and maintainability of this feature. In order to enable this, you will need to know the number of cycles pr. revolution your encoder emits (cpr-e), the diameter of the wheel brushing against the filament and (diameter-e), and the device on which the events are reported, typically /dev/event/input1 (event-e). The big problem with the current setup is that you you need to reconfigure the devicetree in order to activate the rotary encoder kernel module. There is a document for the Linux kernel describing this binding: <a href="http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/input/rotary-encoder.txt">http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/input/rotary-encoder.txt</a>.</p>
<pre>           rotary@0 {
                compatible = "rotary-encoder";
                gpios = &lt;&amp;gpio3 17 0&gt;, &lt;&amp;gpio0 4 0&gt;;
                linux,axis = ; /* REL_X */
                rotary-encoder,relative-axis;
            };
</pre>
<p>Since the input device needs to be mentioned in the config file, it might be a good idea to also set up a udev rule symlinking the rotary encoder to a known name. That way, it will always get the same device name. Here is an example:</p>
<pre>nano  /etc/udev/rules.d/99-rotary.rules
</pre>
<p>Place this into that file:</p>
<pre>SUBSYSTEM=="input", ACTION=="add", ATTRS{name}=="ocp:rotary@2", SYMLINK+="rotary0"
</pre>
<p>A working rotary encoder setup for extruder E will look like this:</p>
<pre>[Rotary-encoders]
enable-e = True
event-e = /dev/rotary0
cpr-e = -360
diameter-e = 0.003
</pre>
<p>Place this into:</p>
<pre>/etc/redeem/local.cfg
</pre>
<p>Notice that the event device name (event-e) corresponds to what was set up with the udev rule.</p>
<p>It is also possible to set up an alarm that will trigger if the sensor deviates too much from what it should be.<br />
If you want an alarm for that, set that up like the following:</p>
<pre>[Filament-sensors]
# If the error is &gt; 10 cm, sound the alarm
alarm-level-e = 0.1
</pre>
<p>Currently, if an alarm is triggered, it will send a &#8220;pause&#8221; action command to OctoPrint.</p>
<p>To visualize the filament use, <a href="http://wiki.thing-printer.com/index.php?title=Toggle">Toggle</a> now has a built in filament graph. To show it, simply tap the temperature graph to toggle between temperature and filament. To enable the streaming of data from Redeem, use the G-code (or M-code) M409. The token E enables all filament sensors connected, while D disables all. You can also specify which sensor to stream for by using an index after the &#8220;E&#8221;, so M409 E0 enables streaming for extruder 0 (E).</p>
<p><b>Electronics part</b><br />
On the hardware side, two end-stop inputs are needed since a rotary encoder has two outputs. In addition to this they typically need a 5V-ish power source (+5V and GND). All of this can be taken from two end stops on Replicape. In the video posted, I&#8217;m using a rotary encoder left by a master student. A quick google search reveals that it is a <a href="http://www.usdigital.com/products/s4">s4-360-125-b-d</a>, a $100 super smooth optical encoder. While doing research, I also ordered a few cheap rotary encoders from Digi-key, but soon realized that &#8220;retention&#8221; is not something you want, since it causes &#8220;drag&#8221; on the encoder. Useful if you want to use it for a user interface, but not so great if you want no additional force for your extruder. These from Digi-key work, but are not recommended for this particular purpose:<br />
<a href="http://www.digikey.no/product-detail/en/C14D32P-A3/102-1923-ND/2039183">http://www.digikey.no/product-detail/en/C14D32P-A3/102-1923-ND/2039183</a><br />
<a href="http://www.digikey.no/product-search/en?keywords=102-1763-nd">http://www.digikey.no/product-search/en?keywords=102-1763-nd</a></p>
<p><b>Mechanical part</b><br />
So using the US digital rotary encoder, I created a simple &#8220;slide along&#8221; filament sensor. It relies on the filament being pushed towards the rotary encoder shaft causing it to rotate. This solution is not ideal, and will easily cause wrongful measurements, from what i have experienced, but it does suffice for a simple experiment.<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2016/04/2016-04-23-17.58.17.jpg"><img loading="lazy" decoding="async" class="size-large wp-image-1396 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2016/04/2016-04-23-17.58.17-1024x768.jpg" alt="2016-04-23 17.58.17" width="1024" height="768" srcset="https://www.iagent.no/wp-content/uploads/2016/04/2016-04-23-17.58.17-1024x768.jpg 1024w, https://www.iagent.no/wp-content/uploads/2016/04/2016-04-23-17.58.17-scaled-800x600.jpg 800w, https://www.iagent.no/wp-content/uploads/2016/04/2016-04-23-17.58.17-300x225.jpg 300w, https://www.iagent.no/wp-content/uploads/2016/04/2016-04-23-17.58.17-768x576.jpg 768w, https://www.iagent.no/wp-content/uploads/2016/04/2016-04-23-17.58.17-1536x1152.jpg 1536w, https://www.iagent.no/wp-content/uploads/2016/04/2016-04-23-17.58.17-2048x1536.jpg 2048w, https://www.iagent.no/wp-content/uploads/2016/04/2016-04-23-17.58.17-600x450.jpg 600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The post <a href="https://www.iagent.no/2016/04/23/filament-sensor-3d-printer-replicape/">Filament sensor on 3D printer with Replicape</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2016/04/23/filament-sensor-3d-printer-replicape/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Redeem new features preview</title>
		<link>https://www.iagent.no/2015/10/09/redeem-new-features-preview/</link>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Fri, 09 Oct 2015 19:17:54 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Redeem]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=1003</guid>

					<description><![CDATA[<p>Redeem, the Replicape Daemon, is the &#8220;firmware&#8221; that accepts g-codes and makes the 3D-printer move. What is special about this firmware is that it is mostly written in a high level language. Python is not the fastest language around, but offers a large array of libraries optimized in C, garbage collection, favours readability and has [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/10/09/redeem-new-features-preview/">Redeem new features preview</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/04/Redeem_header.png"><img loading="lazy" decoding="async" class="size-full wp-image-654 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/04/Redeem_header.png" alt="Redeem_header" width="960" height="480" srcset="https://www.iagent.no/wp-content/uploads/2015/04/Redeem_header.png 960w, https://www.iagent.no/wp-content/uploads/2015/04/Redeem_header-800x400.png 800w, https://www.iagent.no/wp-content/uploads/2015/04/Redeem_header-300x150.png 300w, https://www.iagent.no/wp-content/uploads/2015/04/Redeem_header-768x384.png 768w, https://www.iagent.no/wp-content/uploads/2015/04/Redeem_header-600x300.png 600w" sizes="auto, (max-width: 960px) 100vw, 960px" /></a></p>
<p><a href="http://wiki.thing-printer.com/index.php?title=Redeem">Redeem</a>, the <a href="https://www.kickstarter.com/projects/1924187374/replicape-a-smart-and-quiet-3d-printer-control-boa/">Replicape</a> Daemon, is the &#8220;firmware&#8221; that accepts g-codes and makes the 3D-printer move. What is special about this firmware is that it is mostly written in a high level language. Python is not the fastest language around, but offers a large array of libraries optimized in C, garbage collection, favours readability and has very good integration with C/C++. That way most of the code base can be kept in Python, with only a small core optimized in C.</p>
<p>The native path planner, was originally ported from <a href="http://www.repetier.com/">Repetier</a> firmware. The porting was done by Mathieu Monney, and although it has worked great, there have been certain short comings with the code base. Looking through any firmware for 3D-printers, you will see a well of pre-processor directives to optimize the code at compile time based on what type of machine the code will be running on. That is necessary when you have 16 MHz of processing power, 256 KB of total flash storage and 8 KB of SRAM. However, using a modern day platform with 1000 MHz of processing power, 4 GB of flash storage and 512 MB of DDR3 SRAM, the need for compile time optimizations diminishes severely. Add to that a floating point unit, and you no longer have to weigh every use of floats in the code.</p>
<p>An effort has therefore been to move the native path planner into something more suited for BeagleBone Black and similar speced platforms. A side effect to this has been to make the whole path planner more stepper agnostic, meaning that the path planner no longer has any concept of what each axis does what, and will simply merge each axis using the <a href="https://en.wikipedia.org/wiki/Bresenham's_line_algorithm">Bresenham</a> algorithm. This enables doing some pretty fancy things, such as having one or more steppers operate in &#8220;<a href="https://bitbucket.org/intelligentagent/redeem/src/2df52dcccf52?at=slave_stepper">slave mode</a>&#8220;, easily adding more stepper motors, in order to facilitate <a href="https://www.kickstarter.com/projects/wr3d/the-diamond-hotend-single-nozzle-multi-color-3d-pr">color mixing</a> etc. It could also be used to specify what each axis does in run time, if one was so inclined.</p>
<p>I&#8217;ve recently done some development on this, and although it&#8217;s still a fairly early proof of concept, printing objects do work and slave mode seems to behave as it should. I made a quick video showing a demo, along with an explanation.</p>
<p><iframe loading="lazy" src="https://www.youtube.com/embed/2uXw5w5nJiM" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p>The post <a href="https://www.iagent.no/2015/10/09/redeem-new-features-preview/">Redeem new features preview</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Replicape rev B Kickstarter is live!</title>
		<link>https://www.iagent.no/2015/10/05/replicape-rev-b-kickstarter-is-live/</link>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Mon, 05 Oct 2015 19:09:55 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=989</guid>

					<description><![CDATA[<p>The wait is over, folks! Replicape revision B is now live on Kickstarter! If you are reading this on Thing-printer.com, you probably know about Replicape, and are mostly interested in what&#8217;s new with Rev B compared to Rev A! Here is an overview. In more human readable form, the most important update is the new [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/10/05/replicape-rev-b-kickstarter-is-live/">Replicape rev B Kickstarter is live!</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/10/Replicape-front-page-picture.png"><img loading="lazy" decoding="async" class="size-large wp-image-986 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/10/Replicape-front-page-picture-1024x566.png" alt="Replicape front page picture" width="1024" height="566" /></a></p>
<p>The wait is over, folks! <a href="https://www.kickstarter.com/projects/1924187374/1332696678?token=089d18fe">Replicape revision B is now live on Kickstarter! </a>If you are reading this on Thing-printer.com, you probably know about Replicape, and are mostly interested in what&#8217;s new with Rev B compared to Rev A! Here is an overview.</p>
<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/10/B_vs_A_21.png"><img loading="lazy" decoding="async" class="size-large wp-image-991 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/10/B_vs_A_21-668x1024.png" alt="B_vs_A_2" width="668" height="1024" srcset="https://www.iagent.no/wp-content/uploads/2015/10/B_vs_A_21-668x1024.png 668w, https://www.iagent.no/wp-content/uploads/2015/10/B_vs_A_21-800x1226.png 800w, https://www.iagent.no/wp-content/uploads/2015/10/B_vs_A_21-196x300.png 196w, https://www.iagent.no/wp-content/uploads/2015/10/B_vs_A_21-768x1177.png 768w, https://www.iagent.no/wp-content/uploads/2015/10/B_vs_A_21-1002x1536.png 1002w, https://www.iagent.no/wp-content/uploads/2015/10/B_vs_A_21-600x919.png 600w, https://www.iagent.no/wp-content/uploads/2015/10/B_vs_A_21.png 1240w" sizes="auto, (max-width: 668px) 100vw, 668px" /></a>In more human readable form, the most important update is the new stepper drivers. TMC2100 are slightly less powerful than the old DRV8825s, but offer a few advantages. There are now 8 different configurations for the decay modes, as well as the option of interpolation of micro stepping up to 256. In combination with a four layer PCB and a better stepper driver layout, this makes the driver more suitable all around.</p>
<p>Thomas Sanladerer did a test of the SilentStick that has the same drivers on them. His conclusions were very helpful in choosing the new drivers. Here is his review for reference:</p>
<p><iframe loading="lazy" src="https://www.youtube.com/embed/P3ebhi-vZRY" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p>&nbsp;</p>
<p>The post <a href="https://www.iagent.no/2015/10/05/replicape-rev-b-kickstarter-is-live/">Replicape rev B Kickstarter is live!</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Beta testers, start your engines! A new Replicape is coming!</title>
		<link>https://www.iagent.no/2015/09/08/beta-testers-start-your-engines-replicape/</link>
					<comments>https://www.iagent.no/2015/09/08/beta-testers-start-your-engines-replicape/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Tue, 08 Sep 2015 20:36:15 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=944</guid>

					<description><![CDATA[<p>The last of the beta tester boards for Replicape Revision B were shipped out today! Now comes a couple of weeks of testing for the selected testers followed by a big decision: Are they good enough for the Kickstarter! If the testers give the board their go, that is to say they have not found [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/09/08/beta-testers-start-your-engines-replicape/">Beta testers, start your engines! A new Replicape is coming!</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/09/Replicape-teaser.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-945 size-large" src="http://www.thing-printer.com/wp-content/uploads/2015/09/Replicape-teaser-1024x683.png" alt="Replicape teaser" width="1024" height="683" srcset="https://www.iagent.no/wp-content/uploads/2015/09/Replicape-teaser-1024x683.png 1024w, https://www.iagent.no/wp-content/uploads/2015/09/Replicape-teaser-800x533.png 800w, https://www.iagent.no/wp-content/uploads/2015/09/Replicape-teaser-300x200.png 300w, https://www.iagent.no/wp-content/uploads/2015/09/Replicape-teaser-768x512.png 768w, https://www.iagent.no/wp-content/uploads/2015/09/Replicape-teaser-1536x1024.png 1536w, https://www.iagent.no/wp-content/uploads/2015/09/Replicape-teaser-2048x1365.png 2048w, https://www.iagent.no/wp-content/uploads/2015/09/Replicape-teaser-600x400.png 600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a>The last of the beta tester boards for Replicape Revision B were shipped out today! Now comes a couple of weeks of testing for the selected testers followed by a big decision: Are they good enough for the Kickstarter!</p>
<p>If the testers give the board their go, that is to say they have not found any major flaws, the Kickstarter campaign is launched. Two of the beta testers are located in California, so Bent and I will jump in a car and do a road trip and visit them to do an in-depth interview about what they think of the new Replicape.</p>
<p>I&#8217;ve had a lot of fun making the Kickstarter video for this board, just building (3D-printing) epic camera jigs and testing the new functionalities of the board, both the inductive sensor input and the servo controllers seem to be working as they should.</p>
<p>[evp_embed_video url=&#8221;https://scontent.cdninstagram.com/hphotos-xaf1/t50.2886-16/11773411_1625067334424660_928462397_n.mp4&#8243; loop=&#8221;true&#8221; autoplay=&#8221;true&#8221;]</p>
<h3>Logistics FTW</h3>
<p>One thing I should mention about this KS. Since the PCB production is curated by <a href="http://elmatica.no/">Elmatica</a>, there is no need to wait for the campaign to finish before production starts. They will secure the middle financing. Therefore, as soon as we hit 100 sold units, that is enough to start production! Hopefully that happens within the first few days of the campaign, and so delivery can happen way sooner than 30 days + production.</p>
<p>Another thing worth mentioning is the options for shipping. Elmatica are orders of magnitude better at logistics than a small start-up company, so they will help with securing the shipping agreements, securing swift and super cheap shipping!</p>
<p>The post <a href="https://www.iagent.no/2015/09/08/beta-testers-start-your-engines-replicape/">Beta testers, start your engines! A new Replicape is coming!</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2015/09/08/beta-testers-start-your-engines-replicape/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		<enclosure url="https://scontent.cdninstagram.com/hphotos-xaf1/t50.2886-16/11773411_1625067334424660_928462397_n.mp4" length="1636094" type="video/mp4" />

			</item>
		<item>
		<title>Cape manager is back baby!</title>
		<link>https://www.iagent.no/2015/07/13/cape-manager-is-back-baby/</link>
					<comments>https://www.iagent.no/2015/07/13/cape-manager-is-back-baby/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Mon, 13 Jul 2015 16:43:29 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Redeem]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=844</guid>

					<description><![CDATA[<p>For BeagleBone Black the cape manager has been missing or somewhat broken since 3-odd-8 or something, but with Linux kernel 4.1, it&#8217;s back in business (a part of mainline kernel)! That means you no longer have to recompile the whole device tree in order to enable or disable an IP core slash peripheral, instead you [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/07/13/cape-manager-is-back-baby/">Cape manager is back baby!</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/07/cape-manager.jpg"><img loading="lazy" decoding="async" class="aligncenter wp-image-886 size-large" src="http://www.thing-printer.com/wp-content/uploads/2015/07/cape-manager-e1436801580611-1024x613.jpg" alt="cape manager" width="1024" height="613" srcset="https://www.iagent.no/wp-content/uploads/2015/07/cape-manager-e1436801580611-1024x613.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/07/cape-manager-e1436801580611-800x479.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/07/cape-manager-e1436801580611-300x180.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/07/cape-manager-e1436801580611-768x460.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/07/cape-manager-e1436801580611-1536x919.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/07/cape-manager-e1436801580611-2048x1226.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/07/cape-manager-e1436801580611-600x359.jpg 600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
For BeagleBone Black the cape manager has been missing or somewhat broken since 3-odd-8 or something, but with Linux kernel 4.1, it&#8217;s <a href="https://plus.google.com/108019867520491227967/posts/1x2nkiFoDCG">back in business</a> (a part of mainline kernel)! That means you no longer have to recompile the whole device tree in order to enable or disable an IP core slash peripheral, instead you can simply compile the overlay and fix the device tree in the running kernel. This simplifies development and there are also some good tools and a repo for pushing these changes out.</p>
<p><b>What it does</b><br />
Without cape manager, you basically have one single device tree blog that is loaded when the kernel starts. If you want to change which peripherals are enabled, you need to recompile the device and reboot. With cape manager, you can choose to change parts of the device tree in a running kernel. This enables loading cape-specific overlays based on the cape that is attached (read from the EEPROM of the cape) or via command line to enable a specific peripheral or mux the pins to a specific function. This is what the Adafruit BBIO library does behind the scenes.</p>
<p><b>Get started with cape manager</b><br />
Start with a fresh Debian distro. <a href="http://beagleboard.org/latest-images">The official Debain image form March</a> should do.<br />
Install the newest kernel:</p>
<pre>apt-cache search linux-image
</pre>
<p>Pick one of the latest, for instance &#8220;linux-image-4.1.1-bone10&#8221;:</p>
<pre>apt-get install linux-image-4.1.1-bone10
</pre>
<p>Clone the <a href="https://github.com/RobertCNelson/bb.org-overlays">bb.org device tree overlay repository</a>:</p>
<pre>cd /usr/src
git clone https://github.com/RobertCNelson/bb.org-overlays
cd bb.org-overlays
</pre>
<p>Follow the instructions on how to use upgrade and use the cape manager from there. The instructions are good, basically:<br />
&#8211; Upgrade the DTC<br />
&#8211; compile the overlays.</p>
<p><b>Tools for checking your work</b><br />
The cape manager is now located in a more static location in the sys fs than before. The new location is:</p>
<pre>cat /sys/devices/platform/bone_capemgr/slots
</pre>
<p>To see which capes are loaded, cat it.<br />
If you are working on pin-muxing there are a couple of files that can be useful to cat:</p>
<pre>cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins
</pre>
<p>This file will give you the pin number, the adress of the pin in physical memory and to which function it has been muxed (1 to 7). It will also tell you if it is set up as input/output in the case of GPIO (function 7) and if it has pull-up or pull-down.<br />
Another useful sysfs file is this:</p>
<pre>cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups
</pre>
<p>This can be used to check that a pin has been claimed in the overlay. Very useful for making sure that the groups you add to the <b>am33xx_pinmux</b> node are actually set up as you want them to be.</p>
<p><b>Helpful #define files</b><br />
A while back I posted a <a href="http://hipstercircuits.com/enable-serialuarttty-on-beaglebone-black/">table with the mapping from the headers</a> exposing the different pins on the BeagleBone to the physical address of the pins. For a while now there has been a header file defining this mapping and providing user friendly names that can be used for pin muxing. By adding the following includes to the header of your device tree overlay source files, you can use the pin names from the exposed headers verbatim:</p>
<pre>#include &lt;<a href="https://github.com/beagleboard/bb.org-overlays/blob/master/include/dt-bindings/board/am335x-bbw-bbb-base.h">dt-bindings/board/am335x-bbw-bbb-base.h</a>&gt;
#include &lt;<a href="https://github.com/beagleboard/bb.org-overlays/blob/master/include/dt-bindings/pinctrl/am33xx.h">dt-bindings/pinctrl/am33xx.h</a>&gt;
</pre>
<p>Instead of writing</p>
<pre>    dallas_w1_pins: pinmux_dallas_w1_pins {
        pinctrl-single,pins = &lt; 0x150 0x37 // Dallas 1W &gt;;
    };
</pre>
<p>You can now write</p>
<pre>    dallas_w1_pins: pinmux_dallas_w1_pins {
        pinctrl-single,pins = &lt; BONE_P9_22 (INPUT_EN | PIN_PULLUP | MUX_MODE7) &gt;;
    };
</pre>
<p>so this saves you from having to look up the pins in a table.</p>
<p><b>caveats in porting old overlays</b><br />
A while back I ported the patches for the <a href="http://www.thing-printer.com/converting-device-tree-overlays-kernel-3-12/">cape manager to a kernel 3.12</a> for use in an Angstrom based distro. If you want to port an old cape from the kernel 3.8 era, you will notice that there are a couple of changes. Most importantly that the GPIO banks used to go from 1 to 4, but now go from 0 to 3. Also, the UARTs/serials go from 0 to 6 to match /dev/ttyO* in the file system. You can see this by peeking into the am33xx.dtsi (device tree source inclue file) in the mainline kernel repository: <a href="https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/am33xx.dtsi#L168">https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/am33xx.dtsi#L168</a></p>
<p>The post <a href="https://www.iagent.no/2015/07/13/cape-manager-is-back-baby/">Cape manager is back baby!</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2015/07/13/cape-manager-is-back-baby/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
		<item>
		<title>Power dissipation calculations in MOSFETs</title>
		<link>https://www.iagent.no/2015/07/07/power-dissipation-calculations-in-mosfets/</link>
					<comments>https://www.iagent.no/2015/07/07/power-dissipation-calculations-in-mosfets/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Tue, 07 Jul 2015 12:43:17 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=809</guid>

					<description><![CDATA[<p>One of the key elements of electronics design beyond the elementary workings of the circuits is the thermal management and the EMC (Electro Magnetic Compatibility). On a 3D-printer controller board, the MOSFETs tend to be one of the major contributors to both the EMC part as well as the thermal management part. For Replicape Rev [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/07/07/power-dissipation-calculations-in-mosfets/">Power dissipation calculations in MOSFETs</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/06/mosfet_hot_cold.jpg"><img loading="lazy" decoding="async" class="aligncenter wp-image-839 size-large" src="http://www.thing-printer.com/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-1024x613.jpg" alt="mosfet_hot_cold" width="1024" height="613" srcset="https://www.iagent.no/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-1024x613.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-800x479.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-300x180.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-768x460.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-1536x919.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-2048x1226.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/06/mosfet_hot_cold-e1433491425417-600x359.jpg 600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>One of the key elements of electronics design beyond the elementary workings of the circuits is the thermal management and the <a href="https://en.wikipedia.org/wiki/Electromagnetic_compatibility">EMC</a> (Electro Magnetic Compatibility). On a 3D-printer controller board, the MOSFETs tend to be one of the major contributors to both the EMC part as well as the thermal management part.</p>
<p>For <a href="http://www.thing-printer.com/new-major-revision-of-replicape-rev-b/">Replicape Rev B</a>, I&#8217;ve opted to cut out the gate drivers on the MOSFETs in favour of having the gates driven directly form the PWM driver (<a href="http://www.nxp.com/products/lighting_driver_and_controller_ics/i2c_led_display_control/series/PCA9685.html">PCA9685</a>). The main reason for this was to cut down cost in order to reach the target price of $99 MSRP, but this was only after careful consideration and calculation of the expected heat dissipation from the MOSFETs driving the extruder heaters and heated build plate. I do not recommend doing this if you are going to drive the MOSFETs directly from a <a href="http://www.beagleboard.org/">BeagleBone Black</a>. It has a mere 6 mA source current and 4 mA sink current on the output pins as well as only 3.3 V output causing the MOSFETs to spend more time in transitions and (most likely) have a higher Rdson value due to the lower gate voltage.</p>
<p>The first prototype board is now back, thank you <a href="http://elmatica.no/">Elmatica</a> for the quick service and supberb PCBs! I can compare the calculations to actual measurements to better calculate the heat dissipation from each of the MOSFETs. The strange thing is that the rise time across the load did not change for the worse as expected, instead it improved! Considerably!</p>
<p>Here is a picture of the layout of the PCB. The MOSFETs are those three in line with the fuse. The fuse is the yellow thing.<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/07/heaters.jpg"><img loading="lazy" decoding="async" class="aligncenter wp-image-874 size-large" src="http://www.thing-printer.com/wp-content/uploads/2015/07/heaters-1024x576.jpg" alt="heaters" width="1024" height="576" srcset="https://www.iagent.no/wp-content/uploads/2015/07/heaters-1024x576.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/07/heaters-scaled-800x450.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/07/heaters-300x169.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/07/heaters-768x432.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/07/heaters-1536x864.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/07/heaters-2048x1152.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/07/heaters-600x338.jpg 600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Here are some of the important parameters:<br />
PWM frequency: 1 KHz</p>
<p>Replicape Rev A4A:<br />
Gate voltage: [latex]12 V[/latex]<br />
Rise time measured across load: [latex]50 ns[/latex]<br />
Fall time measured across load: [latex]200 ns[/latex]<br />
[latex]R_{DS(ON)}[/latex] at [latex]12V(GS)[/latex] is [latex]3 m \Omega[/latex]<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/06/Rev-A4A.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-855" src="http://www.thing-printer.com/wp-content/uploads/2015/06/Rev-A4A-300x208.png" alt="Rev A4A" width="300" height="208" srcset="https://www.iagent.no/wp-content/uploads/2015/06/Rev-A4A-300x208.png 300w, https://www.iagent.no/wp-content/uploads/2015/06/Rev-A4A-800x556.png 800w, https://www.iagent.no/wp-content/uploads/2015/06/Rev-A4A-768x534.png 768w, https://www.iagent.no/wp-content/uploads/2015/06/Rev-A4A-600x417.png 600w, https://www.iagent.no/wp-content/uploads/2015/06/Rev-A4A.png 904w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><a href="http://www.thing-printer.com/wp-content/uploads/2015/06/20150603_114453.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-814" src="http://www.thing-printer.com/wp-content/uploads/2015/06/20150603_114453-300x222.jpg" alt="20150603_114453" width="300" height="222" srcset="https://www.iagent.no/wp-content/uploads/2015/06/20150603_114453-300x222.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114453-scaled-800x593.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114453-1024x758.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114453-768x569.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114453-1536x1137.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114453-2048x1516.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114453-600x444.jpg 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a> <a href="http://www.thing-printer.com/wp-content/uploads/2015/06/20150603_114429.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-815" src="http://www.thing-printer.com/wp-content/uploads/2015/06/20150603_114429-300x215.jpg" alt="20150603_114429" width="300" height="215" srcset="https://www.iagent.no/wp-content/uploads/2015/06/20150603_114429-300x215.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114429-scaled-800x574.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114429-1024x734.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114429-768x551.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114429-1536x1102.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114429-2048x1469.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/06/20150603_114429-600x430.jpg 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Replicape Rev B1:<br />
Gate voltage: [latex]5 V[/latex]<br />
Fall time measured across load: [latex]50 ns[/latex]<br />
Rise time measured across load: [latex]50 ns[/latex]<br />
[latex]R_{DS(ON)}[/latex] at [latex]5 V(GS)[/latex] is [latex]4 m \Omega[/latex]</p>
<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/06/Rev-B1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-857" src="http://www.thing-printer.com/wp-content/uploads/2015/06/Rev-B1-300x231.png" alt="Rev B1" width="300" height="231" srcset="https://www.iagent.no/wp-content/uploads/2015/06/Rev-B1-300x231.png 300w, https://www.iagent.no/wp-content/uploads/2015/06/Rev-B1-600x462.png 600w, https://www.iagent.no/wp-content/uploads/2015/06/Rev-B1.png 732w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><a href="http://www.thing-printer.com/wp-content/uploads/2015/06/20150602_200335.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-817" src="http://www.thing-printer.com/wp-content/uploads/2015/06/20150602_200335-300x218.jpg" alt="20150602_200335" width="300" height="218" srcset="https://www.iagent.no/wp-content/uploads/2015/06/20150602_200335-300x218.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/06/20150602_200335-scaled-800x581.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/06/20150602_200335-1024x744.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/06/20150602_200335-768x558.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/06/20150602_200335-1536x1116.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/06/20150602_200335-2048x1488.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/06/20150602_200335-600x436.jpg 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><a href="http://www.thing-printer.com/wp-content/uploads/2015/06/20150602_200957.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-816" src="http://www.thing-printer.com/wp-content/uploads/2015/06/20150602_200957-300x219.jpg" alt="20150602_200957" width="300" height="219" /></a></p>
<p><strong>Why has it improved?</strong></p>
<p>Looking at the schematic for the Rev A4A and the Rev B1 board, the difference is the lack of a gate driver in the latter. The gate drivers from the Rev A4 board has a drive capacity of 500 mA both source and sink. This is great if the load that is being switched is in close proximity to the MOSFET, but on a 3D-printer, the load is usually located about a meter away from the board, causing the heater cable to act as an antenna. Therefore, a series resistor of [latex]100 \Omega[/latex] was introduced in series on the gate pin order to limit the rise and fall times and thus limit the bandwidth of the &#8220;antenna&#8221;. Apparently, the guy doing the calculations on the series resistor was a little eager so the resulting slope became too flat. By removing the gate driver and the series resistor, the slope is instead limited by the maximum source and sink currents of the PWM driver, 10 mA and 25 mA respectively.</p>
<p>The rest of this post will show the calculations on where power is dissipated in the MOSFET and compare the two designs.</p>
<p><b>Power dissipation during on-time.</b><br />
To get a base-line on what the worst case heat dissipation is, calculations are done for a MOSFET being fully-on (in saturation) 100% of the period. Looking at the data sheet for AON6758 (figure 3), the [latex]R_{DS(ON)} = 4 m\Omega[/latex] for[latex] V_{GS} = 4.5 V[/latex]. All measurements have been done with a 40W @ 12 V heater element giving a current of<br />
[latex]I_D = \frac{P}{U} = \frac{40 W}{12 V} = 3.33 A [/latex]<br />
and having a resistance of<br />
[latex]R_{HEATER} = \frac{U}{I_D} = \frac{12 V}{3.33 A} = 3.6 \Omega[/latex]<br />
Knowing the current through the heater and the on-resistance of the MOSFET, we can calculate the power dissipated in the MOSFET:<br />
[latex]P_{MOSFET} = U_{DS} I_{D} = R_{DS(ON)}xI_{D}^2 = 0.004 \Omega x 3.33^2 A = 0.044 W[/latex]</p>
<p>On Replicape Rev A4A, the gate driver gave a [latex]V_{GS}[/latex] of 12 V which in turn gave an [latex]R_{DS(ON)} = 3 m\Omega[/latex], giving a heat dissipation of 0.033 W.</p>
<p><b>Power dissipation during off-time</b><br />
For completeness, I&#8217;m including the power dissipation during off-time as well. Intuitively it is negligible, but let&#8217;s grab the boob and do the math to be sure.<br />
Looking at the data sheet, the leakage current when the MOSFET is fully off is<br />
[latex]I_{DSS} = 0.5 mA[/latex] for [latex]V_{GS} = 0 V[/latex]<br />
In this case all the voltage lies across the drain-source, so we have<br />
[latex]P_{DSS} = U_{DS} \times I_{DSS} = 12V \times 0.5 mA = 0.006 W[/latex]<br />
This is an order of magnitude lower than on-time, but this increases as a function of temperature up to a reported 100 mA for a junction temperature of 125 degrees.</p>
<p><b>Power dissipation during transitions.</b><br />
So what about during the transitions? To calculate that, it&#8217;s necessary to look at the power as a function of time. The average power is the integral of the pulse divided by the period. Look:<br />
[latex] P_\mathrm{avg} = \frac{1}{T} \int_{0}^{T}p(t) \mathrm{d}t [/latex]<br />
Looking at the rise and fall transitions, we can approximate the curve by a second order polynomial curve. With a little trial and error,<br />
I landed on the following values:<br />
[latex] V(t) = 4.4 \times 10^{8} t + 4.0 \times 10^{15} t^2 [/latex]<br />
From this, the drain current was calculated and also the voltage across the drain and source of the MOSFET giving the necessary<br />
parameters for modelling the power dissipated in the MOSFET during the transitions. Here is a plot of the [latex]V_{DS}[/latex], the drain current and the resulting power dissipated. Note that even though the peak power reaches 10 W, this is only for a short time. The picture below shows the plot of the voltage across the MOSFET, the current going through it and the resulting power being dissipated during a rise transition.</p>
<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/06/figure_1.png"><img loading="lazy" decoding="async" class="alignnone wp-image-832 size-large" src="http://www.thing-printer.com/wp-content/uploads/2015/06/figure_1-1024x746.png" alt="figure_1" width="1024" height="746" srcset="https://www.iagent.no/wp-content/uploads/2015/06/figure_1-1024x746.png 1024w, https://www.iagent.no/wp-content/uploads/2015/06/figure_1-800x583.png 800w, https://www.iagent.no/wp-content/uploads/2015/06/figure_1-300x219.png 300w, https://www.iagent.no/wp-content/uploads/2015/06/figure_1-768x560.png 768w, https://www.iagent.no/wp-content/uploads/2015/06/figure_1-600x437.png 600w, https://www.iagent.no/wp-content/uploads/2015/06/figure_1.png 1367w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Some quick calculations reveal that<br />
[latex]P_{AVG} = \frac{1}{T}\int_0^T At &#8211; Bt^2 dt = \frac{1}{T}(\frac{1}{2}At^2 &#8211; \frac{1}{3}Bt^3) |_0^T[/latex]<br />
[latex]= \frac{1}{T}(\frac{1}{2}AT^2 &#8211; \frac{1}{3}BT^3) = \frac{1}{2}AT &#8211; \frac{1}{3}BT^2[/latex]<br />
Using the values from before, reveals an effect loss of 7.66 W during the rise transition. a Similar value can be expected during the fall transition.</p>
<p><b>Steady state heat dissipation</b><br />
For a 50% duty cycle at 1 KHz the average dissipation will then be <b>0.78 W</b>. Now please note that this is a fairly crude first order<br />
approach to the heat dissipation calculations. Still, with the right layout with at least 1 in^2 copper, the packages should be able to dissipate between 2.6 and 4.1 W according to the data sheet which is far below what these calculations show. Comparing this to <a href="http://www.reprap.org/wiki/Basics_about_switching_loads_with_MOSFETs">some of the other boards</a> that has had this calculation done for them, it looks pretty good!</p>
<p>The post <a href="https://www.iagent.no/2015/07/07/power-dissipation-calculations-in-mosfets/">Power dissipation calculations in MOSFETs</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2015/07/07/power-dissipation-calculations-in-mosfets/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>New Kamikaze CNC image released</title>
		<link>https://www.iagent.no/2015/06/30/new-kamikaze-cnc-image-released/</link>
					<comments>https://www.iagent.no/2015/06/30/new-kamikaze-cnc-image-released/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Tue, 30 Jun 2015 15:27:20 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Manga Screen]]></category>
		<category><![CDATA[Redeem]]></category>
		<category><![CDATA[Replicape]]></category>
		<category><![CDATA[Toggle]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=850</guid>

					<description><![CDATA[<p>Kamikaze is a Debian-based eMMC flasher image for BeagleBone Black. It is a complete solution for Replicape and Manga-Screen aiming to contain all software needed to slice a model and print it without installing any additional software. And it has now been updated! The latest image has an updated Octoprint 1.2 which now has CuraEngine [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/06/30/new-kamikaze-cnc-image-released/">New Kamikaze CNC image released</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/04/Kamikaze_header.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-653 size-full" src="http://www.thing-printer.com/wp-content/uploads/2015/04/Kamikaze_header.png" alt="Kamikaze_header" width="960" height="480" srcset="https://www.iagent.no/wp-content/uploads/2015/04/Kamikaze_header.png 960w, https://www.iagent.no/wp-content/uploads/2015/04/Kamikaze_header-800x400.png 800w, https://www.iagent.no/wp-content/uploads/2015/04/Kamikaze_header-300x150.png 300w, https://www.iagent.no/wp-content/uploads/2015/04/Kamikaze_header-768x384.png 768w, https://www.iagent.no/wp-content/uploads/2015/04/Kamikaze_header-600x300.png 600w" sizes="auto, (max-width: 960px) 100vw, 960px" /></a></p>
<p><a href="http://wiki.thing-printer.com/index.php?title=Kamikaze">Kamikaze</a> is a Debian-based eMMC flasher image for BeagleBone Black. It is a complete solution for <a href="http://wiki.thing-printer.com/index.php?title=Replicape">Replicape</a> and <a href="http://wiki.thing-printer.com/index.php?title=Manga_Screen">Manga-Screen</a> aiming to contain all software needed to slice a model and print it without installing any additional software. And it has now been updated!</p>
<p>The latest image has an updated<a href="http://octoprint.org/"> Octoprint 1.2</a> which now has <a href="http://reprap.org/wiki/Cura">CuraEngine</a> as a plugin simplifying the slicing of models. So now, you can upload Cura slicer profiles directly from Octoprint.  Further, I&#8217;ve made a plugin for <a href="http://wiki.thing-printer.com/index.php?title=Redeem">Redeem</a>, meaning that you can also import Redeem config files and restart redeem from the Octoprint settings window.</p>
<p>The new image also has the ADC bug removed that was present in the last release. There is also support for <a href="http://www.thing-printer.com/new-major-revision-of-replicape-rev-b/">Replicape Rev B1</a>, of which there only exists one prototype 🙂 This image also has Linux kernel 4.1.0-bone9 with cape manager, so the right device tree is loaded based on the EEPROM on your cape.</p>
<p>There are still a few things I want to fix in an upcoming version, namely having the zeroconf plugin for Octoprint work out of the box, so there will probably be another distro coming in a while. Also, a big project will be better integration between Octoprint and <a href="http://wiki.thing-printer.com/index.php?title=Toggle">Toggle</a> so it is possible to see which model is printing and progress on both screens.</p>
<p>The post <a href="https://www.iagent.no/2015/06/30/new-kamikaze-cnc-image-released/">New Kamikaze CNC image released</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2015/06/30/new-kamikaze-cnc-image-released/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>PWM as DAC</title>
		<link>https://www.iagent.no/2015/05/25/pwm-as-dac/</link>
					<comments>https://www.iagent.no/2015/05/25/pwm-as-dac/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Mon, 25 May 2015 17:19:18 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=680</guid>

					<description><![CDATA[<p>With the new revision of Replicape, I had to do some voodoo with the electronics in order to reach the new target price. Perhaps the most important change was the removal of the Digital to Analog Converter (DAC) that was used for setting the current limit of the stepper motor controllers digitally. Instead, five of [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/05/25/pwm-as-dac/">PWM as DAC</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/05/pwm.jpg"><img loading="lazy" decoding="async" class=" size-full wp-image-782 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/05/pwm.jpg" alt="pwm" width="640" height="640" srcset="https://www.iagent.no/wp-content/uploads/2015/05/pwm.jpg 640w, https://www.iagent.no/wp-content/uploads/2015/05/pwm-600x600.jpg 600w, https://www.iagent.no/wp-content/uploads/2015/05/pwm-100x100.jpg 100w, https://www.iagent.no/wp-content/uploads/2015/05/pwm-300x300.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/05/pwm-150x150.jpg 150w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><br />
With the new revision of Replicape, I had to do some voodoo with the electronics in order to reach the new target price. Perhaps the most important change was the removal of the Digital to Analog Converter (DAC) that was used for setting the current limit of the stepper motor controllers digitally. Instead, five of the sixteen channels on the PWM chip (<a title="PCA9685" href="http://www.nxp.com/products/lighting_driver_and_controller_ics/i2c_led_display_control/series/PCA9685.html">PCA9685</a>) was dedicated to setting the current limit. This eliminated a chip from the board, saving both BOM costs, board space, reduced production costs and freed a single, but important pin, SPI CS0. This blog post explains some of the trade-offs involved in making this decision.</p>
<p><b>Short summary of parameters</b><br />
&#8211; PWM frequency: 10 KHz (PCA9685 is limited to 1 KHz, see below)<br />
&#8211; First order low pass filter with R = 10K, C = 47uF<br />
&#8211; Corner frequency: fc = 3.38Hz<br />
&#8211; Peak to peak ripple voltage: 0.53 mV<br />
&#8211; DAC resolution step: 0.61 mV<br />
&#8211; DAC max voltage: 2.5V</p>
<p><b>Why is it necessary?</b><br />
The DAC chip used in Replicape rev A4A was $1.75 in volumes of 500. Removing this cost does seem like a big deal, but when the total BOM cost is $30-40, it makes up a large percentage of the manufacturing costs. But what are the downsides to eliminating this component? Will it give a worse result in any way? Probably not.</p>
<p><b>What is the challenge here?</b><br />
Well, in summary; to get a programmable bias voltage between 0 and 2.5 V with enough steps (4096 is plenty) and with a low enough ripple voltage (5.3mV should suffice) at a low cost (the price of 5 resistors and 5 capacitors).</p>
<p><b>Why don&#8217;t you use trim pots?</b><br />
Trim pot&#8217;s are cheap, that&#8217;s it. The downside is that the end user will need physical access to the controller board to change it and for 3D-printer manufacturers, they will need to calibrate the current during assembly. This increases cost during assembly for the manufacturer and makes it less use friendly for the end user. An important aspect about Replicape is that physical access should not be necessary once the board is installed.</p>
<p><b>The electro-pop</b><br />
The PWM chip has a VCC of 5V while the AIN voltage is needs 0-2.5 V. For this reason, a voltage divider is added followed by a first order low pass RC filter.The voltage divider is not really necessary since the AIN input can handle up to 5V with anything above 2.5V being treated as full current. It might be eliminated in a new revision (at the expense of only having half the resolution). Here is the schematic for the filter, the input is a PWM pulse, the output is a bias voltage.<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/05/pwm-dac.png"><img loading="lazy" decoding="async" class=" size-full wp-image-705 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/05/pwm-dac.png" alt="pwm-dac" width="490" height="241" srcset="https://www.iagent.no/wp-content/uploads/2015/05/pwm-dac.png 490w, https://www.iagent.no/wp-content/uploads/2015/05/pwm-dac-300x148.png 300w" sizes="auto, (max-width: 490px) 100vw, 490px" /></a></p>
<p><b>Possible attainable DAC resolution</b><br />
The PCA9685 has a 12 bit resolution. Some quick front of the blog calculations makes the theoretically attainable resolution<br />
[latex]V_{step} = 2.5V/4096 = 0.61 mV[/latex].<br />
This is more than enough. Typically you will change the current limit in steps of 0.1 V, but having a good resolution minimizes the difference between what you want and what you get without pulling out a calculator.<br />
An interesting observation will be to try and measure the noise level on this input pin and see if the noise level on the pin or on the GND plane of the board will be below that.<br />
Conversely, and even if one is not interested in having the option to use every bit of the resolution, having any ripple on the AIN pin will manifest itself in variations in the current cut-off which again will increase the audible level from the steppers.</p>
<p><b>PWM frequency</b><br />
The frequency/period of the PWM outputs do not really matter for the operation (see the appendix for why). Or rather, it matters, but not for producing a bias voltage. Instead it is critical due to the amount of ripple voltage that is tolerable. To get a point of reference for what is tolerable, in the datasheet for TMC2100, there is a small section on driving the analogue current control from a filtered PWM circuit. In the data sheet, a PWM frequency of &#8220;well above 10 kHz&#8221; is recommended together with a first order filter with R = 22k and C = 1uF. This should give a corner frequency of fc = 7 Hz, equivalent with a time constant of 22 ms (&#8220;several milliseconds&#8221; as specified in the data sheet). With the values suggested, the steady <a href="http://sim.okawa-denshi.jp/en/PWMtool.php">state ripple voltage</a> on the input pin is 2.8 mV. This is still an order of magnitude above what is the PWM resolution limit.</p>
<p><b>Yeah Bill, but why not simply increase the PWM frequency?</b><br />
Normally, I would say go for it, but on Replicape, the PWM chip has multiple uses (It is also very limited, see below). It is also used for controlling the heaters on the board. Since MOSFETs dissipates more heat in the transition phases than in the steady states (on/off), simply increasing the PWM frequency will increase the total amount of heat coming from the MOSFETs. How much will be the topic of a different blog post!</p>
<p><b>Lowering cut-off frequency</b><br />
An alternative to increasing the PWM frequency is lowering the cut-off/corner frequency. Since the actual cut-off frequency is not critical, it can be a good idea to spend some time finding values on the R and C that can also be used other places on the board to save BOM lines. In the case of Replicape, 10 K and 4.7 uF were used, giving a cut-off frequency of 3.4 Hz and a Vpp ripple of 1.3 mV. This is still above the resolution, but gives very nice (and cheap) R and C values.</p>
<p><b>Bandwidth considerations</b><br />
Normally, when using a DAC for any application, you are also interested in the bandwidth that the DAC can provide. However, in this case, we are only interested in setting a comparator voltage, which does not have to change very rapidly. That&#8217;s why we can get away with having a low cut-off 1st order filter. The DAC has a bandwith of 3.38 Hz, if you need to change the stepper current more often than 3 times pr. second, then dude, you are doing it wrong 🙂</p>
<p><b>What are the downsides?</b><br />
The only real downside I can think of is the increased heat dissipation that will come from the increased switching frequency of the MOSFETs. Also, the previous revision of Replicape used the same PWM chip for also controlling servos. This locked the PWM frequency to 100 Hz (!) which is the period needed for servos. Instead the two servo ports available now are controlled by PWM pins on the SoC. There is always an alternative to add a second order to the filter and then decrease the frequency alternatively tolerate a higher ripple voltage. There might not be much increase in the audible level anyways.</p>
<h3>Second order filter</h3>
<p>I&#8217;ve later found out a couple of things about the PCA9685 PWM chip. First of all, the maximum frequency attainable is around 1 KHz according to the data sheet (but I&#8217;ve measured it to 1.76 KHz). Furthermore, the accuracy of the frequency is not very good. I&#8217;ve seen differences of 15% between the frequency given and the frequency it outputs . This is not critical for controlling heaters or making bias voltages, but could prove fatal in other applications such as controlling servos etc.</p>
<p>The upper limit of 1 KHz means that there will likely be a need for a second (equal) filter, making the drop-off -40dB/decade. With a second order RC low pass filter, the peak-to-peak voltage drops to below 0.02 mV. I did a quick bread board implementation of this and with my crappy Oscilloscope measured the ripple voltage to 0.8 mV which is likely the noise floor of the oscilloscope with 256 times averaging. The good news is that the voltage divider can be directly substituted for a second RC low pass filter by replacing R1 with 10 K, R2 with a 4.7uF capacitor.</p>
<p><b>Comparing simulation and a physical implementation</b><br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/05/20150525_190938.jpg"><img loading="lazy" decoding="async" class=" size-medium wp-image-797 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/05/20150525_190938-300x169.jpg" alt="20150525_190938" width="300" height="169" srcset="https://www.iagent.no/wp-content/uploads/2015/05/20150525_190938-300x169.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_190938-scaled-800x450.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_190938-1024x576.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_190938-768x432.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_190938-1536x864.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_190938-2048x1152.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_190938-600x338.jpg 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
In order to compare the calculated results with a physical implementation, the frequency was lowered to 100 Hz to increase the ripple voltage to something measurable. The V in is 3.3V since this is the Vcc on the PWM circuit on Replicape rev A4A.<br />
The following photo shows a simulation of a PWM (blue) signal, its fourier series implementation (green) and the ripple voltage (red) in the time domain. Also shown is a second order low pass RC filter gain and phase shift. The two RC filters are equal and having the same parameters as previously. The calculated ripple voltage is here 5.0 mV peak to peak. An interesting observation is the 180 degree phase shift<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/05/fourier1.png"><img loading="lazy" decoding="async" class=" size-medium wp-image-792 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/05/fourier1-300x226.png" alt="fourier" width="300" height="226" srcset="https://www.iagent.no/wp-content/uploads/2015/05/fourier1-300x226.png 300w, https://www.iagent.no/wp-content/uploads/2015/05/fourier1-800x603.png 800w, https://www.iagent.no/wp-content/uploads/2015/05/fourier1-768x579.png 768w, https://www.iagent.no/wp-content/uploads/2015/05/fourier1-600x452.png 600w, https://www.iagent.no/wp-content/uploads/2015/05/fourier1.png 812w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>For comparison, here is a picture of the same implementation in hardware. The ripple voltage is here around 10 mV as seen on the oscilloscope.<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/05/20150525_174815.jpg"><img loading="lazy" decoding="async" class=" size-medium wp-image-788 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/05/20150525_174815-300x264.jpg" alt="20150525_174815" width="300" height="264" srcset="https://www.iagent.no/wp-content/uploads/2015/05/20150525_174815-300x264.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_174815-scaled-800x704.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_174815-1024x902.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_174815-768x676.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_174815-1536x1352.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_174815-2048x1803.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/05/20150525_174815-600x528.jpg 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>There is a small difference between the simulated results and the hardware implementation. Looking at the datasheet for the capacitors, one reason might be the bias voltage that lowers the capacitance with about 25% at 3.3V. Implementing this is in the formula gives a Vpp ripple of 9.5 mV which is pretty close to the calculated results.</p>
<h3>Appendix: get your math did</h3>
<div style="font-size: small;">Note: I like to torment myself by decomposing simple electronic circuits into mathematical expressions in order to analyse the effects it has on stuff. If you are not mathsochistic, feel free to skip this part.</div>
<p>Filtering a PWM signal through a low pass filter will give an analogue bias voltage proportional to the duty cycle of the PWM. This is the wanted signal. In addition to this, there will be an &#8220;unwanted&#8221; component, a ripple voltage appearing on top of the bias voltage. The appendix shows the calculations for why this is true and also the steps for calculating the ripple voltage.</p>
<p>What we are interested in is the average value of the function, and also looking at the ripple voltage resulting from the chosen filter. 12th grade calculus comes to the rescue in the form of integration! PWM is just a train of pulses, so by integrating over time, the value becomes a constant scaled by the pulse of the width. Look:<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/05/Formula1.png"><img loading="lazy" decoding="async" class=" size-full wp-image-712 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/05/Formula1.png" alt="Formula" width="262" height="162" /></a><br />
A straight forward way to define this signal mathematically is with the use of a Heaviside step function:<br />
[latex]f(t) = K(1-H(t-D))[/latex]<br />
where K is a scale factor, (2.5 V in this case after the voltage divier), D is the &#8220;on&#8221; time and [latex]H(t)[/latex] is the heaviside delta function which can be written as<br />
[latex]H(t)=\begin{cases}1, &amp; \text{if $t&lt;0$}.\\ 0, &amp; \text{otherwise}.\end{cases}[/latex]<br />
This function is defined in the interval<br />
[latex]\left[0, T\right][/latex]<br />
However, looking at the steady state PWM signal, it can be considerered a piecewise continuous function on [0, T]. Using fourier series, the square wave can be decomposed in to a series of complex exponentials. The normal definition of the fourier series is<br />
[latex]f(x) = a_0+\sum_{n=1}^{\infty}a_n cos(nx)+\sum_{n=1}^{\infty}b_n sin(nx)[/latex]<br />
where<br />
[latex]a_0 = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x) dx[/latex]<br />
[latex]a_n = \frac{1}{\pi}\int_{-\pi}^{\pi} cos(n x)f(x) dx[/latex]<br />
[latex]b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} sin(n x)f(x) dx[/latex]<br />
[latex]x \in [-\pi, \pi][/latex]<br />
Jeezes, this is hairy! But right off the bat, we can eliminate the [latex]a_n[/latex] coefficients, since the function<br />
is <a href="http://mathworld.wolfram.com/FourierSeries.html">odd</a>.</p>
<p><b>Changing integration limits</b><br />
The interval on which this is defined is not ideal, instead we change the integration limits<br />
to something a bit more manageable. A PWM signal is usually defined by a period and a duty cycle, so lets change the integration interval from<br />
[latex]\left[-\pi, \pi\right][/latex] to [latex]\left[0, T\right][/latex]. We the have<br />
[latex]x = \frac{2\pi t}{T}[/latex]<br />
[latex]dx = \frac{2\pi dt}{T}[/latex]<br />
We then have<br />
[latex]f(t) = a_0+\sum_{n=1}^{\infty}b_n sin(\frac{2\pi nt}{T})[/latex]<br />
where<br />
[latex]a_0 = \frac{1}{T}\int_{0}^{T}f(t) dt[/latex]<br />
[latex]b_n = \frac{2}{T}\int_{0}^{T}f(t) sin(\frac{2\pi nt}{T}) dt[/latex]</p>
<p><b>Calculating the bias term</b><br />
Looking at the bias term, [latex]a_0[/latex] we have two peicewise continous functions which each can be integrated.<br />
[latex]a_0 = \frac{1}{T}(\int_{0}^{D}1 dt + \int_{D}^{T}0 dt)[/latex]<br />
[latex]a_0 = \frac{1}{T}(\int_{0}^{D}1 dt)[/latex]<br />
[latex]a_0 = \frac{1}{T}(D-0)[/latex]<br />
[latex]a_0 = \frac{D}{T}[/latex]<br />
So, the bias term is simply the fraction of on-time in the period, which is what we wanted to show.</p>
<p><b>Calculating the fourier coefficients</b><br />
To get the ripple voltage, wee need to know the fourier series coefficients<br />
[latex]b_n = \frac{2}{T}\int_{0}^{T}f(t)sin(\frac{2\pi nt}{T}) dt[/latex]<br />
Splitting this up into two integrals yields<br />
[latex]b_n = \frac{2}{T}\int_{0}^{D}f(t)sin(\frac{2\pi nt}{T}) dt + \int_{D}^{T}f(t)sin(\frac{2n\pi t}{T}) dt[/latex]<br />
The last term disappears since [latex]f(t) = 0[/latex]. The first term reduces to<br />
[latex]b_n = \frac{2}{T}\int_{0}^{D}sin(\frac{2\pi nt}{T}) dt [/latex]<br />
[latex]b_n = \frac{2}{T}\frac{T}{2\pi nt} sin(\frac{2\pi nt}{T})\bigg|_{0}^D [/latex]<br />
[latex]b_n = \frac{1}{\pi n} (-cos(\frac{2\pi nD}{T})+cos(0))[/latex]<br />
[latex]b_n = \frac{1}{\pi n}(1-cos(\frac{2\pi nD}{T})[/latex]</p>
<p>The full fourier series for a the PWM is therefore<br />
[latex]f(t) = \frac{D}{T} +\sum_{n=1}^{\infty}\frac{1}{\pi n}(1-cos(\frac{2\pi nD}{T})) sin(\frac{2\pi nt}{T}) [/latex]</p>
<p><b>50% duty cycle</b><br />
For a 50% duty cycle, [latex]D = \frac{T}{2}[/latex], so we have<br />
[latex]a_0 = \frac{D}{2D} = \frac{1}{2}[/latex]<br />
[latex]b_n = \frac{1}{\pi n}(1-cos(\frac{\pi nT}{T})[/latex]<br />
[latex]b_n = \frac{1}{\pi n}(1-cos(\pi n))[/latex]</p>
<p>This evaluates to 0 for even n, so it can be simplified to<br />
[latex]b_n = \frac{2}{\pi n}[/latex]<br />
[latex]n = 1,3,5&#8230;[/latex]<br />
So for a 50% duty cycle, we have<br />
[latex]f(t) = \frac{1}{2}+\sum_{n=1}^{\infty}\frac{2}{\pi n} sin(\frac{2\pi nt}{T})[/latex]<br />
for [latex]n = 1,3,5&#8230;[/latex]</p>
<p><b>Calculating the ripple voltage</b><br />
So the b_n terms form an infinite sum, but after the first term there is a big fucking drop-off and<br />
also, since this is filtered through a low pass filter, we can choose just one or or two of the terms and still get a pretty good<br />
estimate.</p>
<p>The gain of a first order RC filter can be calculated as<br />
[latex]G(\omega) = \frac{1}{\sqrt{1+(\omega R C)^2}}[/latex]<br />
Plotting this in a Bode diagram yields the usual -20dB/decade roll-off that first order filters provide.<br />
<a href="http://www.thing-printer.com/wp-content/uploads/2015/05/Gain1.png"><img loading="lazy" decoding="async" class=" size-medium wp-image-779 aligncenter" src="http://www.thing-printer.com/wp-content/uploads/2015/05/Gain1-300x226.png" alt="Gain" width="300" height="226" srcset="https://www.iagent.no/wp-content/uploads/2015/05/Gain1-300x226.png 300w, https://www.iagent.no/wp-content/uploads/2015/05/Gain1-800x603.png 800w, https://www.iagent.no/wp-content/uploads/2015/05/Gain1-768x579.png 768w, https://www.iagent.no/wp-content/uploads/2015/05/Gain1-600x452.png 600w, https://www.iagent.no/wp-content/uploads/2015/05/Gain1.png 812w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>To find the ripple voltage for a low pass filter, we need to calculate the sum of the fourier series coefficients</p>
<p>[latex]V_{ripple} = \sum_{n=1}^{\infty}\frac{1}{\sqrt{1+(n \omega_0 R C)^2}} 2 \frac{2}{\pi n}[/latex]<br />
where [latex]\omega_0 = 2 \pi f_0 = \frac{2\pi}{T}[/latex] is the angular frequency of the PWM signal, R is the resistance and C is the capacitance.<br />
Simplifying yields<br />
[latex]V_{ripple} = \sum_{n=1}^{\infty}\frac{4}{\pi n \sqrt{1+(n \omega_0 R C)^2}}[/latex]<br />
Plugging the chosen values for R, C, and f and summing the first three coefficients will give a peak to peak ripple voltage of<br />
[latex]V_{ripple} = \sum_{n=1}^{3}\frac{4}{\pi n \sqrt{1+(n 2\pi 10^4*4.7*10^{-6})^2}} = 5.4 mV[/latex]</p>
<p>Now the above calculations are somewhat crude in that they do not take the phase of the signal into account. Looking at a physical implementation<br />
will show that the ripple voltage is 90 degrees shifted forward and has a triangle shape. Still it gives an indication of what to expect.</p>
<p>&nbsp;</p>
<p>The post <a href="https://www.iagent.no/2015/05/25/pwm-as-dac/">PWM as DAC</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2015/05/25/pwm-as-dac/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>New major revision of Replicape (Rev B)</title>
		<link>https://www.iagent.no/2015/05/07/new-major-revision-of-replicape-rev-b/</link>
					<comments>https://www.iagent.no/2015/05/07/new-major-revision-of-replicape-rev-b/#comments</comments>
		
		<dc:creator><![CDATA[Elias Bakken]]></dc:creator>
		<pubDate>Thu, 07 May 2015 13:20:13 +0000</pubDate>
				<category><![CDATA[Beaglebone]]></category>
		<category><![CDATA[Redeem]]></category>
		<category><![CDATA[Replicape]]></category>
		<guid isPermaLink="false">http://www.thing-printer.com/?p=661</guid>

					<description><![CDATA[<p>So I&#8217;ve recently started working on a new major revision of Replicape, rev B! And boy is it major in many ways! First of all, the stepper drivers are brand new, I&#8217;m going for the TMC2100 which have gotten a lot of buzz lately because of their many configurations for lower noise. Don&#8217;t believe the [&#8230;]</p>
<p>The post <a href="https://www.iagent.no/2015/05/07/new-major-revision-of-replicape-rev-b/">New major revision of Replicape (Rev B)</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/05/Replicape_B1.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-667" src="http://www.thing-printer.com/wp-content/uploads/2015/05/Replicape_B1-1024x520.png" alt="Replicape_B1" width="1024" height="520" srcset="https://www.iagent.no/wp-content/uploads/2015/05/Replicape_B1-1024x520.png 1024w, https://www.iagent.no/wp-content/uploads/2015/05/Replicape_B1-800x406.png 800w, https://www.iagent.no/wp-content/uploads/2015/05/Replicape_B1-300x152.png 300w, https://www.iagent.no/wp-content/uploads/2015/05/Replicape_B1-768x390.png 768w, https://www.iagent.no/wp-content/uploads/2015/05/Replicape_B1-1536x780.png 1536w, https://www.iagent.no/wp-content/uploads/2015/05/Replicape_B1-600x305.png 600w, https://www.iagent.no/wp-content/uploads/2015/05/Replicape_B1.png 1726w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
So I&#8217;ve recently started working on a new major revision of Replicape, rev B! And boy is it major in many ways! First of all, the stepper drivers are brand new, I&#8217;m going for the TMC2100 which have gotten a lot of buzz lately because of their many configurations for lower noise.</p>
<p>Don&#8217;t believe the hype though, even though they are super silent with the StealthChop, <a href="https://www.youtube.com/watch?v=g6Bxoqr8QlY">that mode is all but useless for 3D-printing</a>. Still, they offer a few more options for tuning the audible noise level, which I&#8217;m really looking forward to playing around with. Other than that, one of the major improvements is the price point. By changing manufacturer (see below), opting for a higher volume, doing some electronics voodoo (eliminating the DAC by leveraging some spare channels on the PWM chip etc.), the MSRP of $99 looks like it can be achieved as hoped. This does not mean that the board will be a worse product, quite the opposite. For this price, I&#8217;ve managed to add<br />
&#8211; Brand new stepper drivers (TMC2100) for up to 256 times microstepping. (actually they are cheaper than DRV8825s)<br />
&#8211; input protection on all end stops enabling up to 15V inputs (so you can use <a href="http://www.digikey.com/product-detail/en/E2B-M12KS04-WP-B1%202M/Z4122-ND/4732538">proximity sensors</a> directly on end-stops<br />
&#8211; reverse polarity protection on input (in case you get unlucky)<br />
&#8211; four layer PCB giving lower EMC noise levels<br />
&#8211; lower audible noise levels (ground return noise increased the audible levels)<br />
&#8211; an additional fan output<br />
&#8211; PWM enable (in conjunction with the Watchdog, increases safety in case of a kernel panic)<br />
&#8211; Two 5V servo outputs, so you can add a physical Z-probe or Dual drive extruder (<a href="http://www.dglass3d.com/products/hpx2max/">http://www.dglass3d.com/products/hpx2max/</a>).</p>
<p>A second thing I&#8217;m excited about is the cooperation with <a href="http://elmatica.no/">Elmatica</a> on the new revision prototypes. These guys have over 40 years of experience in the PCB business and they have been kind enough to do me a solid and help with the prototypes pro-Bono. They are also hooking me up with some sweet connections for the PCB production over in China, so the new boards will be top quality at a low price. In their words: &#8220;We&#8217;ll hook you up with someone who will not screw you over!&#8221;. Music to my ears. In fact, hearing that, I sort of felt like Jules in Pulp Fiction when Marcellus offers to send The Wolf. (See image below).</p>
<p><a href="http://www.thing-printer.com/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction.jpg"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-669" src="http://www.thing-printer.com/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-1024x434.jpg" alt="27_winstonwolfe_pulpfiction" width="1024" height="434" srcset="https://www.iagent.no/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-1024x434.jpg 1024w, https://www.iagent.no/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-scaled-800x339.jpg 800w, https://www.iagent.no/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-300x127.jpg 300w, https://www.iagent.no/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-768x325.jpg 768w, https://www.iagent.no/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-1536x650.jpg 1536w, https://www.iagent.no/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-2048x867.jpg 2048w, https://www.iagent.no/wp-content/uploads/2015/05/27_winstonwolfe_pulpfiction-600x254.jpg 600w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The plan now is to do a little prototyping for a few weeks and then kick off a Kickstarter to get the volume up to at least a couple of hundred boards which should enable a batch size of 500. By that time, the new <a href="http://wiki.thing-printer.com/index.php?title=Kamikaze">Kamikaze CNC image</a> should be stable with a Redeem V1.0</p>
<p>The post <a href="https://www.iagent.no/2015/05/07/new-major-revision-of-replicape-rev-b/">New major revision of Replicape (Rev B)</a> appeared first on <a href="https://www.iagent.no">www.iagent.no</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iagent.no/2015/05/07/new-major-revision-of-replicape-rev-b/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
	</channel>
</rss>
