Skip to content

Commit

Permalink
prepared for release of v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasholsen committed Jan 10, 2018
1 parent bb99a24 commit b5f77e1
Show file tree
Hide file tree
Showing 48 changed files with 692 additions and 513 deletions.
61 changes: 7 additions & 54 deletions Examples/LimitDetection/limitDetection.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,15 @@ void setup() {
Serial.begin(115200);
}

float limit()
{
int checks=0;
float pos=0.0;
stepper.runContinous(CCW);
while(checks < 3)//allows for 2 checks on movement error
{
pos = abs(stepper.encoder.getAngleMoved()-(stepper.getStepsSinceReset()*0.1125));//see current position error
if(pos<5)//if position error is less than 5 steps it is okay...
{
checks=0;
}
else //if position error is 5 steps or more, count up checks
{
checks++;
}
}
checks=0;//reset checks for next endstop detection
stepper.hardStop(SOFT);//stop motor without brake
stepper.moveSteps(5*STEPPRMM, CW, SOFT);//back off with 5 mm
while(stepper.getMotorState())//wait for motor to finish move
{
delay(1);//because Arduino does not accept the empty while loop for some reason....
}
stepper.encoder.setHome();//set new home position
stepper.runContinous(CW);//do check in opposite direction
while(checks < 3)//allows for 2 checks on movement error
{
pos = abs(stepper.encoder.getAngleMoved()-(stepper.getStepsSinceReset()*0.1125));//see current position error
if(pos<5)//if position error is less than 5 steps it is okay...
{
checks=0;
}
else //if position error is 5 steps or more, count up checks
{
checks++;
}
}
stepper.hardStop(SOFT);//stop
stepper.moveSteps(5*STEPPRMM, CCW, SOFT);//back off with 5 mm
while(stepper.getMotorState())//wait for motor to finish move
{
delay(1);//because Arduino does not accept the empty while loop for some reason....
}
pos = stepper.encoder.getAngleMoved();//read current position
stepper.moveSteps((pos*RES)/2, CCW, SOFT);//go to center
while(stepper.getMotorState())//wait for motor to finish move
{
delay(1);//because Arduino does not accept the empty while loop for some reason....
}
return pos;//return max position
}

void loop() {
Serial.println(limit()*MMPRDEG);//find end positions and read out the recorded end position
float railLength;

stepper.moveToEnd(CW); //Reset to CW endpoint
railLength = stepper.moveToEnd(CCW); //Go to CCW end

Serial.println(railLength*MMPRDEG);//find end positions and read out the recorded end position
stepper.setup(PID,SIXTEEN,10,5,2.0,2.0,0.6);//enable PID
stepper.setCurrent(100.0);//use software current setting
stepper.moveSteps((pos*RES)/2, CW, SOFT); //Move to center
while(1);
}
2 changes: 1 addition & 1 deletion docs/html/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 27 2017 20:08:30 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Wed Jan 10 2018 20:22:00 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 27 2017 20:08:30 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Wed Jan 10 2018 20:22:00 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/classfloat2-members.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 27 2017 20:08:30 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Wed Jan 10 2018 20:22:00 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
Expand Down
4 changes: 2 additions & 2 deletions docs/html/classfloat2.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="uStepper_8h_source.html#l00358">358</a> of file <a class="el" href="uStepper_8h_source.html">uStepper.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8h_source.html#l00365">365</a> of file <a class="el" href="uStepper_8h_source.html">uStepper.h</a>.</p>
</div><h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="abbafa3bc17b23bf531c6feba4ee0778d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abbafa3bc17b23bf531c6feba4ee0778d">&#9670;&nbsp;</a></span>TIMER2_COMPA_vect</h2>
Expand Down Expand Up @@ -188,7 +188,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#abbafa3bc17b23bf531c6feba
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 27 2017 20:08:30 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Wed Jan 10 2018 20:22:00 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/classi2cMaster-members.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 27 2017 20:08:30 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Wed Jan 10 2018 20:22:00 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
Expand Down
28 changes: 14 additions & 14 deletions docs/html/classi2cMaster.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<p>This class enables the use of the hardware TWI (I2C) interface in the AVR (master mode only), which is used for interfacing with the encoder. This class is needed in this library, as arduino's build in "wire" library uses interrupts to access the TWI interface, and since the <a class="el" href="classuStepper.html" title="Prototype of class for accessing all features of the uStepper in a single object. ...">uStepper</a> library needs to use the TWI interface within a timer interrupt, this library cannot be used. As a result of this, the "wire" library, cannot be used in sketches using the <a class="el" href="classuStepper.html" title="Prototype of class for accessing all features of the uStepper in a single object. ...">uStepper</a> library, as this will screw with the setups, and make the sketch hang in the timer interrupt routine. Instead, if the programmer of the sketch needs to interface with external I2C devices, this class should be used. This library contains a predefined object called "I2C", which should be used for these purposes.</p>
<p>The functions "read()" and "write()", should be the only functions needed by most users of this library ! </p>

