<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[SoliForum - 3D Printing Community — Filawinder Arduino Reboot solution]]></title>
		<link>https://www.soliforum.com/topic/5859/filawinder-arduino-reboot-solution/</link>
		<atom:link href="https://www.soliforum.com/feed/rss/topic/5859/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Filawinder Arduino Reboot solution.]]></description>
		<lastBuildDate>Fri, 13 Feb 2015 11:59:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/85065/#p85065</link>
			<description><![CDATA[<p>vincenzo, </p><p>Thanks for the fix, I have tried every solution and every damn thing I have tried has failed to get it to run consistently. really starting to annoy me!&nbsp; MONEY BACK time if I cant get it to work soon!!!!!!!!!</p><p>Where do you place the code and do i delete some of the other code?</p><p>I am fairly new to arduino programming and am not sure how to apply the fix.</p><p>Thanks Jason</p>]]></description>
			<author><![CDATA[null@example.com (jhhoffman)]]></author>
			<pubDate>Fri, 13 Feb 2015 11:59:52 +0000</pubDate>
			<guid>https://www.soliforum.com/post/85065/#p85065</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52427/#p52427</link>
			<description><![CDATA[<p>is better &quot;int puller_speed_old = 0;&quot; because of motor start from no motion.. if you give a 255 value the firmware think the motor run at maximum speed at the beginning, and the first value will be 255 - 25... in other word.. start really from 0 to 230... and the first step is 230 PWM... not 25 maximum...over 100ms</p><div class="quotebox"><cite>jason_ wrote:</cite><blockquote><p>For anyone thinking about trying the change above this keep in mind that you need to also add</p><div class="codebox"><pre><code>int puller_speed_old = 255;</code></pre></div><p>after<br /></p><div class="codebox"><pre><code>unsigned int line_position; 
int spooler_speed = 200;
int puller_speed = 255;
int rotation_status = 0;</code></pre></div></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (vincenzo.matacelo)]]></author>
			<pubDate>Tue, 18 Mar 2014 18:33:42 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52427/#p52427</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52391/#p52391</link>
			<description><![CDATA[<div class="quotebox"><cite>jason_ wrote:</cite><blockquote><p>after using the code from vincenzo.matacelo I can say it really really improves the behavior.&nbsp; It dampens the acceleration and deceleration enough to give it time to recover from a shadow as well as gives it a much more consistent speed and improves diameter control.&nbsp; With this small change I don&#039;t need my ugly hack for behavior when it loses the line.&nbsp; &nbsp;I didn&#039;t really have a problem with my filawinder resetting so I can&#039;t speak to that.</p><p>I really think this should become part of the standard firmware, with perhaps a change to give faster deceleration when in manual mode</p></blockquote></div><br /><p>The slow PWM changes is a bit of a hack or workaround on the PID values, though it helps.&nbsp; I had to dial them down a lot, and it only barely got smooth enough.&nbsp; It ended up only going up to 150 PWM during auto mode even when it needed full speed.&nbsp; Adding the scale factor to get top speed up to 255 also made the movement a little more rough so the code to slow down PWM changes helps there.&nbsp; &nbsp;There is an Autotune function to go with the PID library.&nbsp; If I can figure out how to implement that, it may smooth everything out enough on its own.</p>]]></description>
			<author><![CDATA[null@example.com (IanJohnson)]]></author>
			<pubDate>Tue, 18 Mar 2014 07:42:43 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52391/#p52391</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52390/#p52390</link>
			<description><![CDATA[<p>It would work more or less the way you suggest; with a few caveats (poor lay explanations included for wider audience, not yourself specifically Tomek <img src="https://www.soliforum.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> ) </p><p>All things being equal and ignoring the rest of the schematic - the circuit you describe will prevent it being able to draw current from the capacitor (assuming we are below the reverse breakdown voltage of the diode in question <img src="https://www.soliforum.com/img/smilies/wink.png" width="15" height="15" alt="wink" /> ).&nbsp; So yes, when it starts drawing more &#039;power&#039; , then it will be sourcing this only from the power supply and not the bypass/filter cap on the arduino. </p><p>However - as the motor spins down and voltage is suddenly removed/reduced, it causes &#039;flyback&#039; as the motor is now a generator - If you&#039;ve ever turned your Solidoodle off, then rapidly moved an axis back and forth (say by pulling/pushing the X-axis quickly) you can actually power up the Sanguinololu/Ramps/etc (if you have an LCD attached, it will light up..) In the circuit described, it will cause that additional voltage and current (sometimes 100&#039;s of volts depending on motor size) to be pumped back into the circuit and pop goes the arduino (or the cap if its above its voltage rating - which is why capacitors on motor circuits are usually rated for 100&#039;s of volts...)&nbsp; <img src="https://www.soliforum.com/img/smilies/neutral.png" width="15" height="15" alt="neutral" /> . To solve THAT problem, you use another diode which then gets installed &#039;reversed&#039; across the inductive load which will cause that additional generated load to be &#039;harmlessly&#039; dumped straight into ground.&nbsp; A diode in that arrangement is called a &#039;flyback diode&#039; or &#039;snubber&#039; or &#039;freewheeling&#039; diode... </p><p>And if you were really paranoid about ensuring a clean/protected circuit, then you&#039;d also use a Schottky diode rated for 5.1v (or whatever specific load you are seeking) across the power rails to the arduino.. a Schottky will basically allow anything up to its stated voltage to &#039;pass&#039; but as soon as say 5.5V&#039;s appears on the power rail, it will &#039;clamp&#039; and again just dump the excess &#039;harmlessly&#039; to ground...</p><p>Oh and agreed re caps - caps and more caps are important and solve lots of problems - many IC&#039;s will stop working and go out for long lunches and return rolling drunk if they dont have a small .1uf cap right next to their power pins... in these scenarios its about smoothing out the tiny DC ripple that will creep into any and all circuits... </p><p>Anyway - It should be noted im not an EE, ME or any E... so don&#039;t actually take anything I&#039;ve just said at face value <img src="https://www.soliforum.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (adrian)]]></author>
			<pubDate>Tue, 18 Mar 2014 07:38:45 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52390/#p52390</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52386/#p52386</link>
			<description><![CDATA[<p>Sidenote, if I were to go &quot;power--&gt;diode--&gt;Cap--&gt;arduino VCC&quot; and then tap the power line for the motor from before the diode, would that in effect isolate the cap to protecting the arduino VCC line?&nbsp; I understand it might be entirely not needed (having proper caps for the whole system is better...but maybe I don&#039;t care about the motor power line nearly as much as the MCU and I can&#039;t spare the [higher capacity needed, too] for having the motor line properly buffered.)</p><p>In my mind I am assuming the diode prevents any flow of current from the cap responding to the load of the mosfet/motor. </p><p>Just a general question I&#039;ve had as an ME with other dc motor projects.</p>]]></description>
			<author><![CDATA[null@example.com (Tomek)]]></author>
			<pubDate>Tue, 18 Mar 2014 07:04:28 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52386/#p52386</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52385/#p52385</link>
			<description><![CDATA[<p>MOAH CAPS. </p><p>That&#039;s, like, 101 for fixing electrical problems <img src="https://www.soliforum.com/img/smilies/wink.png" width="15" height="15" alt="wink" />. </p><p>[by 101 I mean not basic fundamentals, I mean, when you have electrical problems throw caps everywhere and it can help, i&#039;ve found.]</p><p>I don&#039;t know much about the filawinder but if we&#039;re talking PWM I assume we&#039;re also talking about a DC motor. Caps on the motor can also help noise in the system. Check out this doc. <a href="http://www.pololu.com/docs/0J15/9.">http://www.pololu.com/docs/0J15/9.</a> But if you&#039;re thinking it&#039;s power-sag related, then that&#039;s a different problem then documented in the pololu note. Still a worthwhile read, tho <img src="https://www.soliforum.com/img/smilies/smile.png" width="15" height="15" alt="smile" />.</p>]]></description>
			<author><![CDATA[null@example.com (Tomek)]]></author>
			<pubDate>Tue, 18 Mar 2014 07:02:02 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52385/#p52385</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52343/#p52343</link>
			<description><![CDATA[<p>anyone tried sticking just a 47uf or similar electro capacitor over the VCC lines of the arduino ? that should resolve any transient voltage sag issues that cause the arduino to reboot.</p>]]></description>
			<author><![CDATA[null@example.com (adrian)]]></author>
			<pubDate>Tue, 18 Mar 2014 00:41:20 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52343/#p52343</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52342/#p52342</link>
			<description><![CDATA[<p>after using the code from vincenzo.matacelo I can say it really really improves the behavior.&nbsp; It dampens the acceleration and deceleration enough to give it time to recover from a shadow as well as gives it a much more consistent speed and improves diameter control.&nbsp; With this small change I don&#039;t need my ugly hack for behavior when it loses the line.&nbsp; &nbsp;I didn&#039;t really have a problem with my filawinder resetting so I can&#039;t speak to that.</p><p>I really think this should become part of the standard firmware, with perhaps a change to give faster deceleration when in manual mode</p>]]></description>
			<author><![CDATA[null@example.com (jason_)]]></author>
			<pubDate>Tue, 18 Mar 2014 00:11:52 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52342/#p52342</guid>
		</item>
		<item>
			<title><![CDATA[Re: Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52250/#p52250</link>
			<description><![CDATA[<p>For anyone thinking about trying the change above this keep in mind that you need to also add</p><div class="codebox"><pre><code>int puller_speed_old = 255;</code></pre></div><p>after<br /></p><div class="codebox"><pre><code>unsigned int line_position; 
int spooler_speed = 200;
int puller_speed = 255;
int rotation_status = 0;</code></pre></div><p>I&#039;ve been playing with the behavior when it loses the line.&nbsp; Ive changed QTRSensors.cpp... with my changes it no longer stops if it loses the line above center mark or goes wide open if it loses it below center mark.&nbsp; Instead it will pick a speed based on the position of the knob.&nbsp; If its below center line it will have approx 3 times the effect as above instead of off/on<br />It does however mean that if it goes above the line it will continue to move some so you need to pay attention to how you set your knob.&nbsp; These changes are in the QTRSensors::readLine function<br /></p><div class="codebox"><pre><code> if(!on_line)
    {
        // If it last read to the left of center, return slower speed based on knob.
        if(last_value &lt; (_numSensors-1)*1000/2)                   
                       return  (analogRead(knob_Pin)*.5)+1500; //never fully shutoff                                 
        // If it last read to the right of center, return faster speed based on knob.
        else
                    return analogRead(knob_Pin)*1.4+1500;
    }</code></pre></div><p>and you also need to add<br /></p><div class="codebox"><pre><code>        int knob_Pin = 6;</code></pre></div><p>after<br /></p><div class="codebox"><pre><code>unsigned long avg; // this is for the weighted total, which is long
                       // before division
    unsigned int sum; // this is for the denominator which is &lt;= 64000
    static int last_value=1; // assume initially that the line is left.</code></pre></div><p>My thinking behind these changes is my winder seems to often lose the line because of a shadow then because the two speed options are so extreme the filament is out of position before it resets itself.&nbsp; So hopefully by allowing a configurable speed it will buy itself more time for reset</p>]]></description>
			<author><![CDATA[null@example.com (jason_)]]></author>
			<pubDate>Mon, 17 Mar 2014 02:27:12 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52250/#p52250</guid>
		</item>
		<item>
			<title><![CDATA[Filawinder Arduino Reboot solution]]></title>
			<link>https://www.soliforum.com/post/52232/#p52232</link>
			<description><![CDATA[<p>Hi,</p><br /><p>I understand why my filawinder rebooting at random causing a reset of all calibration...and so stopping working in automode.</p><p>i&#039;ve seen the v10 firmware version with eeprom storage for calibration value but i don&#039;t like this reboot that can be very dangerous for arduino board..</p><p>so... the problem is in Hardware.. let me explain.. </p><p>the motor is directly connected at the mosfet.. connected at the power ... when motor is stopped and the PWM raise to a high level &quot;200 or more&quot; in less than 0.5 second , motor drain MORE AMPERE that the alimentator can... and the tension at arduino core goes down , resetting arduino board..</p><p>there are 2 possible solution..</p><p>1° software solution </p><div class="codebox"><pre><code>void pull_control()
{
  qtra.readCalibrated(sensorValues);              
  unsigned int line_position = qtra.readLine(sensorValues, QTR_EMITTERS_OFF, 1);  
  

  Input = line_position;                         //Get line position from sensors


  if (!pullPID.Compute()) return;              //Run the PID 

  int ScaledOutput = (Output * 1.7);             //Scale the Output from 0-150 to 0-255)       
  if (ScaledOutput &lt;= 0) {ScaledOutput = 1;}     //Limit the output to the range of 0-255) 
  if (ScaledOutput &gt;= 255){ScaledOutput = 255;}
  puller_speed = ScaledOutput;
    
  if ( (puller_speed - puller_speed_old) &gt; 25) puller_speed = puller_speed_old + 25;
  if ( (puller_speed - puller_speed_old) &lt; -25) puller_speed =  puller_speed_old - 25;
  
  analogWrite(motor_spoolerPin,puller_speed);    //Set the spool speed to the PID result
  puller_speed_old = puller_speed;

}</code></pre></div><p>Force PWM to raise only by +-25 every 0.1 second (using the pullPID.Compute 100ms).</p><p>2° hardware.. put a capacitor in parallel with the motor that cut some of pwm wave...</p><br /><p>with 1° solution in auto mode my filawinder didn&#039;t reboot more..</p>]]></description>
			<author><![CDATA[null@example.com (vincenzo.matacelo)]]></author>
			<pubDate>Sun, 16 Mar 2014 22:11:58 +0000</pubDate>
			<guid>https://www.soliforum.com/post/52232/#p52232</guid>
		</item>
	</channel>
</rss>
