<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Clem&amp;#39;s Stepper Motor Puzzle!</title><link>/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><description>Developing electronic circuits often feels like solving a puzzle. And solving this puzzle could win you a Multicomp Pro Tablet Oscilloscope!
And while finding the basic application to make an IC do its magic is often quite easy, some questions often </description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Wed, 01 Mar 2023 14:53:08 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>mayermakes</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;[View:https://youtu.be/4N-O1IzRSfc:640:360]&lt;/p&gt;
&lt;p&gt;Lets go over the main aspekts of the entries for this competition and find out who is the winner!(TLD:DR skip to the end if you just want to know who won)&lt;br /&gt;The element14 community team will reach out to the winner via DM for the shipping details!&lt;br /&gt;Congratulations to the winner and all participants, i think this page turned into a really good comprehensive guide to using the TMC2130/ stepper drivers in general!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Sun, 26 Feb 2023 20:05:12 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>mayermakes</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;thank you all for your Entries! it has been a blast seeing how this puzzle challenge played out with a lot of different approaches to finding the solution!&lt;br /&gt;We will carefully review all the entries, even the obvious jokester ones are taken into consideration!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Thu, 23 Feb 2023 21:30:59 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>mvischioni</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Interesting puzzle!&lt;br /&gt;&lt;br /&gt;By leaving CFG0, CFG1, CFG2 open we configure the driver as &amp;quot;16 microsteps, interpolation to 256 microsteps, stealth chop&amp;quot;, with a &amp;quot;chopper off time&amp;quot; of 332 clock periods.&lt;br /&gt;So we need 16 pulses to make a full step, assuming 1.8&amp;deg;per step we need 3200 pulses to complete a revolution.&lt;br /&gt;STEP, DIR and ENABLE pins are connected to tactile switches and pullups. &lt;br /&gt;Default active edge is the rising edge, so the step occours at button release.&lt;br /&gt;ENABLE (CFG6) pin is active low: we need to keep the button pressed to enable the driver.&lt;br /&gt;&lt;br /&gt;If we only press the STEP button, the motor won&amp;#39;t turn at all. &lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a rel="nofollow" target="_blank" href="https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf"&gt;www.trinamic.com/.../TMC2130_datasheet.pdf&lt;/a&gt;&lt;br /&gt;&lt;a rel="nofollow" target="_blank" href="https://www.trinamic.com/fileadmin/assets/Products/Eval_Drawings/TMCSilentStepStick_SPI-TMC2130_v10.pdf"&gt;www.trinamic.com/.../TMCSilentStepStick_SPI-TMC2130_v10.pdf&lt;/a&gt;&lt;br /&gt;&lt;a rel="nofollow" target="_blank" href="https://learn.watterott.com/silentstepstick/"&gt;learn.watterott.com/.../&lt;/a&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Thu, 23 Feb 2023 19:53:51 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>luislabmo</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Oopsie, my puzzle solution comment went into moderation&amp;nbsp;[emoticon:458682de9e4d4e7c94377c4fe2884528]&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Thu, 23 Feb 2023 19:33:25 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>luislabmo</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;&lt;span style="font-weight:400;"&gt;I tried to tackle this puzzle for several days and came to the conclusion that solving this puzzle requires some assumptions made -there are a few unknown variables that are very important and may affect the outcome-. I will explain in detail.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;Looking at the Puzzle&amp;rsquo;s description&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;The Arduino Mega is there to show how Power and GND are connected to the stepper driver and has no other connections to the circuit. This also tells us that there is &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;no software debounce&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; for any input&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;There is no mention of a hardware debounce in the Puzzle description, the practical example or in the Puzzle schematic but, there is an internal analog filter in the Step and Dir inputs.&amp;nbsp;The datasheet mentions that this filter is designed to help with normal noise in the circuit but doesn&amp;rsquo;t seem designed to filter noise generated by push-buttons&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt="Input Filter" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Input-Filter.png" /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;The Stepper is enabled&lt;br /&gt;&lt;img alt="Enable pin" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Enable-pin.png" /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;The Motor requires 200 steps per revolution&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;From the puzzle description, &lt;/span&gt;&lt;b&gt;CFG0&lt;/b&gt;&lt;span style="font-weight:400;"&gt; and &lt;/span&gt;&lt;b&gt;CFG1&lt;/b&gt;&lt;span style="font-weight:400;"&gt; are left open&lt;br /&gt;&lt;img alt="CFG0 and CFG1 left open (floating)" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Puzzle1.png" /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;b&gt;CFG0&lt;/b&gt;&lt;span style="font-weight:400;"&gt; left open sets the duration of Slow Decay Phase to 332 clock cycles or around 25&amp;micro; sec (internal clock is around 13.2MHz under normal temperature operation), this doesn&amp;rsquo;t affect the outcome of the puzzle IMO&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;There is &lt;span style="text-decoration:underline;"&gt;no mention of &lt;/span&gt;&lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;the state of CFG2&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; in the Puzzle -or well, it is incorrectly mentioned&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt="Incorrect CFG2 description" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Incorrect-CFG2.png" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;In the Datasheet, &lt;/span&gt;&lt;b&gt;CFG3&lt;/b&gt;&lt;span style="font-weight:400;"&gt; is actually the input that sets mode of the current setting, GND sets it to Internal reference voltage. CFG3 I consider irrelevant for the puzzle solution as well&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;So what about &lt;/span&gt;&lt;b&gt;CFG1&lt;/b&gt;&lt;span style="font-weight:400;"&gt; and &lt;/span&gt;&lt;b&gt;CFG2&lt;/b&gt;&lt;span style="font-weight:400;"&gt; then?. Before continuing we have to make some assumptions which are nowhere clarified in the puzzle or any of the supporting images:&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;Let&amp;#39;s assume that the Stepper Driver is correctly set up in Standalone mode&lt;/span&gt;&lt;span style="font-weight:400;"&gt; (SPI_MODE = 0 or connected to GND), which I believe is what Clem is attempting considering he mentioned MS1/MS2/MS3 as a way to configure the stepper and part of the description of the puzzle and also mentions configuration pins in different states (low, open)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Based on the above, if &lt;/span&gt;&lt;b&gt;CFG1&lt;/b&gt;&lt;span style="font-weight:400;"&gt; is left open the number of steps per revolution has 3 possible values, each dependent on the state of &lt;/span&gt;&lt;b&gt;CFG2&lt;/b&gt;&lt;span style="font-weight:400;"&gt; which again, is not mentioned &lt;/span&gt;&lt;span style="font-weight:400;"&gt;precisely&lt;/span&gt;&lt;span style="font-weight:400;"&gt; in the Puzzle description. We can ignore Interpolation for the calculations as this is just how the stepper-driver &lt;/span&gt;&lt;span style="font-weight:400;"&gt;smooths internally&lt;/span&gt;&lt;span style="font-weight:400;"&gt; each step&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="CFG1 and CFG2" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/CFG1-AND-CFG2.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-weight:400;"&gt;If CFG2 is connected to GND then &lt;/span&gt;&lt;b&gt;400 steps&lt;/b&gt;&lt;span style="font-weight:400;"&gt; are required per revolution (2 half steps per step * 200 steps per revolution)&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;If CFG2 is connected to VCC_IO then &lt;/span&gt;&lt;b&gt;800 steps&lt;/b&gt;&lt;span style="font-weight:400;"&gt; are required per revolution (4 micro-steps * 200 steps per revolution)&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;If CFG2 is left open then &lt;/span&gt;&lt;b&gt;3200 steps&lt;/b&gt;&lt;span style="font-weight:400;"&gt; are required per revolution (16 micro-steps per step * 200 steps per revolution)&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;From the table above we can see something very important to solve the puzzle later on. Note that no matter the state of &lt;/span&gt;&lt;b&gt;CFG2&lt;/b&gt;&lt;span style="font-weight:400;"&gt;, if &lt;/span&gt;&lt;b&gt;CFG1&lt;/b&gt;&lt;span style="font-weight:400;"&gt; is left open, &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;the 3 possible values are always in terms of microsteps&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; (2 half-steps, 4 quarter-steps or 16 microsteps) and Interpolation is always Active (Interpolation = Y).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;How many&lt;/b&gt;&lt;/span&gt;&lt;b&gt; OR &lt;/b&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;how often&lt;/b&gt;&lt;/span&gt;&lt;b&gt;?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Let&amp;rsquo;s see the Puzzle question in detail because I believe here is where things get a little spicy on purpose&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt="The puzzle question" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Here-is-the-puzzle.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;I usually see a &amp;ldquo;how often&amp;rdquo; question answered with things like &amp;ldquo;every 15 minutes&amp;rdquo;, &amp;ldquo;daily&amp;rdquo;, &amp;ldquo;every other week&amp;rdquo;, etc., so lets double-check that:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="How often from Google" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/how-often.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Since we are in an electronics community and this is a puzzle is about electronics, I also verified &amp;ldquo;frequency vs period&amp;rdquo; and here with the important part highlighted:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="frequency vs period" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/frequency-vs-period.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;At this point, I&amp;rsquo;m pretty much convinced that the answer to the &amp;ldquo;how often&amp;rdquo; of this puzzle has to be &lt;span style="text-decoration:underline;"&gt;in &lt;/span&gt;&lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;terms of Frequency&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; and not in terms of a quantity (how many).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;To answer the &amp;ldquo;how often&amp;rdquo; of the puzzle, we need to look at a few more places in the &lt;a title="TMC2130 Datasheet" href="https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf" rel="noopener noreferrer" target="_blank"&gt;Datasheet&lt;/a&gt;. First, let&amp;#39;s take a look at the timing section, which tells us that &lt;span style="text-decoration:underline;"&gt;the Step input can operate &lt;/span&gt;&lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;at a maximum of &amp;frac12; the frequency of the TMC2130 clock&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;. See the image below&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-STEP-and-DIR-interface-timing.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;We can safely assume that&amp;nbsp;&lt;/span&gt;&lt;b&gt;dedge=0&lt;/b&gt;&lt;span style="font-weight:400;"&gt; is the only possible scenario; remember that all over the puzzle Clem is trying to tell us that he is trying to operate the stepper driver in Standalone mode (the MS# pin mentions, no IO connection to the Arduino, CFG# pins left open) and &lt;/span&gt;&lt;b&gt;dedge=1&lt;/b&gt;&lt;span style="font-weight:400;"&gt; can only be possible by setting the &lt;/span&gt;&lt;b&gt;0X6C CHOPCONF - Chopper Configuration&lt;/b&gt;&lt;span style="font-weight:400;"&gt; register which can&amp;rsquo;t be done in Standalone mode, &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;it can only be done in SPI Interface mode&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="CHOPCONF register" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/CHOPCONF-register.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;So, &lt;/b&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;how often&lt;/b&gt;&lt;/span&gt;&lt;b&gt; then?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;From the timing characteristics in the datasheet, the internal clock is the option that makes more sense to me -also there is no mention of an external clock in the puzzle. I also think that a 50&amp;deg;C TJ (Operating Junction temperature) is a safe bet.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-Clock-oscillator-and-input.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;With all of the information presented so far, this leaves us with the answer to the puzzle:&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;What happens if you just leave MS1/CFG0 and MS2/CFG1 floating (open) -- &lt;/span&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;how often&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-weight:400;"&gt; would you have to push the STEP button for a full rotation?&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;When operating at maximum micro-step resolution, the STEP button can be operated at a maximum of &amp;frac12; the frequency of the TMC2130&amp;rsquo;s internal clock (13.2 MHz/ 2) or as fast as every ~152ns (0.15&amp;micro;s) in&amp;nbsp;the best case scenario (no bounce or missed actuations in the switch and when operating with the internal clock at around ambient temperature).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;What if &lt;/b&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;how many&lt;/b&gt;&lt;/span&gt;&lt;b&gt;?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Answering &lt;/span&gt;&lt;span style="font-weight:400;"&gt;how many&lt;/span&gt;&lt;span style="font-weight:400;"&gt; times the Step button has to be pushed introduces more unknown variables and several possible answers to the puzzle, here are a few factors to consider:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;Are we working &amp;ldquo;theoretically&amp;rdquo; with a perfect switch?&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;If we have to consider switch bounce, the amount of noise varies by switch&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;Should we assume the motor is under no load?&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;Should we assume the motor won&amp;rsquo;t miss any steps?&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;When working with stepper motors, the higher the VMOT, the better the motor will respond -this is one of the main objects of a chopper-type driver (more torque, &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;potentially&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; faster response time and &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;potentially&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; less missed steps)&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;We know VMOT is 12V (from the puzzle&amp;rsquo;s description) but we don&amp;rsquo;t know how well the stepper will respond to this voltage&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Just take into consideration the following example:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;In a best case scenario&amp;nbsp;(no switch bounce and no missed steps), if CFG0, CFG1 and CFG2 are left open, the Step switch has to be pushed 3200 times for a full revolution (16 micro-steps per step * 200 steps per revolution):&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;If we introduce missed steps from the motor, the value goes up&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;If we introduce switch bounce, the value in most cases&amp;nbsp;goes down&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;Combine the two above and we can only provide an exact answer (3200 times) for the best case scenario&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;Other possible solutions to the puzzle&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Since I mentioned other possible solutions when looking more closely at every detail of the puzzle, I will cover them too.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;The TMC2130 operation mode&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;The TMC2130 has a few operation modes based mostly on how the SPI_MODE is configured. &lt;/span&gt;&lt;a href="https://www.youtube.com/watch?v=Jh8iwqc1TP0&amp;amp;t=269s"&gt;&lt;span style="font-weight:400;"&gt;Some youtubers&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; point out that the TMC2130 Stepper Driver&amp;rsquo;s &lt;span style="text-decoration:underline;"&gt;default operation-mode &lt;/span&gt;&lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;varies by brand&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;. Here is &lt;/span&gt;&lt;a href="https://youtu.be/OUadiW5QLBE?t=174"&gt;&lt;span style="font-weight:400;"&gt;another youtuber&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; highlighting the same.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;There is no mention about the SPI jumper-pad in the puzzle&lt;/span&gt;&lt;span style="font-weight:400;"&gt;.&lt;/span&gt;&lt;span style="font-weight:400;"&gt; I can only assume that Clem is actually using the &lt;/span&gt;&lt;a href="https://learn.watterott.com/silentstepstick/"&gt;&lt;span style="font-weight:400;"&gt;watterott TMC2130&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; pictured in the practical example (the breadboard prototype picture), on which the jumper-pad is not visible in the Breadboard picture but &lt;/span&gt;&lt;span style="font-weight:400;"&gt;Stepper Driver datasheet shows it at &lt;/span&gt;&lt;a href="https://github.com/watterott/SilentStepStick/blob/master/hardware/SilentStepStick-TMC2130_v20.pdf"&gt;&lt;span style="font-weight:400;"&gt;the bottom of the PCB&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt;,&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="SPI Mode solder pad" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/SPI_5F00_Mode_5F00_TMC2130_2D00_LA.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;This manufacturer states that the factory&amp;rsquo;s default state of the SPI jumper is &lt;/span&gt;&lt;a href="https://learn.watterott.com/silentstepstick/pinconfig/tmc2130/"&gt;&lt;span style="font-weight:400;"&gt;left Open&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; -see the image below-.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-SPI-Jumper.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;Standalone operation&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;To Solve the puzzle for Standalone operation, we have to assume that the Stepper Driver is correctly set for Standalone operation by bridging the SPI solder-jumper, in this case SPI_MODE=0 (connected to GND) -again, the puzzle doesn&amp;#39;t mention this.&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Trinamic-TMC2130-SPI-Solder_2D00_Jumper.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;The Standalone operation mode is seen in good detail in the &lt;/span&gt;&lt;a href="https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf"&gt;&lt;span style="font-weight:400;"&gt;TMC2130&amp;#39;s Datasheet&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-Standalone-operation.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;In standalone operation, the interface pins of the stepper driver act in a TRISTATE detection (they can be connected to GND, VIO or left OPEN).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;The &lt;/span&gt;&lt;a href="https://github.com/watterott/SilentStepStick/blob/master/hardware/SilentStepStick-TMC2130_v20.pdf"&gt;&lt;span style="font-weight:400;"&gt;Watterott TMC2130 Datasheet&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; shows that the &lt;/span&gt;&lt;b&gt;CFG4&lt;/b&gt;&lt;span style="font-weight:400;"&gt; and &lt;/span&gt;&lt;b&gt;CFG5&lt;/b&gt;&lt;span style="font-weight:400;"&gt; are connected to GND but I consider them irrelevant for the puzzle solution&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt="CFG4 and CFG5" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-CFG4_2C00_5.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li style="font-weight:400;"&gt;&lt;b&gt;CFG4&lt;/b&gt;&lt;span style="font-weight:400;"&gt; is connected to GND (sets chopper hysteresis to 5)&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;b&gt;CFG5&lt;/b&gt;&lt;span style="font-weight:400;"&gt; is connected to GND (sets the Chopper Blank Time to 16 clock cycles)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;From the puzzle&amp;rsquo;s description and the practical example we also know that &lt;/span&gt;&lt;b&gt;CFG6&lt;/b&gt;&lt;span style="font-weight:400;"&gt; is connected to GND which is an Active LOW input, indicating that the stepper-driver is enabled but here we have to ignore the fact that the ENABLE pin is Pulled-Up in the Puzzle&amp;rsquo;s schematic.&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Enable.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;The rest of the solution to the puzzle in Standalone operation is already covered.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;SPI Mode&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;According to the manufacturer, this mode of operation is the &lt;/span&gt;&lt;a href="https://learn.watterott.com/silentstepstick/pinconfig/tmc2130/"&gt;&lt;span style="font-weight:400;"&gt;default operation mode&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; of the &lt;/span&gt;&lt;a href="https://learn.watterott.com/silentstepstick/"&gt;&lt;span style="font-weight:400;"&gt;watterott TMC2130&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt;, seen in good detail in the STEP/DIR application diagram -pictured below&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-STEP_2D00_DIR-application-diagram.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;span style="text-decoration:underline;"&gt;From now on&lt;/span&gt;, I will assume Clem left this solder-pad in unbridged (Open). In that order, the TMC2130 will operate in Step/Direction Driver Mode and SPI Interface (considering that in the &lt;/span&gt;&lt;a href="https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf"&gt;&lt;span style="font-weight:400;"&gt;TMC2130&amp;#39;s Datasheet&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; SPI_MODE has a pull-up Resistor so SPI_MODE=1)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="SPI_MODE input" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-Datasheet-SPI_5F00_MODE.png" /&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Clem&amp;rsquo;s practical example&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Taking a closer look at Clem&amp;rsquo;s practical example &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;only&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; (the picture of the Breadboard prototype which I have added again with labels) and assuming power is actually connected to the &lt;/span&gt;&lt;a href="/products/arduino/w/documents/2969/arduino-mega-2560-rev3-pinout-atmega2560-pin-mapping-eagle-files-schematics-and-more"&gt;&lt;span style="font-weight:400;"&gt;DC Power Input of the Arduino Mega&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; [emoticon:c3bc6fd04d0b4f1f9c1cc7d74eb1c174] then:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Clem8304circuit_2D00_foto.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;The Stepper Driver is enabled for operation (ENABLE is connected to ground and is also stated in the Puzzle&amp;rsquo;s description)&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;SPI_MODE=1 tells me that the Interface pins will operate in SPI Mode (not in the 3-state configuration mode) -again, I&amp;rsquo;m assuming this solder-jumper was left open&lt;br /&gt;&lt;img alt="TMC2130 SPI Pins" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-SPI-Pins.png" /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;From the Breadboard picture then:&lt;/span&gt;&lt;ul&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;SDI and SCK are connected to GND&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;CSN and SDO are left open, but these have pull-up resistors when not working in tristate-detection -see the &amp;ldquo;(tpu)&amp;rdquo; in the datasheet picture above, so CSN and SDO are Pulled-up to 5V.&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;CSN is the Slave Select input on a Serial communication, which is Active LOW, so unless this connected to GND, this driver will ignore any incoming serial data&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;According to the getting started section of the &lt;/span&gt;&lt;a href="https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf"&gt;&lt;span style="font-weight:400;"&gt;TMC2130&amp;#39;s Datasheet&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt;, the TMC2130 needs initialization when operating with SPI Interface&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/TMC2130-Getting-Started.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;And here is another place from the datasheet that confirms that the registers are reset on power-up&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/registers-become-0.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Based on the information presented, if Clem is using the &lt;/span&gt;&lt;a href="https://learn.watterott.com/silentstepstick/"&gt;&lt;span style="font-weight:400;"&gt;watterott TMC2130&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; stepper driver with the SPI solder-jumper left Open, the answer to the puzzle in this case is &amp;ldquo;the motor won&amp;rsquo;t turn at all&amp;rdquo;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;This makes total sense since to operate any stepper-driver, at minimum the current-limit needs to be set, which in this case needs to be configured via SPI (&lt;/span&gt;&lt;b&gt;0x10 IHOLD_IRUN - Driver current control&lt;/b&gt;&lt;span style="font-weight:400;"&gt; register).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;And here is a small demo, where I try the Stepper Driver &lt;span style="text-decoration:underline;"&gt;as is from the factory&lt;/span&gt;&amp;nbsp;(SPI Interface). There is no movement from the motor and also no voltage at one of the coil&amp;#39;s output because it hasn&amp;#39;t been initialized&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;[View:/cfs-file/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Editor_5B00_17_5D00_.mp4:640:360]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;The confusing things of the puzzle&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;I found a few misleading things in the puzzle that maybe Clem left there for a reason, either way I&amp;rsquo;ll cover some of them&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;b&gt;Taking a look at the Schematic only&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/Clems_5F00_puzzle_5F00_Schematic.png" /&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;All the switches are NO (Normally Open) and Pulled-Up&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;The ENABLE input is &lt;/span&gt;&lt;a href="https://en.wikipedia.org/wiki/Logic_level#:~:text=The%20name%20of%20an%20active,a%20bar%20above%20(Q)"&gt;&lt;span style="font-weight:400;"&gt;Active LOW&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt; (see the stepper driver symbol) and the Enable Switch (SW3) is Pulled-Up&amp;hellip; &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;just looking at this part&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;, unless you push and hold the Enable&amp;nbsp; switch (SW3) &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;before&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; pressing the Step switch (SW2), the motor won&amp;rsquo;t move&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;In the puzzle&amp;rsquo;s description nowhere is stated what is the state of the Enable Switch (SW3) but, &lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="font-weight:400;"&gt;there is mention of the Enable signal connected to GND&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt; for practical purposes, this discards the previous bullet&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;We can also see in the schematic that all the interface pins have their SPI Interface names -one can think ok we are in SPI mode-, but the puzzle description references the Interface pins by their Standalone configuration names -see image below for comparison-, so we don&amp;rsquo;t know exactly in which Interface mode the stepper is operating when putting all the puzzle&amp;#39;s information together&lt;br /&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/SPI-Interface-vs-Standalone.png" /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-weight:400;"&gt;&lt;span style="font-weight:400;"&gt;We can also see that the pin numbers and the question marks referencing MS1/SDI, MS2/SCK and MS3/CS match precisely the &lt;a href="https://www.pololu.com/product/1182"&gt;Pololu A4988 pinout&lt;/a&gt;. The puzzle precisely mentions MS1/CFG0 and MS2/CFG1 left floating (open) but, on a careful comparison these don&amp;rsquo;t precisely match -see the image below where I have added pin-numbers matching the Puzzle&amp;rsquo;s schematic&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;img alt="A4988 pinout comparison" src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/A4988-pinout-comparison.png" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;If we put all of the above together, perhaps the real answer to the puzzle is that the motor won&amp;#39;t turn at all because Mr. Clem failed spectacularly at translating the schematic into the Breadboard&amp;nbsp;[emoticon:d6dd260102fd406884fc96b8bc59760b]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Jokes aside, thank you so much for this puzzle!. I really enjoyed trying to solve the puzzle and learning about the TMC2130 which I will certainly consider in future projects with stepper motors.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Luis&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Fri, 17 Feb 2023 10:32:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>misaz</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;span&gt;Hello Element14 community.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Today I completed my practical part of this puzzle, and I would like to post my solution. In recent two weeks I did theoretical analysis and two practical experiments. The first of them failed. Here I will describe my journey with TMC2130 and stepper motors. It is my first experience with stepper motors. I already used basic DC motors, but stepper motor I used for a first time. I split my solution to several parts as described in following list:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Theoretical analysis&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Building my own module with TMC2130&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Buying and experimenting with Trinamic module&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Theoretical analysis&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;At first, I of course start to find answer in datasheet. But at the beginning I need to find datasheet. Finding datasheet of TMC2130 chip was easy but I had troubles with datasheet of the module which has some important details about connection of the chip.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In schematics it is mentioned as Pololu module but unluckily I did not find any Pololu module containing TMC2130. I opened large view of the photo, copied its URL address, downloaded it and in local viewer I over-zoomed it. Then rotated 180 deg for getting text in right direction instead of upside down.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " height="659" src="/resized-image/__size/1106x1318/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image1.jpg" width="553" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see on the module is something which look like URL address. I originally did typo and missed double t in URL. Then tried to open it and website without double t redirected me to some dangerous site and adblock prevented me to open it:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image2.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So, I gave it but later I found the correct page. Instead, I went for the chip datasheet in meantime and noticed that Trinamic site in Related products contains eval board referred as SilentStepStick which have similar form factor like module on Clem&amp;rsquo;s photo.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image3.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Trinamic SilentStepStick is available in multiple variants with several different chips. Variant with TMC2130 have no datasheet but there is schematics which replaces datasheet.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " height="557" src="/resized-image/__size/1602x1114/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image4.png" width="801" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;At this moment I had schematics of the module, schematics of the circuit and TMC2130 datasheet which should be everything needed for theoretical analysis.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Floating pins analysis&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The first thing which interested me was letting config pin floating. I remember rule of thumb that no pin of any chip should be left floating, and this violates this rule. So, at first, I was searching what floating config means and found that in case of TMC2130 it is valid situation. Most relevant information about this I found in section number 24:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image5.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I searched for meaning of all 7 configuration pins. CFG4 and CFG5 are on the module directly connected and there is no (easy) way to change them. I basically skipped them. CFG6 is enable/disable pin:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image6.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Remaining important configuration options are CFG0, CFG1, CFG2, CFG3. Note that there is numbering shift. MS1, 2, and 3 are numbered starting at 1 while CFG names are numbered starting at 0. Pay attention that MS2 != CFG2 and instead MS2 == CFG1. Later I found that MSx naming convention comes from different stepper motor driver chip and designer of TMC2130 made it compatible.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CFG0 is not very attractive and important for this puzzle. It configures timing of driver operations:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image7.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Most important for this puzzle are pins CFG1 and CFG2 which configures mode.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image8.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In this table is hidden answer to the puzzle question. With both pins let in open state each step consists of 16 micro steps which are internally interpolated to 256 micro steps by the chip. Mode of operation is StealthChop which is the more advanced mode of operation of this chip and there are also mentioned some other register configurations which generally do not impact answer to the puzzle question.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Because I am stepper motor newbie, I had to learn what the microstep means. I found answer in several other articles on internet including some explanation of internal details. Basically, I understood it is technology which splits one step of stepper motor to smaller steps by properly applying right current to the motor thus letting motor in position between two full steps. From practical point of view, it means that with 16 micro step configurations for making one full step I need to toggle STEP pin 16 times. This means that for 200 steps (full rotation of my stepper motor) I need to toggle it 200 * 16 = 3200 times.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The last configuration option CFG3 is important but do not change previously deduced answer. It configures way the TMC2130 use for measuring current flowing through motor and allowing limiting it. Changing these settings requires hardware modifications, so I let this pin open for making it working with setup which is used on module (current limit can be adjusted by potentiometer which is connected to AIN).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image9.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Button bouncing&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The previous answer saying that we need to press button 3200 times for doing one full rotation is only theoretical and in practise actual number of button presses depends on some other factors. The biggest issue which I realized in theoretical phase was button bouncing. When you press or release button it may bounce for a short period of time after the button &amp;ldquo;status&amp;rdquo; changed. This duration depends on button. Usually, it is up to 10 ms long. In this time button status oscillate and can generate several pulses. Even before I started playing with TMC2130 I connected logic analyser to my button and found that every press generates 1 to 8 rising and falling edges. Of course, this comes from experiment, and you should not suppose that you never get 9 edges. Then I wrote program using STM32G031 MCU with I2C OLED display which show number of detected edges and also debounced number of presses. After about hundreds of presses, I found that number of detected edges is about 3 to 4 higher than the (debounced) actual one.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Following outcome means that every press move motor about three to four times in average and thus required number of buttons presses reduces significantly from 3200 to somewhere between 800 and 1066.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Practical experiments later shown that there are more issues with button bounces. When the glitches are too fast, the motor may skip the step or even worse it may do step in reverse direction. This can move number of required button presses in both positive and negative directions. Datasheet contains detailed section about timing requirements (in standalone configuration which we use dedge=0):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " height="692" src="/resized-image/__size/1298x1384/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image10.png" width="649" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also note that there is filter which removes very fast glitches.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After theoretical analysis I went to practical one.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Designing my own TMC2130 module&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For saving money I decided to request free same of TMC2130 and building my own module for evaluating it. Trinamic (now ADI) confirmed my sample order, but DHL needed some papers and later I had to pay VAT for it, but it was still cheaper than buying it on my own expense and paying full shipping (and it was very fast of couser). I ordered TQFP variant of the chip for easier soldering. QFN and TQFP are exactly the same parts in terms of internal logic but because of larger pins TQFP variant can handle 1.4A motor coil current instead of 1.2A limit of QFN part. After few days I received it:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image11.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There was no time to make proper PCB so I used generic TQFP to pinhead adapter from AliExpress which I bought several years ago and some pieces remained in my cabinet:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image12.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;At first, I soldered chip and some SMD parts to it. I used SMD parts for passives which are connected to the place between two sibling pins. As a base for soldering I used schematics of the SilentStepStick module which I mentioned at beginning.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image13.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I soldered first THT passive and some pinheads. Here are pinheads for connecting motor soldered:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image142.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In schematics there were CSA shunt resistor. I had only chip SMD resistor. I soldered it rotated by 90deg and used wire for connecting second (flying) terminal to non-sibling pin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image15.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I did several mistakes when placing parts, so I had to rework it. The biggest issue was that when reworking I destroyed one pin and had to connect capacitor directly the pin of chip. But luckily it was the first pin on the side, so it was easy to soler. At the end my module look as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image16.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And some wires and caps are also at bottom side:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image17.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With soldering and reworking I spend about 3 hours, then I connected it to the circuit and tested it. On the photo below you can see (from left to right) STM32G031 disco with display counting button presses, logic analyser, breadboard with buttons, pull-up, and power LED. The rightest board on the breadboard is my own DC/DC module converting 12V input to 6V for motors. Above breadboard is motor and below is the most important part: my TMC2130 module which I described above.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " height="583" src="/resized-image/__size/1680x1166/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image18.jpg" width="840" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And unluckily it did not work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So, I spend additional 10 hours with debugging and reworking the module again. But unluckily it did not work. My outcomes from experiments and debugging were following:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Connection did not burn, all parts survived, so it was not so bad.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;TMC was alive. Using logic analyser I have seen that generating diagnostic interrupt work.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;TMC received all my step rising edges and after every 64&lt;sup&gt;th&lt;/sup&gt; edge it drove interrupt signal as expected.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Motor did not move&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Motor was not held by TMC2130&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;On motor pins there were only short glitches when step was regularly driven otherwise motor pins were held high&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;Because TNC2130 respond to my step edges by at least diagnostic interrupt I think it was alive. My theory is that experiment failed because of over-current detection. For sensing currents there is CSA and shunts with very low value, but my DIY approach most probably added resistance on wires which is most probably significantly higher that it should be and then when TMC2130 trigger motor it immediately detects overcurrent due to large voltage drop on higher resistance path and stop motor due to overcurrent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In previous theoretical analysis you have seen that there are several options for sensing current. I tried rework board for using different approach (reworks required for example bypass shunt, remove voltage divider and changing value of remaining resistor in original voltage divider) but all my attempts were without success.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Experimenting with bought module&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Previous experiment was mostly waste of time. It did not work. I saved some money but lost lot of time. But I do not give up and decided to go more common (and slightly more expensive) way. Because I was interested in stepper motors and want to learn it, I bought TMC2130 SilentStepperStick module and go in standard (expected) way. After few days I received it (with many other components from wishlist which are unrelated to this experiment):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image19.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " height="365" src="/resized-image/__size/1036x730/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image20.jpg" width="518" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see my module also have watterott domain written on it so I think it is exactly the same module as Clem have. Pin headers were bundled with module but I had to solder them manually. Note that it is not clear which side of the module is top at the first look. Usually, chips are on top side of breakout boards but in this case chip is at bottom side.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;img alt=" " height="459" src="/resized-image/__size/1030x918/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image21.jpg" width="515" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The first mistake was that I of course forget to solder bridge for selecting standalone mode (instead of SPI mode). So, I had to select very thin soldering tip and solder it later with paying attention to nearby pinhead. But I succeeded this time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " height="414" src="/resized-image/__size/1036x828/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image22.jpg" width="518" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I connected module to the circuit. It is significantly simplified in comparison with previous circuit. I also bought and changed second stepper motor for testing that my previous failure was not cause by motor instead of my module :D&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For new motor I used higher voltage about 7.2 volts, and it work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " height="495" src="/resized-image/__size/1516x990/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image23.jpg" width="758" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;On the picture you can see that I had connected logic analyser to the circuit. I have connected &amp;ldquo;signals&amp;rdquo; of one motor coil and the button.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When the motor is not moving motor signals looks as follows. Note that this is view form logic analyser but in real signals are analog. I do not have oscilloscope so this the most advanced view which I can provide.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image24.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;All pulses are same length. Motor is held in fixed position.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After applying step signal (for tests I used the attached microcontroller instead of buttons) signal changed. On following screenshot from logic analyser, you can see one step pulse (the last line).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image25.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see the first signal consist of short pulses of mostly the same length, but the second signal has pulses with changing length (in real it is sine I think, but logic analyser can&amp;rsquo;t show it). We can see that at beginning there were long pulses which were later shortening and extending again. In next step cycle signals switched roles and the same pattern was visible on first signal.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image26.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I think these signals are cause by interpolating micro steps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So now I have working circuit, so I started making experiments.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Experiment with grounded CFG1 and CFG2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;At first, I tried experiment with grounded CFG1 and CFG2. I use this mode:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image27.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It is the simplest mode making one full step per step cycle. I have motor with 200 steps per rotation, so I should click the button 200 times. But according to theory research it should be less because of button bounces. Let&amp;rsquo;s see:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[View:https://www.youtube.com/watch?v=rmUx1L0tc0s:640:360]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see motor several steps skipped, and sometimes it turned back. This behaviour I mentioned in theoretical section. At the end counter ended on 220 real presses and 393 rising edges including bounces.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Experiment with open CFG1 and CFG2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now let&amp;rsquo;s try configuration asked by this puzzle. It is this configuration:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/image28.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let&amp;rsquo;s see on video:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[View:https://www.youtube.com/watch?v=mitp-FO6Txo:640:360]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see steps were significantly smaller and some of them were efficiently invisible. In theoretical part I estimated button presses count required for full rotation in range 800 to 1066 when bounces taken in account. At the end counter stopped at 1016 real presses and 3562 detected rising edges (which includes button bounces). Expected value of rising edges was 3200 but as we have seen some steps were not very clear, some were skipped. In this mode motor very rarely moved back. These issues most probably caused deviation of missing 362 edges. But generally, values are very near expectation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The last experiment which I will show is with STEP signal driven by MCU. This can prove theoretical values 200 for grounded CFG1 and CFG2 and 3200 for open CFG1 and CFG2. In these experiments I reconfigured MCU pins from input to open-drain output and drove signal low. When driving TMC2130 by MCU there are no glitches so one turn should exactly match 200 and 3200 steps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is video for CFG1 and CFG2 grounded (SpreadCycle mode with one full step per step cycle):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[View:https://www.youtube.com/watch?v=iNQvg_-4CdE:640:360]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is video for CFG1 and CFG2 open (StealthChop mode with 16 micro steps and interpolation):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[View:https://www.youtube.com/watch?v=WNvNK5L5shM:640:360]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see StealthChop mode work very well under normal conditions and movement is very smooth.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is all from my datasheet analysis and experiment. The answer is that for full rotation with all CFG0, CFG1, CFG2 and CF3 open It is needed to generate 3200 rising edges but when used with mechanical button there is no exact answer because of random spurious events and practically using my button it is about 1000 presses.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For me it was nice two weeks spend with TMC2130 datasheet reading, planning, soldering, measuring, and learning stepper motors in generals. I learnt that stepper motor drivers are hot while I was burning my finger when touching module. I learnt many other useful information about stepper motors and their drivers. I consider last two weeks as well spend.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for reading my answer (especial thank you for your patience if you watched full video with over 1000 button presses :D) and have a nice day.&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Tue, 14 Feb 2023 11:20:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>Siana</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Trick question! Pololu does not manufacture a TMC2130 breakout. Pololu SKU 2130 is an entirely different thing, a brushed driver module.&lt;/p&gt;
&lt;p&gt;So that&amp;#39;s a Waterrott 2130 stick there. The pins are connected straight through according to schematic (&lt;a id="" href="https://github.com/watterott/SilentStepStick/raw/master/hardware/SilentStepStick-TMC2130_v20.pdf"&gt;https://github.com/watterott/SilentStepStick/raw/master/hardware/SilentStepStick-TMC2130_v20.pdf&lt;/a&gt;), MSx to CFGx for 1 to 3. SPI Mode is a jumper normally open (Standalone mode) Chip spec (&lt;a rel="nofollow" target="_blank" href="https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf):"&gt;www.trinamic.com/.../TMC2130_datasheet.pdf):&lt;/a&gt; the chip will actually probe the pins and detect them open (chapter 24 datasheet), and set the mode to 16x microstep input, interpolated output, StealthChop. You&amp;#39;ll need 16 times as many Step pin toggles as in fullstep mode to complete a revolution.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Fri, 03 Feb 2023 20:22:19 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>beacon_dave</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The motor won&amp;#39;t turn at all as Clem appears to have forgotten to plug the Arduino into a power supply...&amp;nbsp;[emoticon:4191f5ee34e248a29fa0dbe8d975f74a]&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Fri, 03 Feb 2023 20:04:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>mayermakes</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;We have already got some really strong entries! thank you very much for participating, I want to make clear that you can add to your answer, buy just adding another comment to it(its easier to follow for the people following to stay up to date instead of editing the comment).&lt;br /&gt;And I also Invite all Members to discuss the entries. For the Judging all the Entries will be taken into consideration as they are at the cut off date 24th Febuary 2023. &lt;br /&gt;Until then you can add, discuss and maybe adapt your entries!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Fri, 03 Feb 2023 19:30:01 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>rsjawale24</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;I studied the datasheet of device TMC2130.&lt;/p&gt;
&lt;p&gt;Firstly, the CFG0,1, and 2 pins work on tristate detection principle. I&amp;#39;ll talk about this later. The screenshot below shows that the pins are tristate detection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/pastedimage1675448032957v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Further, the STEP and DIR pins are DI type, where DI means Digital Input. The pins expect either a high- or low-level (logic) signals to trigger.&lt;/p&gt;
&lt;p&gt;Usually if you&amp;#39;re controlling the digital input pins of any device such as a microcontroller using an external pushbutton, a switch debouncing circuit/logic (either in hardware or software) is needed to be designed so as to avoid noisy pulses and false triggering due to mechanical operation of the externally connected switch (often a pushbutton).&lt;/p&gt;
&lt;p&gt;&lt;img height="424" src="/resized-image/__size/1184x848/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/pastedimage1675448612580v3.png" width="592" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Since, the external pushbutton has a mechanical contact inside, the operation is quite noisy (electrically noisy). I have drawn two waveforms below without a debounce circuit for the switch.&amp;nbsp;&lt;br /&gt;We expect that when the switch in open condition, the D0 pin is connected to Vdd and when the switch is in closed condition, the D0 should get connected to Gnd. But in reality, what we get at D0 is a noisy pulse(s) due to the contacts present inside the switch.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img height="468" src="/resized-image/__size/1002x936/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/pastedimage1675448821269v4.png" width="501" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The most common hardware debouncing circuit is to use a resistor and a capacitor circuit as shown below.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img height="251" src="/resized-image/__size/1338x502/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/pastedimage1675449359211v5.png" width="669" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Initially, when the switch is open, capacitor C charges through the pullup resistor R, and the voltage level at D0 pin is held stable at Vdd. When switch is closed, the capacitor starts to discharge through Rd discharge resistor and create a smooth drop in the voltage at D0 pin.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another method is to use a Schmitt trigger circuit to achieve similar results. In software, the debouncing is usually done by introducing a delay in the code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the TMC2130 IC, all the digital input (DI) pins use an internal clamping diode and Schmitt trigger inputs. Hence,&amp;nbsp;the&amp;nbsp;debouncing circuits are not needed. The same can also be seen in Clem&amp;#39;s circuit design above. The pullup is however always required as these pins are open drain config. The screenshot from datasheet is attached which mentions the same.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img height="101" src="/resized-image/__size/1332x202/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/pastedimage1675449857091v6.png" width="666" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The above statement becomes clearer when you look at the internal circuit of the pins from the datasheet.&lt;/p&gt;
&lt;p&gt;&lt;img height="289" src="/resized-image/__size/1312x578/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/pastedimage1675450161099v7.png" width="656" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Now coming to the CFG pins, here Clem is using the standalone operation mode of the TMC2130 driver. In this mode, the CFG pins determine the stepping values.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The CFG pins are used to configure the TMC2130 and operate on tristate logic. The three states are - Connected to Vdd, Connected to Gnd or open circuit.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think there is a slight mistake in Clem&amp;#39;s description, as CFG2 and CFG1 pins determine the stepping and stealth chop or spread cycle operation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img height="273" src="/resized-image/__size/1404x546/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-711c5519-71c2-48fa-b16d-f6934d09f41b/pastedimage1675450501393v8.png" width="702" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;As seen from the table above, if CFG2 and CFG1 are kept open, the configuration is as follows -&lt;br /&gt;16 microsteps, interpolation: Yes to 256 steps, StealthChop operation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In this case, the interpolation is enabled, which means the 16 microsteps are interpolated to 256 microsteps in each step pulse by the TMC2130 driver. Which means that whenever a step pulse is applied, the stepper motor will take 16 microsteps. Considering the stepper takes 200 steps for 1 full revolution means 1.8 degrees in 1 step,&amp;nbsp;&lt;br /&gt;for 16 microsteps the stepper will move by 0.1125 degrees. Hence, to complete 360 degrees (full revolution), it will require 360/0.1125 step pulses = 3200 step pulses or 3200 pushes on the STEP button.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Thu, 02 Feb 2023 19:54:29 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>alex_richter</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This reminds me of the good old Day&amp;#39;s using my Ramps Shield in my 3D Printer. Sadly i don&amp;#39;t have a TMC2130 based Driver, only DRV8826, so i have to stick to the Datasheet. &lt;br /&gt;&lt;br /&gt;From my DRV8826 i remember, that MS1-3 is used to set the microstepping amount. The TMC2130 supports up to 256 Steps, (which is nice, since it will let the Motor run quite smooth) . Typically Microsteps are set from None / Fullstep up to the max supported Steps by doubling the amount of microsteps, (/2, /4, /8, /16, /32, /64,&amp;nbsp; /128, /256). This is a multiplicator, since each Step is divided by the microstepping. &lt;br /&gt;Now with connecting MS1-3 High, Low or leaving it open the Microstepping mode is encoded. I had to google around for a bit, since i didn&amp;#39;t understand the TMC2130 Datasheet &amp;#39;:/ &lt;br /&gt;I found a very helpful Overview on a website called &amp;quot;microcontrollertutorials&amp;quot;. &lt;br /&gt;&lt;a id="" href="https://www.microcontrollertutorials.com/2021/07/tmc2130-stepper-motor-driver-working.html"&gt;https://www.microcontrollertutorials.com/2021/07/tmc2130-stepper-motor-driver-working.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is a list, which MS Pin Combo stands for which Microstepping setting. &lt;br /&gt;&lt;br /&gt;I found that other than with the DRV8825 only two pins are used for microstepping - &amp;gt; CFG 1 &amp;amp; 2 &lt;br /&gt;Now this riddle asks about leaving CFG0 &amp;amp; 1 floating. It is not clearly defined, what happens to CFG 2, but because it was explained before, that it is typically pulled to GND, i will expect it beeing pulled to GND.&lt;br /&gt;&lt;br /&gt;Looking at the Table, i now check which Microstepping is used, with CFG2 pulled to GND and CFG1 floating.&lt;br /&gt;The Answer is 1/2. &lt;br /&gt;If the CFG2 Assumption is wrong,and CFG2 is HIGH the answer would be 1/4 and if floating also 1/16.&lt;br /&gt;The diver will internally interpolate in all three cases to 256 microsteps, which will make the motor run quite quietly.&lt;br /&gt;&lt;br /&gt;But what is up with CFG0? &lt;br /&gt;The same website gives a clue. CFG0 apparently sets &amp;quot;CFG0&amp;nbsp; &amp;nbsp;----&amp;gt;&amp;nbsp; &amp;nbsp;Chopper Off Time TOFF (GND=140tclk, VIO=236tclk, OPEN=332tclk)&amp;quot;&lt;br /&gt;&lt;br /&gt;So leaving it Open would set it to 332tclk. What that means i don&amp;#39;t know. So i google &amp;quot;TMC2130 CFG0&amp;quot;&amp;nbsp; and find this website by Trinamic:&lt;br /&gt;&lt;a href="https://www.trinamic.com/technology/motor-control-technology/chopper-modes/"&gt;https://www.trinamic.com/technology/motor-control-technology/chopper-modes/. &lt;/a&gt;&lt;br /&gt;My understanding of the Chopper is, that it is part of the constant current driver for the motor coils and is mainly responible of noise reduction and vibration dampening. &lt;br /&gt;So in this usecase it shouldn&amp;#39;t matter at all. &lt;br /&gt;&lt;br /&gt;Ok let&amp;#39;s get to the solution part.&lt;br /&gt;&lt;br /&gt;Taking our solution to the selected microstepping mode of 1/2 (halfstep) in account, we can now calculate the Solution. &lt;br /&gt;I guess the Puzzle also refers to the example Motor of 200Steps / Rev. driven in Halfstep Mode that is 400 Steps / Revolution -&amp;gt; &lt;br /&gt;&lt;br /&gt;you have to press that button 400 times for one rotation. &lt;br /&gt;&lt;br /&gt;Since we don&amp;#39;t know the State of CFG2 i&amp;#39;ll also provide it&amp;#39;s solution. CFG0 connected to 5V will result in 200*4 = 800 and letting it float 200*16 = 3200 steps per Rotation bzw. Clicking that Button for one revolution. &lt;br /&gt;&lt;br /&gt;Useing a higher resolution Motor woth 400 Steps/ Revolution and a 0.9&amp;deg; will double that amount of button clicking. &lt;br /&gt;Pressing the direction Button will rotate the Motor left or right, so it can either be left alone or has to stay pressed until the revolution is completed. &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank you for this puzzle, it&amp;#39;s been fun&lt;br /&gt;Cheers, Alex&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Clem&amp;#39;s Stepper Motor Puzzle!</title><link>https://community.element14.com/members-area/b/blog/posts/stepper_2d00_motor_2d00_puzzle</link><pubDate>Thu, 02 Feb 2023 17:57:37 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:711c5519-71c2-48fa-b16d-f6934d09f41b</guid><dc:creator>dougw</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Interesting puzzle, great prize. Normally I would be all over such a puzzle, but I recently won a scope, so I will let others tackle this one. I do have another question though....would switch bounce cause extra motor steps?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25172&amp;AppID=75&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>