<p class="definition">Definition at line <a class="el" href="uStepper_8h_source.html#l01174">1174</a> of file <a class="el" href="uStepper_8h_source.html">uStepper.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8h_source.html#l01210">1210</a> of file <a class="el" href="uStepper_8h_source.html">uStepper.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a2d4c2077400ec94c157916804e9fdaae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d4c2077400ec94c157916804e9fdaae">&#9670;&nbsp;</a></span>i2cMaster()</h2>
Expand All @@ -143,7 +143,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a2d4c2077400ec94c15791680
<p>Constructor. </p>
<p>This is the constructor, used to instantiate an I2C object. Under normal circumstances, this should not be needed by the programmer of the arduino sketch, since this library already has a global object instantiation of this class, called "I2C". </p>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01946">1946</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02113">2113</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand All @@ -167,7 +167,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#af639b1fb501c7530afdca5e8
<p>Setup TWI (I2C) interface. </p>
<p>This function sets up the TWI interface, and is automatically called in the instantiation of the <a class="el" href="classuStepper.html" title="Prototype of class for accessing all features of the uStepper in a single object. ...">uStepper</a> encoder object. </p>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01938">1938</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02105">2105</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -204,7 +204,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a57b0b97be6a40d9a26a9f3e1
</dd>
</dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01755">1755</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01922">1922</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand All @@ -228,7 +228,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a20091cd125f847e2cf50d0c7
<p>This function returns the status of the I2C bus.</p>
<dl class="section return"><dt>Returns</dt><dd>Status of the I2C bus. Refer to defines for possible status </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01933">1933</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02100">2100</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -283,7 +283,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a9d56b4ea47659456f19cff59
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 - Currently always returns this value. In the future this value will be used to indicate successful transactions. </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01776">1776</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01943">1943</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -324,7 +324,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a631086e66e032c001da7ba74
</dl>
<dl class="section return"><dt>Returns</dt><dd>Always returns 1 </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01855">1855</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02022">2022</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -367,7 +367,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a67daea3016661f33cdf8621d
<dd>
0 - Connection failed </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01905">1905</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02072">2072</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -410,7 +410,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a1f220aa9d4c43c6b6ff53395
<dd>
0 - Connection failed </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01879">1879</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02046">2046</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand All @@ -434,7 +434,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#aa3b88864e9b2b6a864c48721
<p>This function is used to close down the I2C connection, by sending a stop condition on the I2C bus.</p>
<dl class="section return"><dt>Returns</dt><dd>1 - This is always returned Currently - in a later version, this should indicate that connection is successfully closed </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01919">1919</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02086">2086</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -489,7 +489,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#aebbb2715d84f89ea2d7b66d3
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 - Currently always returns this value. In the future this value will be used to indicate successful transactions. </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01822">1822</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01989">1989</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -521,7 +521,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#aff82a2330291c2940f41e8fd
<dd>
0 - transaction failed </dd></dl>

<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l01910">1910</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8cpp_source.html#l02077">2077</a> of file <a class="el" href="uStepper_8cpp_source.html">uStepper.cpp</a>.</p>

</div>
</div>
Expand All @@ -547,7 +547,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a7a51e61bacd034eef996bc5f
</div><div class="memdoc">
<p>Contains the status of the I2C bus </p>

<p class="definition">Definition at line <a class="el" href="uStepper_8h_source.html#l01178">1178</a> of file <a class="el" href="uStepper_8h_source.html">uStepper.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="uStepper_8h_source.html#l01214">1214</a> of file <a class="el" href="uStepper_8h_source.html">uStepper.h</a>.</p>

</div>
</div>
Expand All @@ -558,7 +558,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a7a51e61bacd034eef996bc5f
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 27 2017 20:08:30 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Wed Jan 10 2018 20:22:00 for uStepper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
Expand Down
Loading

0 comments on commit b5f77e1

Please sign in to comment.