element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Community Hub
Community Hub
Member Blogs Clem's Stepper Motor Puzzle!
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mayermakes
  • Date Created: 2 Feb 2023 4:07 PM Date Created
  • Views 27538 views
  • Likes 16 likes
  • Comments 43 comments
  • stepper motor
  • puzzle
Related
Recommended

Clem's Stepper Motor Puzzle!

mayermakes
mayermakes
2 Feb 2023
Clem's Stepper Motor Puzzle!


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 remain.
Among the crucial skills of makers and engineers is interpreting a datasheet and this will come in very handy for the following puzzle:

This time we are looking at a staple of the 3d printing and CNC world:  the TMC2130 stepper motor driver.


imageimage

The photo and schematic show a basic circuit that allows the user to control the movement of a bipolar stepper motor with simple button pushes.
For practical reasons the built circuit has the enable pin(EN) pulled low to activate the circuit.  The Arduino is only used to pass on 12V, 5V and GND to the tmc2130, it has not other connections to the circuit.
Pulling the DIR pin high or low determines the direction of the motor movement.
Pulsing the STEP pin makes the motor move.
But how far does the motor move?

The pins MS1, MS2,MS3 (also known as CFG0,CFG1,CFG2) determine the movement settings; the most widely used configuration is to pull all 3 of them low.
CFG2 determines where to get the voltage reference from. Low level sets it to internal.
The other two pins are much more interesting.
By pulling MS1/CFG0 and MS2/CGF1 low, we set the driver to "Full step," no interpolation and spreadcycle mode.
The most common stepper motors need to do 200 steps per revolution (1,8° angle change per full step).
So for a full rotation we need to press the step button 200 times.

So far so good.

Here is the puzzle:
What happens if you just leave MS1/CFG0 and MS2/CFG1 floating (open) -- how often would you have to push the STEP button for a full rotation?

Or do you think the motor would just not turn at all?

You can find the solution in theory and practice!  We are interested in not only getting the answer right but in seeing the work you did to arrive at this answer.

Tell us if you tried you try it out practically (show us pictures). Or did you study datasheets or video tutorials (share the links you found helpful)?

The member who provides the best detail on how he or she solved the puzzle wins the prize!

Terms and Conditions  Multicomp Pro Tablet Oscilloscope

  • Sign in to reply

Top Comments

  • mayermakes
    mayermakes over 3 years ago +4
    https://youtu.be/4N-O1IzRSfc 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) The element14 community…
  • beacon_dave
    beacon_dave over 3 years ago +3
    The motor won't turn at all as Clem appears to have forgotten to plug the Arduino into a power supply...
  • misaz
    misaz over 3 years ago in reply to mayermakes +3
    Thank you for sending it. Yesterday it arrived and I am playing with it. Fundamental signals are well shown. More details I will post in blog soon.
  • misaz
    misaz over 3 years ago +2
    Hello Element14 community. 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…
  • mayermakes
    mayermakes over 3 years ago +2
    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! We will carefully review all the entries, even…
  • Siana
    Siana over 3 years ago +1
    Trick question! Pololu does not manufacture a TMC2130 breakout. Pololu SKU 2130 is an entirely different thing, a brushed driver module. So that's a Waterrott 2130 stick there. The pins are connected…
  • rsjawale24
    rsjawale24 over 3 years ago in reply to dougw +1
    I would love to do the experimental analysis as theory often needs to be validated using experiments. But I do not have the resources and currently I'm running on a tight schedule. Maybe someone can do…
  • rsjawale24
    rsjawale24 over 3 years ago in reply to misaz +1
    Nice! I always love to see practical applications!
  • mayermakes
    mayermakes over 3 years ago in reply to misaz +1
    Hope you get great use out of your shiny new gadget!
  • mayermakes
    mayermakes over 3 years ago

    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).
    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.
    Until then you can add, discuss and maybe adapt your entries!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsjawale24
    rsjawale24 over 3 years ago in reply to rsjawale24

    I forgot to mention an important point here -

    When the interpol =1, the step button should be pressed at a minimum interval/frequency to avoid a standstill event. Also, the step button then should be pressed at the same interval/frequency to avoid any standstill events in between the stepping. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsjawale24
    rsjawale24 over 3 years ago in reply to rsjawale24

    I have never worked on stepper motors before and all my understanding came from the following resources -
    Microstepping - Trinamic
    TMC2130_datasheet_rev1.15.pdf

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsjawale24
    rsjawale24 over 3 years ago

    I studied the datasheet of device TMC2130.

    Firstly, the CFG0,1, and 2 pins work on tristate detection principle. I'll talk about this later. The screenshot below shows that the pins are tristate detection. 

    image

    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.

    Usually if you'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).

    image

    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. 
    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. 

    image

    The most common hardware debouncing circuit is to use a resistor and a capacitor circuit as shown below. 

    image

    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. 

    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. 

    In the TMC2130 IC, all the digital input (DI) pins use an internal clamping diode and Schmitt trigger inputs. Hence, the debouncing circuits are not needed. The same can also be seen in Clem'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. 

    image

    The above statement becomes clearer when you look at the internal circuit of the pins from the datasheet.

    image

    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. 

    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. 

    I think there is a slight mistake in Clem's description, as CFG2 and CFG1 pins determine the stepping and stealth chop or spread cycle operation. 

    image

    As seen from the table above, if CFG2 and CFG1 are kept open, the configuration is as follows -
    16 microsteps, interpolation: Yes to 256 steps, StealthChop operation. 

    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, 
    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. 

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 3 years ago in reply to mayermakes

    ooo....a clue....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube