My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

class_t_m_c26_x_stepper.html 106KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <title>Trinamic TMC26X Stepper Driver for Arduino: TMC26XStepper Class Reference</title>
  7. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  8. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  9. </head>
  10. <body>
  11. <div id="top"><!-- do not remove this div! -->
  12. <div id="titlearea">
  13. <table cellspacing="0" cellpadding="0">
  14. <tbody>
  15. <tr style="height: 56px;">
  16. <td style="padding-left: 0.5em;">
  17. <div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
  18. </div>
  19. </td>
  20. </tr>
  21. </tbody>
  22. </table>
  23. </div>
  24. <!-- Generated by Doxygen 1.7.6.1 -->
  25. <div id="navrow1" class="tabs">
  26. <ul class="tablist">
  27. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  28. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  29. <li><a href="files.html"><span>Files</span></a></li>
  30. </ul>
  31. </div>
  32. <div id="navrow2" class="tabs2">
  33. <ul class="tablist">
  34. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  35. <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
  36. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  37. </ul>
  38. </div>
  39. </div>
  40. <div class="header">
  41. <div class="summary">
  42. <a href="#pub-methods">Public Member Functions</a> </div>
  43. <div class="headertitle">
  44. <div class="title">TMC26XStepper Class Reference</div> </div>
  45. </div><!--header-->
  46. <div class="contents">
  47. <!-- doxytag: class="TMC26XStepper" -->
  48. <p>Class representing a TMC26X stepper driver.
  49. <a href="class_t_m_c26_x_stepper.html#details">More...</a></p>
  50. <p><code>#include &lt;<a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>&gt;</code></p>
  51. <p><a href="class_t_m_c26_x_stepper-members.html">List of all members.</a></p>
  52. <table class="memberdecls">
  53. <tr><td colspan="2"><h2><a name="pub-methods"></a>
  54. Public Member Functions</h2></td></tr>
  55. <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper</a> (int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150)</td></tr>
  56. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">creates a new represenatation of a stepper motor connected to a TMC26X stepper driver <a href="#a3ef40763b8b8ab2b6ed4978c0647906c"></a><br/></td></tr>
  57. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">start</a> ()</td></tr>
  58. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode. <a href="#aad1ed82b3e05940bde5a6c7ed3d3e8f7"></a><br/></td></tr>
  59. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">un_start</a> ()</td></tr>
  60. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">resets the stepper in unconfigured mode. <a href="#af968e70a13068f1e71ac0fa6865630c5"></a><br/></td></tr>
  61. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">setSpeed</a> (unsigned int whatSpeed)</td></tr>
  62. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the rotation speed in revolutions per minute. <a href="#a9478f43090995c8d5cdb4d4e8c07cdbd"></a><br/></td></tr>
  63. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">getSpeed</a> (void)</td></tr>
  64. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">reads out the currently selected speed in revolutions per minute. <a href="#aa564f5cc0218d30ef897c2830c768c29"></a><br/></td></tr>
  65. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">setMicrosteps</a> (int number_of_steps)</td></tr>
  66. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the number of microsteps in 2^i values (rounded) up to 256. <a href="#a21041579c7f9284567ee2e2a55a3afd0"></a><br/></td></tr>
  67. <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">getMicrosteps</a> (void)</td></tr>
  68. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the effective current number of microsteps selected. <a href="#a5808551ced98b79c09bbb4bf47ecfec3"></a><br/></td></tr>
  69. <tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">step</a> (int number_of_steps)</td></tr>
  70. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in the other direction. <a href="#ac073a742496885f1f60751f9fb9c395d"></a><br/></td></tr>
  71. <tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">move</a> (void)</td></tr>
  72. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Central movement method, must be called as often as possible in the lopp function and is very fast. <a href="#aed5d81f1549615529c723600a68ba415"></a><br/></td></tr>
  73. <tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">isMoving</a> (void)</td></tr>
  74. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if the motor still has to move to fulfill the last movement command. <a href="#a880d602be8414b7b965287c1790cd50e"></a><br/></td></tr>
  75. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">getStepsLeft</a> (void)</td></tr>
  76. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of steps left in the current movement. <a href="#aa6c3211f85301ca0fb2e7b73cb8142a7"></a><br/></td></tr>
  77. <tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">stop</a> (void)</td></tr>
  78. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the motor regardless if it moves or not. <a href="#a6315c18eadbc6bf4f3d81a6f80296123"></a><br/></td></tr>
  79. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">setConstantOffTimeChopper</a> (char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator)</td></tr>
  80. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets and configure the classical Constant Off Timer Chopper. <a href="#ac2d8a2bbae2aba3ed7c98e3ff1a06649"></a><br/></td></tr>
  81. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">setSpreadCycleChopper</a> (char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement)</td></tr>
  82. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets and configures with spread cycle chopper. <a href="#aa152bb7ddb72a2bc8465553a39232df2"></a><br/></td></tr>
  83. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">setRandomOffTime</a> (char value)</td></tr>
  84. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Use random off time for noise reduction (0 for off, -1 for on). <a href="#a7ffd602cf4bf385847cba034417d5f0a"></a><br/></td></tr>
  85. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">setCurrent</a> (unsigned int current)</td></tr>
  86. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller by employing CoolStep. <a href="#aaa35fac83417c16b3a941fa168e4a4d2"></a><br/></td></tr>
  87. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">getCurrent</a> (void)</td></tr>
  88. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> <a href="#a0c544e23efe3e4a912aacf57de84b71f"></a><br/></td></tr>
  89. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">setStallGuardThreshold</a> (char stall_guard_threshold, char stall_guard_filter_enabled)</td></tr>
  90. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set the StallGuard threshold in order to get sensible StallGuard readings. <a href="#af1a5abc23757860baf8ff421689a425a"></a><br/></td></tr>
  91. <tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">getStallGuardThreshold</a> (void)</td></tr>
  92. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">reads out the StallGuard threshold <a href="#a056661f444725c3ae15696d1e8d91def"></a><br/></td></tr>
  93. <tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">getStallGuardFilter</a> (void)</td></tr>
  94. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the current setting of the StallGuard filter <a href="#a47e3443e3e786314c1099b8f14a91b8a"></a><br/></td></tr>
  95. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">setCoolStepConfiguration</a> (unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size, unsigned char current_increment_step_size, unsigned char lower_current_limit)</td></tr>
  96. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. <a href="#a381fbcce7c586ca2f1da8f9e704df14e"></a><br/></td></tr>
  97. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">setCoolStepEnabled</a> (boolean enabled)</td></tr>
  98. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it. <a href="#a15bf0ed5a166a5d9a41f90f3ccbc6157"></a><br/></td></tr>
  99. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">isCoolStepEnabled</a> ()</td></tr>
  100. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">check if the CoolStep feature is enabled <a href="#a6de2306b6d8dc1fa2e50fccb66d8e66d"></a><br/></td></tr>
  101. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">getCoolStepLowerSgThreshold</a> ()</td></tr>
  102. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the lower StallGuard threshold for the CoolStep operation <a href="#aa7469949deaa39a58038b3ddef532bc8"></a><br/></td></tr>
  103. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">getCoolStepUpperSgThreshold</a> ()</td></tr>
  104. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the upper StallGuard threshold for the CoolStep operation <a href="#ac61298fd658773c28823d33ab04e970f"></a><br/></td></tr>
  105. <tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">getCoolStepNumberOfSGReadings</a> ()</td></tr>
  106. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the number of StallGuard readings befor CoolStep adjusts the motor current. <a href="#aad44ee5ae73bf8e69af05674a304ba46"></a><br/></td></tr>
  107. <tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">getCoolStepCurrentIncrementSize</a> ()</td></tr>
  108. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the increment steps for the current for the CoolStep operation <a href="#ababe688a15f087d23d4ff2094fcee883"></a><br/></td></tr>
  109. <tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">getCoolStepLowerCurrentLimit</a> ()</td></tr>
  110. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the absolut minium current for the CoolStep operation <a href="#a0c7e8541abc120a3910e35c6fbf2167c"></a><br/></td></tr>
  111. <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">getMotorPosition</a> (void)</td></tr>
  112. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current microstep position for phase A. <a href="#a1019f6f889acfd3176eecd60a0a20125"></a><br/></td></tr>
  113. <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">getCurrentStallGuardReading</a> (void)</td></tr>
  114. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current StallGuard value. <a href="#aed570ce3eea640e087b046333015de1e"></a><br/></td></tr>
  115. <tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">getCurrentCSReading</a> (void)</td></tr>
  116. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current current setting value as fraction of the maximum current Returns values between 0 and 31, representing 1/32 to 32/32 (=1) <a href="#a1a939fb495d747c2c11be99a740371e1"></a><br/></td></tr>
  117. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">isCurrentScalingHalfed</a> ()</td></tr>
  118. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference. <a href="#ad435db189ebb101fb2de90a484f33905"></a><br/></td></tr>
  119. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">getCurrentCurrent</a> (void)</td></tr>
  120. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it may not be the fastest. <a href="#aa00741168a7def0a7a9d2f2c9d3b99d7"></a><br/></td></tr>
  121. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">isStallGuardOverThreshold</a> (void)</td></tr>
  122. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if there is a StallGuard warning in the last status <a href="#aea4c6e1fac909116c6b55f902d6cff41"></a><br/></td></tr>
  123. <tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">getOverTemperature</a> (void)</td></tr>
  124. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return over temperature status of the last status readout return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. <a href="#a7662c2fbc03d1f5a7da5cabcc153b2d7"></a><br/></td></tr>
  125. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">isShortToGroundA</a> (void)</td></tr>
  126. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is motor channel A shorted to ground detected in the last status readout. <a href="#ad329fa4693d3139dea241ebe3d0f33cf"></a><br/></td></tr>
  127. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">isShortToGroundB</a> (void)</td></tr>
  128. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is motor channel B shorted to ground detected in the last status readout. <a href="#a0ccb54d40cce0d802aa56ff6261f9f3b"></a><br/></td></tr>
  129. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">isOpenLoadA</a> (void)</td></tr>
  130. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">iIs motor channel A connected according to the last statu readout. <a href="#af97b2ab9d1ba36765ac6f17cf25ec45c"></a><br/></td></tr>
  131. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">isOpenLoadB</a> (void)</td></tr>
  132. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">iIs motor channel A connected according to the last statu readout. <a href="#a303590124f5ac6d6a06d0ec60d0b5303"></a><br/></td></tr>
  133. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">isStandStill</a> (void)</td></tr>
  134. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s. <a href="#ab26602f360a4fb6ec6d262011675b2b0"></a><br/></td></tr>
  135. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">isStallGuardReached</a> (void)</td></tr>
  136. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if there is a StallGuard warning in the last status <a href="#afdeded501ec2cabeffde33d31b6573f7"></a><br/></td></tr>
  137. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">setEnabled</a> (boolean enabled)</td></tr>
  138. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. <a href="#a4472cd86ad5b65dec5ec45ce69158305"></a><br/></td></tr>
  139. <tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">isEnabled</a> ()</td></tr>
  140. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely <a href="#a15796c0cbdeab23a343c3f25327283b6"></a><br/></td></tr>
  141. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">readStatus</a> (char read_value)</td></tr>
  142. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Manually read out the status register This function sends a byte to the motor driver in order to get the current readout. The parameter read_value seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method may take time to send and read one or two bits - depending on the previous readout. <a href="#af95a824bfdf49ef979b5354798e52967"></a><br/></td></tr>
  143. <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">getResistor</a> ()</td></tr>
  144. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150. <a href="#ae1db5ec2ec9bfbfaea83c659e006692e"></a><br/></td></tr>
  145. <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">debugLastStatus</a> (void)</td></tr>
  146. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints out all the information that can be found in the last status read out - it does not force a status readout. The result is printed via Serial. <a href="#ad5e5b1bf5a46d02577dd548083877ec3"></a><br/></td></tr>
  147. <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">version</a> (void)</td></tr>
  148. <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">library version <a href="#ab040d9df1e85d6fb0c105205a36b0215"></a><br/></td></tr>
  149. </table>
  150. <hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
  151. <div class="textblock"><p>Class representing a TMC26X stepper driver. </p>
  152. <p>In order to use one fo those drivers in your Arduino code you have to create an object of that class: </p>
  153. <div class="fragment"><pre class="fragment"> <a class="code" href="class_t_m_c26_x_stepper.html" title="Class representing a TMC26X stepper driver.">TMC26XStepper</a> stepper = <a class="code" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c" title="creates a new represenatation of a stepper motor connected to a TMC26X stepper driver">TMC26XStepper</a>(200,1,2,3,500);
  154. </pre></div><p> see TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int rms_current)</p>
  155. <p>Keep in mind that you need to start the driver with <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">start()</a> in order to get the TMC26X configured.</p>
  156. <p>The most important function is the <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a>. It checks if the motor has to do a step or not. It is important that you call <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a> as often as possible in your Arduino loop() routine. I suggest to use a very fast loop routine and always call it at the beginning or the end.</p>
  157. <p>In order to move you have to provide a movement speed with <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed()</a>. The speed is a positive value setting the rotations per minute.</p>
  158. <p>To really move the motor you have to call <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a> to tell the driver to move the motor the given number of steps in the given direction. Positive values move the motor in one direction, negative values in the other direction.</p>
  159. <p>You can check with <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> if the mototr is still moving or stop it apruptely with <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a>. </p>
  160. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00101">101</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
  161. </div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
  162. <a class="anchor" id="a3ef40763b8b8ab2b6ed4978c0647906c"></a><!-- doxytag: member="TMC26XStepper::TMC26XStepper" ref="a3ef40763b8b8ab2b6ed4978c0647906c" args="(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150)" -->
  163. <div class="memitem">
  164. <div class="memproto">
  165. <table class="memname">
  166. <tr>
  167. <td class="memname"><a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper::TMC26XStepper</a> </td>
  168. <td>(</td>
  169. <td class="paramtype">int&#160;</td>
  170. <td class="paramname"><em>number_of_steps</em>, </td>
  171. </tr>
  172. <tr>
  173. <td class="paramkey"></td>
  174. <td></td>
  175. <td class="paramtype">int&#160;</td>
  176. <td class="paramname"><em>cs_pin</em>, </td>
  177. </tr>
  178. <tr>
  179. <td class="paramkey"></td>
  180. <td></td>
  181. <td class="paramtype">int&#160;</td>
  182. <td class="paramname"><em>dir_pin</em>, </td>
  183. </tr>
  184. <tr>
  185. <td class="paramkey"></td>
  186. <td></td>
  187. <td class="paramtype">int&#160;</td>
  188. <td class="paramname"><em>step_pin</em>, </td>
  189. </tr>
  190. <tr>
  191. <td class="paramkey"></td>
  192. <td></td>
  193. <td class="paramtype">unsigned int&#160;</td>
  194. <td class="paramname"><em>current</em>, </td>
  195. </tr>
  196. <tr>
  197. <td class="paramkey"></td>
  198. <td></td>
  199. <td class="paramtype">unsigned int&#160;</td>
  200. <td class="paramname"><em>resistor</em> = <code>150</code>&#160;</td>
  201. </tr>
  202. <tr>
  203. <td></td>
  204. <td>)</td>
  205. <td></td><td></td>
  206. </tr>
  207. </table>
  208. </div>
  209. <div class="memdoc">
  210. <p>creates a new represenatation of a stepper motor connected to a TMC26X stepper driver </p>
  211. <p>This is the main constructor. If in doubt use this. You must provide all parameters as described below.</p>
  212. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  213. <table class="params">
  214. <tr><td class="paramname">number_of_steps</td><td>the number of steps the motor has per rotation. </td></tr>
  215. <tr><td class="paramname">cs_pin</td><td>The Arduino pin you have connected the Cient Select Pin (!CS) of the TMC26X for SPI </td></tr>
  216. <tr><td class="paramname">dir_pin</td><td>the number of the Arduino pin the Direction input of the TMC26X is connected </td></tr>
  217. <tr><td class="paramname">step_pin</td><td>the number of the Arduino pin the step pin of the TMC26X driver is connected. </td></tr>
  218. <tr><td class="paramname">rms_current</td><td>the maximum current to privide to the motor in mA (!). A value of 200 would send up to 200mA to the motor </td></tr>
  219. <tr><td class="paramname">resistor</td><td>the current sense resistor in milli Ohm, defaults to ,15 Ohm ( or 150 milli Ohm) as in the TMC260 Arduino Shield</td></tr>
  220. </table>
  221. </dd>
  222. </dl>
  223. <p>Keep in mind that you must also call <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">TMC26XStepper.start()</a> in order to configure the stepper driver for use.</p>
  224. <p>By default the Constant Off Time chopper is used, see TCM262Stepper.setConstantOffTimeChopper() for details. This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper, see <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2" title="Sets and configures with spread cycle chopper.">setSpreadCycleChopper()</a>.</p>
  225. <p>By default a microstepping of 1/32th is used to provide a smooth motor run, while still giving a good progression per step. You can select a different stepping with <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> to aa different value. </p>
  226. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">start()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> </dd></dl>
  227. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00111">111</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  228. </div>
  229. </div>
  230. <hr/><h2>Member Function Documentation</h2>
  231. <a class="anchor" id="ad5e5b1bf5a46d02577dd548083877ec3"></a><!-- doxytag: member="TMC26XStepper::debugLastStatus" ref="ad5e5b1bf5a46d02577dd548083877ec3" args="(void)" -->
  232. <div class="memitem">
  233. <div class="memproto">
  234. <table class="memname">
  235. <tr>
  236. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">TMC26XStepper::debugLastStatus</a> </td>
  237. <td>(</td>
  238. <td class="paramtype">void&#160;</td>
  239. <td class="paramname"></td><td>)</td>
  240. <td></td>
  241. </tr>
  242. </table>
  243. </div>
  244. <div class="memdoc">
  245. <p>Prints out all the information that can be found in the last status read out - it does not force a status readout. The result is printed via Serial. </p>
  246. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00902">902</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  247. </div>
  248. </div>
  249. <a class="anchor" id="ababe688a15f087d23d4ff2094fcee883"></a><!-- doxytag: member="TMC26XStepper::getCoolStepCurrentIncrementSize" ref="ababe688a15f087d23d4ff2094fcee883" args="()" -->
  250. <div class="memitem">
  251. <div class="memproto">
  252. <table class="memname">
  253. <tr>
  254. <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">TMC26XStepper::getCoolStepCurrentIncrementSize</a> </td>
  255. <td>(</td>
  256. <td class="paramname"></td><td>)</td>
  257. <td></td>
  258. </tr>
  259. </table>
  260. </div>
  261. <div class="memdoc">
  262. <p>returns the increment steps for the current for the CoolStep operation </p>
  263. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
  264. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00704">704</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  265. </div>
  266. </div>
  267. <a class="anchor" id="a0c7e8541abc120a3910e35c6fbf2167c"></a><!-- doxytag: member="TMC26XStepper::getCoolStepLowerCurrentLimit" ref="a0c7e8541abc120a3910e35c6fbf2167c" args="()" -->
  268. <div class="memitem">
  269. <div class="memproto">
  270. <table class="memname">
  271. <tr>
  272. <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">TMC26XStepper::getCoolStepLowerCurrentLimit</a> </td>
  273. <td>(</td>
  274. <td class="paramname"></td><td>)</td>
  275. <td></td>
  276. </tr>
  277. </table>
  278. </div>
  279. <div class="memdoc">
  280. <p>returns the absolut minium current for the CoolStep operation </p>
  281. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd>
  282. <dd>
  283. <a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>, COOL_STEP_QUARTER_CS_LIMIT </dd></dl>
  284. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00712">712</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  285. </div>
  286. </div>
  287. <a class="anchor" id="aa7469949deaa39a58038b3ddef532bc8"></a><!-- doxytag: member="TMC26XStepper::getCoolStepLowerSgThreshold" ref="aa7469949deaa39a58038b3ddef532bc8" args="()" -->
  288. <div class="memitem">
  289. <div class="memproto">
  290. <table class="memname">
  291. <tr>
  292. <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">TMC26XStepper::getCoolStepLowerSgThreshold</a> </td>
  293. <td>(</td>
  294. <td class="paramname"></td><td>)</td>
  295. <td></td>
  296. </tr>
  297. </table>
  298. </div>
  299. <div class="memdoc">
  300. <p>returns the lower StallGuard threshold for the CoolStep operation </p>
  301. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
  302. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00695">695</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  303. </div>
  304. </div>
  305. <a class="anchor" id="aad44ee5ae73bf8e69af05674a304ba46"></a><!-- doxytag: member="TMC26XStepper::getCoolStepNumberOfSGReadings" ref="aad44ee5ae73bf8e69af05674a304ba46" args="()" -->
  306. <div class="memitem">
  307. <div class="memproto">
  308. <table class="memname">
  309. <tr>
  310. <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">TMC26XStepper::getCoolStepNumberOfSGReadings</a> </td>
  311. <td>(</td>
  312. <td class="paramname"></td><td>)</td>
  313. <td></td>
  314. </tr>
  315. </table>
  316. </div>
  317. <div class="memdoc">
  318. <p>returns the number of StallGuard readings befor CoolStep adjusts the motor current. </p>
  319. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
  320. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00708">708</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  321. </div>
  322. </div>
  323. <a class="anchor" id="ac61298fd658773c28823d33ab04e970f"></a><!-- doxytag: member="TMC26XStepper::getCoolStepUpperSgThreshold" ref="ac61298fd658773c28823d33ab04e970f" args="()" -->
  324. <div class="memitem">
  325. <div class="memproto">
  326. <table class="memname">
  327. <tr>
  328. <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">TMC26XStepper::getCoolStepUpperSgThreshold</a> </td>
  329. <td>(</td>
  330. <td class="paramname"></td><td>)</td>
  331. <td></td>
  332. </tr>
  333. </table>
  334. </div>
  335. <div class="memdoc">
  336. <p>returns the upper StallGuard threshold for the CoolStep operation </p>
  337. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
  338. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00700">700</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  339. </div>
  340. </div>
  341. <a class="anchor" id="a0c544e23efe3e4a912aacf57de84b71f"></a><!-- doxytag: member="TMC26XStepper::getCurrent" ref="a0c544e23efe3e4a912aacf57de84b71f" args="(void)" -->
  342. <div class="memitem">
  343. <div class="memproto">
  344. <table class="memname">
  345. <tr>
  346. <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">TMC26XStepper::getCurrent</a> </td>
  347. <td>(</td>
  348. <td class="paramtype">void&#160;</td>
  349. <td class="paramname"></td><td>)</td>
  350. <td></td>
  351. </tr>
  352. </table>
  353. </div>
  354. <div class="memdoc">
  355. <p>readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </p>
  356. <dl class="return"><dt><b>Returns:</b></dt><dd>the maximum motor current in milli amps </dd></dl>
  357. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </dd></dl>
  358. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00336">336</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  359. </div>
  360. </div>
  361. <a class="anchor" id="a1a939fb495d747c2c11be99a740371e1"></a><!-- doxytag: member="TMC26XStepper::getCurrentCSReading" ref="a1a939fb495d747c2c11be99a740371e1" args="(void)" -->
  362. <div class="memitem">
  363. <div class="memproto">
  364. <table class="memname">
  365. <tr>
  366. <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">TMC26XStepper::getCurrentCSReading</a> </td>
  367. <td>(</td>
  368. <td class="paramtype">void&#160;</td>
  369. <td class="paramname"></td><td>)</td>
  370. <td></td>
  371. </tr>
  372. </table>
  373. </div>
  374. <div class="memdoc">
  375. <p>Reads the current current setting value as fraction of the maximum current Returns values between 0 and 31, representing 1/32 to 32/32 (=1) </p>
  376. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
  377. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00781">781</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  378. </div>
  379. </div>
  380. <a class="anchor" id="aa00741168a7def0a7a9d2f2c9d3b99d7"></a><!-- doxytag: member="TMC26XStepper::getCurrentCurrent" ref="aa00741168a7def0a7a9d2f2c9d3b99d7" args="(void)" -->
  381. <div class="memitem">
  382. <div class="memproto">
  383. <table class="memname">
  384. <tr>
  385. <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">TMC26XStepper::getCurrentCurrent</a> </td>
  386. <td>(</td>
  387. <td class="paramtype">void&#160;</td>
  388. <td class="paramname"></td><td>)</td>
  389. <td></td>
  390. </tr>
  391. </table>
  392. </div>
  393. <div class="memdoc">
  394. <p>Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it may not be the fastest. </p>
  395. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1" title="Reads the current current setting value as fraction of the maximum current Returns values between 0 a...">getCurrentCSReading()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e" title="Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150...">getResistor()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905" title="a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.">isCurrentScalingHalfed()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">getCurrent()</a> </dd></dl>
  396. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00792">792</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  397. </div>
  398. </div>
  399. <a class="anchor" id="aed570ce3eea640e087b046333015de1e"></a><!-- doxytag: member="TMC26XStepper::getCurrentStallGuardReading" ref="aed570ce3eea640e087b046333015de1e" args="(void)" -->
  400. <div class="memitem">
  401. <div class="memproto">
  402. <table class="memname">
  403. <tr>
  404. <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">TMC26XStepper::getCurrentStallGuardReading</a> </td>
  405. <td>(</td>
  406. <td class="paramtype">void&#160;</td>
  407. <td class="paramname"></td><td>)</td>
  408. <td></td>
  409. </tr>
  410. </table>
  411. </div>
  412. <div class="memdoc">
  413. <p>Reads the current StallGuard value. </p>
  414. <dl class="return"><dt><b>Returns:</b></dt><dd>The current StallGuard value, lesser values indicate higher load, 0 means stall detected. Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. </dd></dl>
  415. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>
  416. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00770">770</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  417. </div>
  418. </div>
  419. <a class="anchor" id="a5808551ced98b79c09bbb4bf47ecfec3"></a><!-- doxytag: member="TMC26XStepper::getMicrosteps" ref="a5808551ced98b79c09bbb4bf47ecfec3" args="(void)" -->
  420. <div class="memitem">
  421. <div class="memproto">
  422. <table class="memname">
  423. <tr>
  424. <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">TMC26XStepper::getMicrosteps</a> </td>
  425. <td>(</td>
  426. <td class="paramtype">void&#160;</td>
  427. <td class="paramname"></td><td>)</td>
  428. <td></td>
  429. </tr>
  430. </table>
  431. </div>
  432. <div class="memdoc">
  433. <p>returns the effective current number of microsteps selected. </p>
  434. <p>This function always returns the effective number of microsteps. This can be a bit different than the micro steps set in <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> since it is rounded to 2^i.</p>
  435. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> </dd></dl>
  436. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00446">446</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  437. </div>
  438. </div>
  439. <a class="anchor" id="a1019f6f889acfd3176eecd60a0a20125"></a><!-- doxytag: member="TMC26XStepper::getMotorPosition" ref="a1019f6f889acfd3176eecd60a0a20125" args="(void)" -->
  440. <div class="memitem">
  441. <div class="memproto">
  442. <table class="memname">
  443. <tr>
  444. <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">TMC26XStepper::getMotorPosition</a> </td>
  445. <td>(</td>
  446. <td class="paramtype">void&#160;</td>
  447. <td class="paramname"></td><td>)</td>
  448. <td></td>
  449. </tr>
  450. </table>
  451. </div>
  452. <div class="memdoc">
  453. <p>Get the current microstep position for phase A. </p>
  454. <dl class="return"><dt><b>Returns:</b></dt><dd>The current microstep position for phase A 0…255</dd></dl>
  455. <p>Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. </p>
  456. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00762">762</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  457. </div>
  458. </div>
  459. <a class="anchor" id="a7662c2fbc03d1f5a7da5cabcc153b2d7"></a><!-- doxytag: member="TMC26XStepper::getOverTemperature" ref="a7662c2fbc03d1f5a7da5cabcc153b2d7" args="(void)" -->
  460. <div class="memitem">
  461. <div class="memproto">
  462. <table class="memname">
  463. <tr>
  464. <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">TMC26XStepper::getOverTemperature</a> </td>
  465. <td>(</td>
  466. <td class="paramtype">void&#160;</td>
  467. <td class="paramname"></td><td>)</td>
  468. <td></td>
  469. </tr>
  470. </table>
  471. </div>
  472. <div class="memdoc">
  473. <p>Return over temperature status of the last status readout return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </p>
  474. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00816">816</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  475. </div>
  476. </div>
  477. <a class="anchor" id="ae1db5ec2ec9bfbfaea83c659e006692e"></a><!-- doxytag: member="TMC26XStepper::getResistor" ref="ae1db5ec2ec9bfbfaea83c659e006692e" args="()" -->
  478. <div class="memitem">
  479. <div class="memproto">
  480. <table class="memname">
  481. <tr>
  482. <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">TMC26XStepper::getResistor</a> </td>
  483. <td>(</td>
  484. <td class="paramname"></td><td>)</td>
  485. <td></td>
  486. </tr>
  487. </table>
  488. </div>
  489. <div class="memdoc">
  490. <p>Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150. </p>
  491. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00883">883</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  492. </div>
  493. </div>
  494. <a class="anchor" id="aa564f5cc0218d30ef897c2830c768c29"></a><!-- doxytag: member="TMC26XStepper::getSpeed" ref="aa564f5cc0218d30ef897c2830c768c29" args="(void)" -->
  495. <div class="memitem">
  496. <div class="memproto">
  497. <table class="memname">
  498. <tr>
  499. <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">TMC26XStepper::getSpeed</a> </td>
  500. <td>(</td>
  501. <td class="paramtype">void&#160;</td>
  502. <td class="paramname"></td><td>)</td>
  503. <td></td>
  504. </tr>
  505. </table>
  506. </div>
  507. <div class="memdoc">
  508. <p>reads out the currently selected speed in revolutions per minute. </p>
  509. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed()</a> </dd></dl>
  510. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00221">221</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  511. </div>
  512. </div>
  513. <a class="anchor" id="a47e3443e3e786314c1099b8f14a91b8a"></a><!-- doxytag: member="TMC26XStepper::getStallGuardFilter" ref="a47e3443e3e786314c1099b8f14a91b8a" args="(void)" -->
  514. <div class="memitem">
  515. <div class="memproto">
  516. <table class="memname">
  517. <tr>
  518. <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">TMC26XStepper::getStallGuardFilter</a> </td>
  519. <td>(</td>
  520. <td class="paramtype">void&#160;</td>
  521. <td class="paramname"></td><td>)</td>
  522. <td></td>
  523. </tr>
  524. </table>
  525. </div>
  526. <div class="memdoc">
  527. <p>returns the current setting of the StallGuard filter </p>
  528. <dl class="return"><dt><b>Returns:</b></dt><dd>0 if not set, -1 if set </dd></dl>
  529. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00381">381</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  530. </div>
  531. </div>
  532. <a class="anchor" id="a056661f444725c3ae15696d1e8d91def"></a><!-- doxytag: member="TMC26XStepper::getStallGuardThreshold" ref="a056661f444725c3ae15696d1e8d91def" args="(void)" -->
  533. <div class="memitem">
  534. <div class="memproto">
  535. <table class="memname">
  536. <tr>
  537. <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">TMC26XStepper::getStallGuardThreshold</a> </td>
  538. <td>(</td>
  539. <td class="paramtype">void&#160;</td>
  540. <td class="paramname"></td><td>)</td>
  541. <td></td>
  542. </tr>
  543. </table>
  544. </div>
  545. <div class="memdoc">
  546. <p>reads out the StallGuard threshold </p>
  547. <dl class="return"><dt><b>Returns:</b></dt><dd>a number between -64 and 63. </dd></dl>
  548. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00368">368</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  549. </div>
  550. </div>
  551. <a class="anchor" id="aa6c3211f85301ca0fb2e7b73cb8142a7"></a><!-- doxytag: member="TMC26XStepper::getStepsLeft" ref="aa6c3211f85301ca0fb2e7b73cb8142a7" args="(void)" -->
  552. <div class="memitem">
  553. <div class="memproto">
  554. <table class="memname">
  555. <tr>
  556. <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">TMC26XStepper::getStepsLeft</a> </td>
  557. <td>(</td>
  558. <td class="paramtype">void&#160;</td>
  559. <td class="paramname"></td><td>)</td>
  560. <td></td>
  561. </tr>
  562. </table>
  563. </div>
  564. <div class="memdoc">
  565. <p>Get the number of steps left in the current movement. </p>
  566. <dl class="return"><dt><b>Returns:</b></dt><dd>The number of steps left in the movement. This number is always positive. </dd></dl>
  567. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00278">278</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  568. </div>
  569. </div>
  570. <a class="anchor" id="a6de2306b6d8dc1fa2e50fccb66d8e66d"></a><!-- doxytag: member="TMC26XStepper::isCoolStepEnabled" ref="a6de2306b6d8dc1fa2e50fccb66d8e66d" args="()" -->
  571. <div class="memitem">
  572. <div class="memproto">
  573. <table class="memname">
  574. <tr>
  575. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">TMC26XStepper::isCoolStepEnabled</a> </td>
  576. <td>(</td>
  577. <td class="paramtype">void&#160;</td>
  578. <td class="paramname"></td><td>)</td>
  579. <td></td>
  580. </tr>
  581. </table>
  582. </div>
  583. <div class="memdoc">
  584. <p>check if the CoolStep feature is enabled </p>
  585. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157" title="enables or disables the CoolStep smart energy operation feature. It must be configured before enablin...">setCoolStepEnabled()</a> </dd></dl>
  586. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00691">691</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  587. </div>
  588. </div>
  589. <a class="anchor" id="ad435db189ebb101fb2de90a484f33905"></a><!-- doxytag: member="TMC26XStepper::isCurrentScalingHalfed" ref="ad435db189ebb101fb2de90a484f33905" args="()" -->
  590. <div class="memitem">
  591. <div class="memproto">
  592. <table class="memname">
  593. <tr>
  594. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">TMC26XStepper::isCurrentScalingHalfed</a> </td>
  595. <td>(</td>
  596. <td class="paramname"></td><td>)</td>
  597. <td></td>
  598. </tr>
  599. </table>
  600. </div>
  601. <div class="memdoc">
  602. <p>a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference. </p>
  603. <dl class="return"><dt><b>Returns:</b></dt><dd>false if 0.13V is the reference voltage, true if 0.165V is used. </dd></dl>
  604. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00887">887</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  605. </div>
  606. </div>
  607. <a class="anchor" id="a15796c0cbdeab23a343c3f25327283b6"></a><!-- doxytag: member="TMC26XStepper::isEnabled" ref="a15796c0cbdeab23a343c3f25327283b6" args="()" -->
  608. <div class="memitem">
  609. <div class="memproto">
  610. <table class="memname">
  611. <tr>
  612. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">TMC26XStepper::isEnabled</a> </td>
  613. <td>(</td>
  614. <td class="paramname"></td><td>)</td>
  615. <td></td>
  616. </tr>
  617. </table>
  618. </div>
  619. <div class="memdoc">
  620. <p>checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely </p>
  621. <dl class="return"><dt><b>Returns:</b></dt><dd>true if the bridges and by that the motor driver are enabled, false if not. </dd></dl>
  622. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305" title="enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.">setEnabled()</a> </dd></dl>
  623. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00729">729</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  624. </div>
  625. </div>
  626. <a class="anchor" id="a880d602be8414b7b965287c1790cd50e"></a><!-- doxytag: member="TMC26XStepper::isMoving" ref="a880d602be8414b7b965287c1790cd50e" args="(void)" -->
  627. <div class="memitem">
  628. <div class="memproto">
  629. <table class="memname">
  630. <tr>
  631. <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">TMC26XStepper::isMoving</a> </td>
  632. <td>(</td>
  633. <td class="paramtype">void&#160;</td>
  634. <td class="paramname"></td><td>)</td>
  635. <td></td>
  636. </tr>
  637. </table>
  638. </div>
  639. <div class="memdoc">
  640. <p>checks if the motor still has to move to fulfill the last movement command. </p>
  641. <dl class="return"><dt><b>Returns:</b></dt><dd>0 if the motor stops, -1 if the motor is moving.</dd></dl>
  642. <p>This method can be used to determine if the motor is ready for new movements. </p>
  643. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a> </dd></dl>
  644. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00274">274</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  645. </div>
  646. </div>
  647. <a class="anchor" id="af97b2ab9d1ba36765ac6f17cf25ec45c"></a><!-- doxytag: member="TMC26XStepper::isOpenLoadA" ref="af97b2ab9d1ba36765ac6f17cf25ec45c" args="(void)" -->
  648. <div class="memitem">
  649. <div class="memproto">
  650. <table class="memname">
  651. <tr>
  652. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">TMC26XStepper::isOpenLoadA</a> </td>
  653. <td>(</td>
  654. <td class="paramtype">void&#160;</td>
  655. <td class="paramname"></td><td>)</td>
  656. <td></td>
  657. </tr>
  658. </table>
  659. </div>
  660. <div class="memdoc">
  661. <p>iIs motor channel A connected according to the last statu readout. </p>
  662. <dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
  663. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00846">846</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  664. </div>
  665. </div>
  666. <a class="anchor" id="a303590124f5ac6d6a06d0ec60d0b5303"></a><!-- doxytag: member="TMC26XStepper::isOpenLoadB" ref="a303590124f5ac6d6a06d0ec60d0b5303" args="(void)" -->
  667. <div class="memitem">
  668. <div class="memproto">
  669. <table class="memname">
  670. <tr>
  671. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">TMC26XStepper::isOpenLoadB</a> </td>
  672. <td>(</td>
  673. <td class="paramtype">void&#160;</td>
  674. <td class="paramname"></td><td>)</td>
  675. <td></td>
  676. </tr>
  677. </table>
  678. </div>
  679. <div class="memdoc">
  680. <p>iIs motor channel A connected according to the last statu readout. </p>
  681. <dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
  682. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00854">854</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  683. </div>
  684. </div>
  685. <a class="anchor" id="ad329fa4693d3139dea241ebe3d0f33cf"></a><!-- doxytag: member="TMC26XStepper::isShortToGroundA" ref="ad329fa4693d3139dea241ebe3d0f33cf" args="(void)" -->
  686. <div class="memitem">
  687. <div class="memproto">
  688. <table class="memname">
  689. <tr>
  690. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">TMC26XStepper::isShortToGroundA</a> </td>
  691. <td>(</td>
  692. <td class="paramtype">void&#160;</td>
  693. <td class="paramname"></td><td>)</td>
  694. <td></td>
  695. </tr>
  696. </table>
  697. </div>
  698. <div class="memdoc">
  699. <p>Is motor channel A shorted to ground detected in the last status readout. </p>
  700. <dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
  701. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00830">830</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  702. </div>
  703. </div>
  704. <a class="anchor" id="a0ccb54d40cce0d802aa56ff6261f9f3b"></a><!-- doxytag: member="TMC26XStepper::isShortToGroundB" ref="a0ccb54d40cce0d802aa56ff6261f9f3b" args="(void)" -->
  705. <div class="memitem">
  706. <div class="memproto">
  707. <table class="memname">
  708. <tr>
  709. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">TMC26XStepper::isShortToGroundB</a> </td>
  710. <td>(</td>
  711. <td class="paramtype">void&#160;</td>
  712. <td class="paramname"></td><td>)</td>
  713. <td></td>
  714. </tr>
  715. </table>
  716. </div>
  717. <div class="memdoc">
  718. <p>Is motor channel B shorted to ground detected in the last status readout. </p>
  719. <dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
  720. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00838">838</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  721. </div>
  722. </div>
  723. <a class="anchor" id="aea4c6e1fac909116c6b55f902d6cff41"></a><!-- doxytag: member="TMC26XStepper::isStallGuardOverThreshold" ref="aea4c6e1fac909116c6b55f902d6cff41" args="(void)" -->
  724. <div class="memitem">
  725. <div class="memproto">
  726. <table class="memname">
  727. <tr>
  728. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">TMC26XStepper::isStallGuardOverThreshold</a> </td>
  729. <td>(</td>
  730. <td class="paramtype">void&#160;</td>
  731. <td class="paramname"></td><td>)</td>
  732. <td></td>
  733. </tr>
  734. </table>
  735. </div>
  736. <div class="memdoc">
  737. <p>checks if there is a StallGuard warning in the last status </p>
  738. <dl class="return"><dt><b>Returns:</b></dt><dd>0 if there was no warning, -1 if there was some warning. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout.</dd></dl>
  739. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>
  740. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00803">803</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  741. </div>
  742. </div>
  743. <a class="anchor" id="afdeded501ec2cabeffde33d31b6573f7"></a><!-- doxytag: member="TMC26XStepper::isStallGuardReached" ref="afdeded501ec2cabeffde33d31b6573f7" args="(void)" -->
  744. <div class="memitem">
  745. <div class="memproto">
  746. <table class="memname">
  747. <tr>
  748. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">TMC26XStepper::isStallGuardReached</a> </td>
  749. <td>(</td>
  750. <td class="paramtype">void&#160;</td>
  751. <td class="paramname"></td><td>)</td>
  752. <td></td>
  753. </tr>
  754. </table>
  755. </div>
  756. <div class="memdoc">
  757. <p>checks if there is a StallGuard warning in the last status </p>
  758. <dl class="return"><dt><b>Returns:</b></dt><dd>0 if there was no warning, -1 if there was some warning. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout.</dd></dl>
  759. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41" title="checks if there is a StallGuard warning in the last status">isStallGuardOverThreshold()</a> TODO why?</dd>
  760. <dd>
  761. <a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>
  762. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00870">870</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  763. </div>
  764. </div>
  765. <a class="anchor" id="ab26602f360a4fb6ec6d262011675b2b0"></a><!-- doxytag: member="TMC26XStepper::isStandStill" ref="ab26602f360a4fb6ec6d262011675b2b0" args="(void)" -->
  766. <div class="memitem">
  767. <div class="memproto">
  768. <table class="memname">
  769. <tr>
  770. <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">TMC26XStepper::isStandStill</a> </td>
  771. <td>(</td>
  772. <td class="paramtype">void&#160;</td>
  773. <td class="paramname"></td><td>)</td>
  774. <td></td>
  775. </tr>
  776. </table>
  777. </div>
  778. <div class="memdoc">
  779. <p>Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s. </p>
  780. <dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
  781. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00862">862</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  782. </div>
  783. </div>
  784. <a class="anchor" id="aed5d81f1549615529c723600a68ba415"></a><!-- doxytag: member="TMC26XStepper::move" ref="aed5d81f1549615529c723600a68ba415" args="(void)" -->
  785. <div class="memitem">
  786. <div class="memproto">
  787. <table class="memname">
  788. <tr>
  789. <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">TMC26XStepper::move</a> </td>
  790. <td>(</td>
  791. <td class="paramtype">void&#160;</td>
  792. <td class="paramname"></td><td>)</td>
  793. <td></td>
  794. </tr>
  795. </table>
  796. </div>
  797. <div class="memdoc">
  798. <p>Central movement method, must be called as often as possible in the lopp function and is very fast. </p>
  799. <p>This routine checks if the motor still has to move, if the waiting delay has passed to send a new step command to the motor and manages the number of steps yet to move to fulfill the current move command.</p>
  800. <p>This function is implemented to be as fast as possible to call it as often as possible in your loop routine. The more regurlarly you call this function the better. In both senses of 'regularly': Calling it as often as possible is not a bad idea and if you even manage that the intervals you call this function are not too irregular helps too.</p>
  801. <p>You can call this routine even if you know that the motor is not miving. It introduces just a very small penalty in your code. You must not call <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> to determine if you need to call this function, since taht is done internally already and only slows down you code.</p>
  802. <p>How often you call this function directly influences your top miving speed for the motor. It may be a good idea to call this from an timer overflow interrupt to ensure proper calling. </p>
  803. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a> </dd></dl>
  804. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00246">246</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  805. </div>
  806. </div>
  807. <a class="anchor" id="af95a824bfdf49ef979b5354798e52967"></a><!-- doxytag: member="TMC26XStepper::readStatus" ref="af95a824bfdf49ef979b5354798e52967" args="(char read_value)" -->
  808. <div class="memitem">
  809. <div class="memproto">
  810. <table class="memname">
  811. <tr>
  812. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">TMC26XStepper::readStatus</a> </td>
  813. <td>(</td>
  814. <td class="paramtype">char&#160;</td>
  815. <td class="paramname"><em>read_value</em></td><td>)</td>
  816. <td></td>
  817. </tr>
  818. </table>
  819. </div>
  820. <div class="memdoc">
  821. <p>Manually read out the status register This function sends a byte to the motor driver in order to get the current readout. The parameter read_value seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method may take time to send and read one or two bits - depending on the previous readout. </p>
  822. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  823. <table class="params">
  824. <tr><td class="paramname">read_value</td><td>selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT </td></tr>
  825. </table>
  826. </dd>
  827. </dl>
  828. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26X_READOUT_POSITION</a>, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT </dd></dl>
  829. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00742">742</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  830. </div>
  831. </div>
  832. <a class="anchor" id="ac2d8a2bbae2aba3ed7c98e3ff1a06649"></a><!-- doxytag: member="TMC26XStepper::setConstantOffTimeChopper" ref="ac2d8a2bbae2aba3ed7c98e3ff1a06649" args="(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator)" -->
  833. <div class="memitem">
  834. <div class="memproto">
  835. <table class="memname">
  836. <tr>
  837. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">TMC26XStepper::setConstantOffTimeChopper</a> </td>
  838. <td>(</td>
  839. <td class="paramtype">char&#160;</td>
  840. <td class="paramname"><em>constant_off_time</em>, </td>
  841. </tr>
  842. <tr>
  843. <td class="paramkey"></td>
  844. <td></td>
  845. <td class="paramtype">char&#160;</td>
  846. <td class="paramname"><em>blank_time</em>, </td>
  847. </tr>
  848. <tr>
  849. <td class="paramkey"></td>
  850. <td></td>
  851. <td class="paramtype">char&#160;</td>
  852. <td class="paramname"><em>fast_decay_time_setting</em>, </td>
  853. </tr>
  854. <tr>
  855. <td class="paramkey"></td>
  856. <td></td>
  857. <td class="paramtype">char&#160;</td>
  858. <td class="paramname"><em>sine_wave_offset</em>, </td>
  859. </tr>
  860. <tr>
  861. <td class="paramkey"></td>
  862. <td></td>
  863. <td class="paramtype">unsigned char&#160;</td>
  864. <td class="paramname"><em>use_current_comparator</em>&#160;</td>
  865. </tr>
  866. <tr>
  867. <td></td>
  868. <td>)</td>
  869. <td></td><td></td>
  870. </tr>
  871. </table>
  872. </div>
  873. <div class="memdoc">
  874. <p>Sets and configure the classical Constant Off Timer Chopper. </p>
  875. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  876. <table class="params">
  877. <tr><td class="paramname">constant_off_time</td><td>The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) </td></tr>
  878. <tr><td class="paramname">blank_time</td><td>Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting </td></tr>
  879. <tr><td class="paramname">fast_decay_time_setting</td><td>Fast decay time setting. Controls the portion of fast decay for each chopper cycle. 0: slow decay only, 1…15: duration of fast decay phase </td></tr>
  880. <tr><td class="paramname">sine_wave_offset</td><td>Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3…-1: negative offset, 0: no offset,1…12: positive offset </td></tr>
  881. <tr><td class="paramname">use_curreent_comparator</td><td>Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable).</td></tr>
  882. </table>
  883. </dd>
  884. </dl>
  885. <p>The classic constant off time chopper uses a fixed portion of fast decay following each on phase. While the duration of the on time is determined by the chopper comparator, the fast decay time needs to be set by the user in a way, that the current decay is enough for the driver to be able to follow the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize motor current ripple and power dissipation. This best can be tuned using an oscilloscope or trying out motor smoothness at different velocities. A good starting value is a fast decay time setting similar to the slow decay time setting. After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition. This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short moment during current zero crossing, if it is set too high, it makes a larger microstep. Typically, a positive offset setting is required for optimum operation.</p>
  886. <dl class="see"><dt><b>See also:</b></dt><dd>setSpreadCycleChoper() for other alternatives. </dd>
  887. <dd>
  888. <a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">setRandomOffTime()</a> for spreading the noise over a wider spectrum </dd></dl>
  889. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00473">473</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  890. </div>
  891. </div>
  892. <a class="anchor" id="a381fbcce7c586ca2f1da8f9e704df14e"></a><!-- doxytag: member="TMC26XStepper::setCoolStepConfiguration" ref="a381fbcce7c586ca2f1da8f9e704df14e" args="(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size, unsigned char current_increment_step_size, unsigned char lower_current_limit)" -->
  893. <div class="memitem">
  894. <div class="memproto">
  895. <table class="memname">
  896. <tr>
  897. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">TMC26XStepper::setCoolStepConfiguration</a> </td>
  898. <td>(</td>
  899. <td class="paramtype">unsigned int&#160;</td>
  900. <td class="paramname"><em>lower_SG_threshold</em>, </td>
  901. </tr>
  902. <tr>
  903. <td class="paramkey"></td>
  904. <td></td>
  905. <td class="paramtype">unsigned int&#160;</td>
  906. <td class="paramname"><em>SG_hysteresis</em>, </td>
  907. </tr>
  908. <tr>
  909. <td class="paramkey"></td>
  910. <td></td>
  911. <td class="paramtype">unsigned char&#160;</td>
  912. <td class="paramname"><em>current_decrement_step_size</em>, </td>
  913. </tr>
  914. <tr>
  915. <td class="paramkey"></td>
  916. <td></td>
  917. <td class="paramtype">unsigned char&#160;</td>
  918. <td class="paramname"><em>current_increment_step_size</em>, </td>
  919. </tr>
  920. <tr>
  921. <td class="paramkey"></td>
  922. <td></td>
  923. <td class="paramtype">unsigned char&#160;</td>
  924. <td class="paramname"><em>lower_current_limit</em>&#160;</td>
  925. </tr>
  926. <tr>
  927. <td></td>
  928. <td>)</td>
  929. <td></td><td></td>
  930. </tr>
  931. </table>
  932. </div>
  933. <div class="memdoc">
  934. <p>This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. </p>
  935. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  936. <table class="params">
  937. <tr><td class="paramname">lower_SG_threshold</td><td>Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480 </td></tr>
  938. <tr><td class="paramname">SG_hysteresis</td><td>Sets the distance between the lower and the upper threshold for stallGuard2TM reading. Above the upper threshold (which is lower_SG_threshold+SG_hysteresis+1) the motor current becomes decreased. Allowed values are 0...480 </td></tr>
  939. <tr><td class="paramname">current_decrement_step_size</td><td>Sets the current decrement steps. If the StallGuard value is above the threshold the current gets decremented by this step size. 0...32 </td></tr>
  940. <tr><td class="paramname">current_increment_step_size</td><td>Sets the current increment step. The current becomes incremented for each measured stallGuard2TM value below the lower threshold. 0...8 </td></tr>
  941. <tr><td class="paramname">lower_current_limit</td><td>Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load, read out by the StallGuard in order to provide the optimum torque with the minimal current consumption. You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the limit the current gets increased, below the limit the current gets decreased. You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of StallGuard readings neccessary above or below the limit to get a more stable current adjustement. The current adjustement itself is configured by the number of steps the current gests in- or decreased and the absolut minimum current (1/2 or 1/4th otf the configured current). </td></tr>
  942. </table>
  943. </dd>
  944. </dl>
  945. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>, COOL_STEP_QUARTER_CS_LIMIT </dd></dl>
  946. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00636">636</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  947. </div>
  948. </div>
  949. <a class="anchor" id="a15bf0ed5a166a5d9a41f90f3ccbc6157"></a><!-- doxytag: member="TMC26XStepper::setCoolStepEnabled" ref="a15bf0ed5a166a5d9a41f90f3ccbc6157" args="(boolean enabled)" -->
  950. <div class="memitem">
  951. <div class="memproto">
  952. <table class="memname">
  953. <tr>
  954. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">TMC26XStepper::setCoolStepEnabled</a> </td>
  955. <td>(</td>
  956. <td class="paramtype">boolean&#160;</td>
  957. <td class="paramname"><em>enabled</em></td><td>)</td>
  958. <td></td>
  959. </tr>
  960. </table>
  961. </div>
  962. <div class="memdoc">
  963. <p>enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it. </p>
  964. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  965. <table class="params">
  966. <tr><td class="paramname">enabled</td><td>true if CoolStep should be enabled, false if not. </td></tr>
  967. </table>
  968. </dd>
  969. </dl>
  970. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
  971. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00676">676</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  972. </div>
  973. </div>
  974. <a class="anchor" id="aaa35fac83417c16b3a941fa168e4a4d2"></a><!-- doxytag: member="TMC26XStepper::setCurrent" ref="aaa35fac83417c16b3a941fa168e4a4d2" args="(unsigned int current)" -->
  975. <div class="memitem">
  976. <div class="memproto">
  977. <table class="memname">
  978. <tr>
  979. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">TMC26XStepper::setCurrent</a> </td>
  980. <td>(</td>
  981. <td class="paramtype">unsigned int&#160;</td>
  982. <td class="paramname"><em>current</em></td><td>)</td>
  983. <td></td>
  984. </tr>
  985. </table>
  986. </div>
  987. <div class="memdoc">
  988. <p>set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller by employing CoolStep. </p>
  989. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  990. <table class="params">
  991. <tr><td class="paramname">current</td><td>the maximum motor current in mA </td></tr>
  992. </table>
  993. </dd>
  994. </dl>
  995. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">getCurrent()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </dd></dl>
  996. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00292">292</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  997. </div>
  998. </div>
  999. <a class="anchor" id="a4472cd86ad5b65dec5ec45ce69158305"></a><!-- doxytag: member="TMC26XStepper::setEnabled" ref="a4472cd86ad5b65dec5ec45ce69158305" args="(boolean enabled)" -->
  1000. <div class="memitem">
  1001. <div class="memproto">
  1002. <table class="memname">
  1003. <tr>
  1004. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">TMC26XStepper::setEnabled</a> </td>
  1005. <td>(</td>
  1006. <td class="paramtype">boolean&#160;</td>
  1007. <td class="paramname"><em>enabled</em></td><td>)</td>
  1008. <td></td>
  1009. </tr>
  1010. </table>
  1011. </div>
  1012. <div class="memdoc">
  1013. <p>enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. </p>
  1014. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  1015. <table class="params">
  1016. <tr><td class="paramname">enabled</td><td>a boolean value true if the motor should be enabled, false otherwise. </td></tr>
  1017. </table>
  1018. </dd>
  1019. </dl>
  1020. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00716">716</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1021. </div>
  1022. </div>
  1023. <a class="anchor" id="a21041579c7f9284567ee2e2a55a3afd0"></a><!-- doxytag: member="TMC26XStepper::setMicrosteps" ref="a21041579c7f9284567ee2e2a55a3afd0" args="(int number_of_steps)" -->
  1024. <div class="memitem">
  1025. <div class="memproto">
  1026. <table class="memname">
  1027. <tr>
  1028. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">TMC26XStepper::setMicrosteps</a> </td>
  1029. <td>(</td>
  1030. <td class="paramtype">int&#160;</td>
  1031. <td class="paramname"><em>number_of_steps</em></td><td>)</td>
  1032. <td></td>
  1033. </tr>
  1034. </table>
  1035. </div>
  1036. <div class="memdoc">
  1037. <p>Set the number of microsteps in 2^i values (rounded) up to 256. </p>
  1038. <p>This method set's the number of microsteps per step in 2^i interval. This means you can select 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps. If you give any other value it will be rounded to the next smaller number (3 would give a microstepping of 2). You can always check the current microstepping with <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3" title="returns the effective current number of microsteps selected.">getMicrosteps()</a>. </p>
  1039. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00394">394</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1040. </div>
  1041. </div>
  1042. <a class="anchor" id="a7ffd602cf4bf385847cba034417d5f0a"></a><!-- doxytag: member="TMC26XStepper::setRandomOffTime" ref="a7ffd602cf4bf385847cba034417d5f0a" args="(char value)" -->
  1043. <div class="memitem">
  1044. <div class="memproto">
  1045. <table class="memname">
  1046. <tr>
  1047. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">TMC26XStepper::setRandomOffTime</a> </td>
  1048. <td>(</td>
  1049. <td class="paramtype">char&#160;</td>
  1050. <td class="paramname"><em>value</em></td><td>)</td>
  1051. <td></td>
  1052. </tr>
  1053. </table>
  1054. </div>
  1055. <div class="memdoc">
  1056. <p>Use random off time for noise reduction (0 for off, -1 for on). </p>
  1057. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  1058. <table class="params">
  1059. <tr><td class="paramname">value</td><td>0 for off, -1 for on</td></tr>
  1060. </table>
  1061. </dd>
  1062. </dl>
  1063. <p>In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within each quarter wave. This effect normally is not audible when compared to mechanical noise generated by ball bearings, etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection. In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum, reducing electromagnetic emission on single frequencies. </p>
  1064. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00624">624</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1065. </div>
  1066. </div>
  1067. <a class="anchor" id="a9478f43090995c8d5cdb4d4e8c07cdbd"></a><!-- doxytag: member="TMC26XStepper::setSpeed" ref="a9478f43090995c8d5cdb4d4e8c07cdbd" args="(unsigned int whatSpeed)" -->
  1068. <div class="memitem">
  1069. <div class="memproto">
  1070. <table class="memname">
  1071. <tr>
  1072. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">TMC26XStepper::setSpeed</a> </td>
  1073. <td>(</td>
  1074. <td class="paramtype">unsigned int&#160;</td>
  1075. <td class="paramname"><em>whatSpeed</em></td><td>)</td>
  1076. <td></td>
  1077. </tr>
  1078. </table>
  1079. </div>
  1080. <div class="memdoc">
  1081. <p>Sets the rotation speed in revolutions per minute. </p>
  1082. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  1083. <table class="params">
  1084. <tr><td class="paramname">whatSpeed</td><td>the desired speed in rotations per minute. </td></tr>
  1085. </table>
  1086. </dd>
  1087. </dl>
  1088. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00208">208</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1089. </div>
  1090. </div>
  1091. <a class="anchor" id="aa152bb7ddb72a2bc8465553a39232df2"></a><!-- doxytag: member="TMC26XStepper::setSpreadCycleChopper" ref="aa152bb7ddb72a2bc8465553a39232df2" args="(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement)" -->
  1092. <div class="memitem">
  1093. <div class="memproto">
  1094. <table class="memname">
  1095. <tr>
  1096. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">TMC26XStepper::setSpreadCycleChopper</a> </td>
  1097. <td>(</td>
  1098. <td class="paramtype">char&#160;</td>
  1099. <td class="paramname"><em>constant_off_time</em>, </td>
  1100. </tr>
  1101. <tr>
  1102. <td class="paramkey"></td>
  1103. <td></td>
  1104. <td class="paramtype">char&#160;</td>
  1105. <td class="paramname"><em>blank_time</em>, </td>
  1106. </tr>
  1107. <tr>
  1108. <td class="paramkey"></td>
  1109. <td></td>
  1110. <td class="paramtype">char&#160;</td>
  1111. <td class="paramname"><em>hysteresis_start</em>, </td>
  1112. </tr>
  1113. <tr>
  1114. <td class="paramkey"></td>
  1115. <td></td>
  1116. <td class="paramtype">char&#160;</td>
  1117. <td class="paramname"><em>hysteresis_end</em>, </td>
  1118. </tr>
  1119. <tr>
  1120. <td class="paramkey"></td>
  1121. <td></td>
  1122. <td class="paramtype">char&#160;</td>
  1123. <td class="paramname"><em>hysteresis_decrement</em>&#160;</td>
  1124. </tr>
  1125. <tr>
  1126. <td></td>
  1127. <td>)</td>
  1128. <td></td><td></td>
  1129. </tr>
  1130. </table>
  1131. </div>
  1132. <div class="memdoc">
  1133. <p>Sets and configures with spread cycle chopper. </p>
  1134. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  1135. <table class="params">
  1136. <tr><td class="paramname">constant_off_time</td><td>The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) </td></tr>
  1137. <tr><td class="paramname">blank_time</td><td>Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting </td></tr>
  1138. <tr><td class="paramname">hysteresis_start</td><td>Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value. 1 … 8 </td></tr>
  1139. <tr><td class="paramname">hysteresis_end</td><td>Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be &lt;16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited. </td></tr>
  1140. <tr><td class="paramname">hysteresis_decrement</td><td>Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) … 3 (slow decrement).</td></tr>
  1141. </table>
  1142. </dd>
  1143. </dl>
  1144. <p>The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver to the motor. Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase. The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation. The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current. The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is disabled during this time.</p>
  1145. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">setRandomOffTime()</a> for spreading the noise over a wider spectrum </dd></dl>
  1146. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00552">552</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1147. </div>
  1148. </div>
  1149. <a class="anchor" id="af1a5abc23757860baf8ff421689a425a"></a><!-- doxytag: member="TMC26XStepper::setStallGuardThreshold" ref="af1a5abc23757860baf8ff421689a425a" args="(char stall_guard_threshold, char stall_guard_filter_enabled)" -->
  1150. <div class="memitem">
  1151. <div class="memproto">
  1152. <table class="memname">
  1153. <tr>
  1154. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">TMC26XStepper::setStallGuardThreshold</a> </td>
  1155. <td>(</td>
  1156. <td class="paramtype">char&#160;</td>
  1157. <td class="paramname"><em>stall_guard_threshold</em>, </td>
  1158. </tr>
  1159. <tr>
  1160. <td class="paramkey"></td>
  1161. <td></td>
  1162. <td class="paramtype">char&#160;</td>
  1163. <td class="paramname"><em>stall_guard_filter_enabled</em>&#160;</td>
  1164. </tr>
  1165. <tr>
  1166. <td></td>
  1167. <td>)</td>
  1168. <td></td><td></td>
  1169. </tr>
  1170. </table>
  1171. </div>
  1172. <div class="memdoc">
  1173. <p>set the StallGuard threshold in order to get sensible StallGuard readings. </p>
  1174. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  1175. <table class="params">
  1176. <tr><td class="paramname">stall_guard_threshold</td><td>-64 … 63 the StallGuard threshold </td></tr>
  1177. <tr><td class="paramname">stall_guard_filter_enabled</td><td>0 if the filter is disabled, -1 if it is enabled</td></tr>
  1178. </table>
  1179. </dd>
  1180. </dl>
  1181. <p>The StallGuard threshold is used to optimize the StallGuard reading to sensible values. It should be at 0 at the maximum allowable load on the otor (but not before). = is a good starting point (and the default) If you get Stall Gaurd readings of 0 without any load or with too little laod increase the value. If you get readings of 1023 even with load decrease the setting.</p>
  1182. <p>If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the reading.</p>
  1183. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to read out the current value. </dd></dl>
  1184. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00346">346</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1185. </div>
  1186. </div>
  1187. <a class="anchor" id="aad1ed82b3e05940bde5a6c7ed3d3e8f7"></a><!-- doxytag: member="TMC26XStepper::start" ref="aad1ed82b3e05940bde5a6c7ed3d3e8f7" args="()" -->
  1188. <div class="memitem">
  1189. <div class="memproto">
  1190. <table class="memname">
  1191. <tr>
  1192. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">TMC26XStepper::start</a> </td>
  1193. <td>(</td>
  1194. <td class="paramname"></td><td>)</td>
  1195. <td></td>
  1196. </tr>
  1197. </table>
  1198. </div>
  1199. <div class="memdoc">
  1200. <p>configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode. </p>
  1201. <p>This routine configures the TMC26X stepper driver for the given values via SPI. Most member functions are non functional if the driver has not been started. Therefore it is best to call this in your Arduino setup() function. </p>
  1202. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00157">157</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1203. </div>
  1204. </div>
  1205. <a class="anchor" id="ac073a742496885f1f60751f9fb9c395d"></a><!-- doxytag: member="TMC26XStepper::step" ref="ac073a742496885f1f60751f9fb9c395d" args="(int number_of_steps)" -->
  1206. <div class="memitem">
  1207. <div class="memproto">
  1208. <table class="memname">
  1209. <tr>
  1210. <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">TMC26XStepper::step</a> </td>
  1211. <td>(</td>
  1212. <td class="paramtype">int&#160;</td>
  1213. <td class="paramname"><em>number_of_steps</em></td><td>)</td>
  1214. <td></td>
  1215. </tr>
  1216. </table>
  1217. </div>
  1218. <div class="memdoc">
  1219. <p>Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in the other direction. </p>
  1220. <dl class="params"><dt><b>Parameters:</b></dt><dd>
  1221. <table class="params">
  1222. <tr><td class="paramname">number_of_steps</td><td>The number of steps to move the motor. </td></tr>
  1223. </table>
  1224. </dd>
  1225. </dl>
  1226. <dl class="return"><dt><b>Returns:</b></dt><dd>0 if the motor was not moving and moves now. -1 if the motor is moving and the new steps could not be set.</dd></dl>
  1227. <p>If the previous movement is not finished yet the function will return -1 and not change the steps to move the motor. If the motor does not move it return 0</p>
  1228. <p>The direction of the movement is indicated by the sign of the steps parameter. It is not determinable if positive values are right or left This depends on the internal construction of the motor and how you connected it to the stepper driver.</p>
  1229. <p>You can always verify with <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> or even use <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a> to stop the motor before giving it new step directions. </p>
  1230. <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7" title="Get the number of steps left in the current movement.">getStepsLeft()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a> </dd></dl>
  1231. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00229">229</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1232. </div>
  1233. </div>
  1234. <a class="anchor" id="a6315c18eadbc6bf4f3d81a6f80296123"></a><!-- doxytag: member="TMC26XStepper::stop" ref="a6315c18eadbc6bf4f3d81a6f80296123" args="(void)" -->
  1235. <div class="memitem">
  1236. <div class="memproto">
  1237. <table class="memname">
  1238. <tr>
  1239. <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">TMC26XStepper::stop</a> </td>
  1240. <td>(</td>
  1241. <td class="paramtype">void&#160;</td>
  1242. <td class="paramname"></td><td>)</td>
  1243. <td></td>
  1244. </tr>
  1245. </table>
  1246. </div>
  1247. <div class="memdoc">
  1248. <p>Stops the motor regardless if it moves or not. </p>
  1249. <dl class="return"><dt><b>Returns:</b></dt><dd>-1 if the motor was moving and is really stoped or 0 if it was not moving at all.</dd></dl>
  1250. <p>This method directly and apruptely stops the motor and may be used as an emergency stop. </p>
  1251. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00282">282</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1252. </div>
  1253. </div>
  1254. <a class="anchor" id="af968e70a13068f1e71ac0fa6865630c5"></a><!-- doxytag: member="TMC26XStepper::un_start" ref="af968e70a13068f1e71ac0fa6865630c5" args="()" -->
  1255. <div class="memitem">
  1256. <div class="memproto">
  1257. <table class="memname">
  1258. <tr>
  1259. <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">TMC26XStepper::un_start</a> </td>
  1260. <td>(</td>
  1261. <td class="paramname"></td><td>)</td>
  1262. <td></td>
  1263. </tr>
  1264. </table>
  1265. </div>
  1266. <div class="memdoc">
  1267. <p>resets the stepper in unconfigured mode. </p>
  1268. <p>This routine enables you to call start again. It does not change anything in the internal stepper configuration or the desired configuration. It just marks the stepper as not yet startet. You do not have to reconfigure the stepper to start it again, but it is not reset to any factory settings this has to be configured back by yourself. (Hint: Normally you do not need this function) </p>
  1269. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00199">199</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1270. </div>
  1271. </div>
  1272. <a class="anchor" id="ab040d9df1e85d6fb0c105205a36b0215"></a><!-- doxytag: member="TMC26XStepper::version" ref="ab040d9df1e85d6fb0c105205a36b0215" args="(void)" -->
  1273. <div class="memitem">
  1274. <div class="memproto">
  1275. <table class="memname">
  1276. <tr>
  1277. <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">TMC26XStepper::version</a> </td>
  1278. <td>(</td>
  1279. <td class="paramtype">void&#160;</td>
  1280. <td class="paramname"></td><td>)</td>
  1281. <td></td>
  1282. </tr>
  1283. </table>
  1284. </div>
  1285. <div class="memdoc">
  1286. <p>library version </p>
  1287. <dl class="return"><dt><b>Returns:</b></dt><dd>the version number as int. </dd></dl>
  1288. <p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00897">897</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
  1289. </div>
  1290. </div>
  1291. <hr/>The documentation for this class was generated from the following files:<ul>
  1292. <li><a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a></li>
  1293. <li><a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a></li>
  1294. </ul>
  1295. </div><!-- contents -->
  1296. <hr class="footer"/><address class="footer"><small>
  1297. Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
  1298. <img class="footer" src="doxygen.png" alt="doxygen"/>
  1299. </a> 1.7.6.1
  1300. </small></address>
  1301. </body>
  1302. </html>