Difference between revisions of "Robot Speed Calculator"

(Tag: 2017 source edit)
Line 1: Line 1:
 +
<nowiki><div id="SpeedCalc" class="table_small no_print"></nowiki>
 +
 +
<nowiki><h3 id="calculator" class="table_small"><i class="fa fa-tachometer fa-2x" aria-hidden="true" style="color: #CC0000"></i></nowiki> Robot Speed Calculator<nowiki></h3></nowiki>
 +
 +
<nowiki><p><i>* If the red fields in the form below are not populated, please refresh your browser.</i></nowiki><nowiki></p></nowiki>
 +
 +
      <nowiki><ul></nowiki>
 +
 +
        <nowiki><li><label for="rpm">Motor Output Speed</label></nowiki> <nowiki><input type="text" name="rpm" value="190"></nowiki> <nowiki><span>rpm</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="ratio">Reduction*</label></nowiki> <nowiki><input type="text" name="ratio" value="1"></nowiki> <nowiki><span>ratio</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="diameter">Wheel Diameter</label></nowiki> <nowiki><input type="text" name="diameter" value="6"></nowiki> <nowiki><span>inches</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="circ">Wheel Circumference</label></nowiki> <nowiki><input type="text" name="circ" disabled="disabled"></nowiki> <nowiki><span>inches</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="speedIPM">Speed</label></nowiki> <nowiki><input type="text" name="speedIPM" disabled="disabled"></nowiki> <nowiki><span>inches per minute</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="speedFPM">Speed</label></nowiki> <nowiki><input type="text" name="speedFPM" disabled="disabled"></nowiki> <nowiki><span>feet per minute</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="speedMPH">Speed</label></nowiki> <nowiki><input type="text" name="speedMPH" disabled="disabled"></nowiki> <nowiki><span>miles per hour</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="speedMPM">Speed</label></nowiki> <nowiki><input type="text" name="speedMPM" disabled="disabled"></nowiki> <nowiki><span>meters per minute</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li><label for="speedKPH">Speed</label></nowiki> <nowiki><input type="text" name="speedKPH" disabled="disabled"></nowiki> <nowiki><span>km per hour</span></nowiki><nowiki></li></nowiki>
 +
 +
        <nowiki><li>* This is the reduction from the output of the gear motor to the wheel. If direct drive, reduction = 1. If your reduction is 1:2 put in 0.5.</li></nowiki>
 +
 +
      <nowiki></ul></nowiki>
 +
 +
    <nowiki></div></nowiki>
  
<syntaxhighlight lang="html">
 
 
<script type="text/javascript">
 
<script type="text/javascript">
 +
 
// <![CDATA[
 
// <![CDATA[
    $("input:enabled").change(function() {
+
 
            calcValues();
+
    $("input:enabled").change(function() {
        });
+
 
        function calcValues () {
+
            calcValues();
            var rpm = $("input[name='rpm']").val();
+
 
            var ratio = $("input[name='ratio']").val();
+
        });<br />        function calcValues () {
            var cir = $("input[name='diameter']").val() * Math.PI;
+
 
            var ipm = rpm * ratio * cir;
+
            var rpm = $("input[name='rpm']").val();
            var fpm = ipm / 12.0;
+
 
            var mph = fpm * 60 / 5280;
+
            var ratio = $("input[name='ratio']").val();
            var mpm = fpm * 0.3048;
+
 
            var kph = mpm * 60 / 1000;
+
            var cir = $("input[name='diameter']").val() * Math.PI;
            $("input[name='circ']").val(cir.toFixed(2));
+
 
            $("input[name='speedIPM']").val(ipm.toFixed(2));
+
            var ipm = rpm * ratio * cir;
            $("input[name='speedFPM']").val(fpm.toFixed(2));
+
 
            $("input[name='speedMPH']").val(mph.toFixed(2));
+
            var fpm = ipm / 12.0;
            $("input[name='speedMPM']").val(mpm.toFixed(2));
+
 
            $("input[name='speedKPH']").val(kph.toFixed(2));
+
            var mph = fpm * 60 / 5280;
        }
+
 
        $(function() {
+
            var mpm = fpm * 0.3048;
            calcValues();
+
 
        });
+
            var kph = mpm * 60 / 1000;<br />            $("input[name='circ']").val(cir.toFixed(2));
    // ]]>
+
 
    </script>
+
            $("input[name='speedIPM']").val(ipm.toFixed(2));
</syntaxhighlight>
+
 
 +
            $("input[name='speedFPM']").val(fpm.toFixed(2));
 +
 
 +
            $("input[name='speedMPH']").val(mph.toFixed(2));
 +
 
 +
            $("input[name='speedMPM']").val(mpm.toFixed(2));
 +
 
 +
            $("input[name='speedKPH']").val(kph.toFixed(2));
 +
 
 +
        }<br />        $(function() {
 +
 
 +
            calcValues();
 +
 
 +
        });
 +
 
 +
    // ]]>
 +
 
 +
    </script><br />

Revision as of 19:09, 19 March 2021

<div id="SpeedCalc" class="table_small no_print">

<h3 id="calculator" class="table_small"><i class="fa fa-tachometer fa-2x" aria-hidden="true" style="color: #CC0000"></i> Robot Speed Calculator</h3>

<p><i>* If the red fields in the form below are not populated, please refresh your browser.</i></p>

      <ul>

        <li><label for="rpm">Motor Output Speed</label> <input type="text" name="rpm" value="190"> <span>rpm</span></li>

        <li><label for="ratio">Reduction*</label> <input type="text" name="ratio" value="1"> <span>ratio</span></li>

        <li><label for="diameter">Wheel Diameter</label> <input type="text" name="diameter" value="6"> <span>inches</span></li>

        <li><label for="circ">Wheel Circumference</label> <input type="text" name="circ" disabled="disabled"> <span>inches</span></li>

        <li><label for="speedIPM">Speed</label> <input type="text" name="speedIPM" disabled="disabled"> <span>inches per minute</span></li>

        <li><label for="speedFPM">Speed</label> <input type="text" name="speedFPM" disabled="disabled"> <span>feet per minute</span></li>

        <li><label for="speedMPH">Speed</label> <input type="text" name="speedMPH" disabled="disabled"> <span>miles per hour</span></li>

        <li><label for="speedMPM">Speed</label> <input type="text" name="speedMPM" disabled="disabled"> <span>meters per minute</span></li>

        <li><label for="speedKPH">Speed</label> <input type="text" name="speedKPH" disabled="disabled"> <span>km per hour</span></li>

        <li>* This is the reduction from the output of the gear motor to the wheel. If direct drive, reduction = 1. If your reduction is 1:2 put in 0.5.</li>

      </ul>

    </div>

<script type="text/javascript">

// <![CDATA[

    $("input:enabled").change(function() {

            calcValues();

        });
        function calcValues () {

            var rpm = $("input[name='rpm']").val();

            var ratio = $("input[name='ratio']").val();

            var cir = $("input[name='diameter']").val() * Math.PI;

            var ipm = rpm * ratio * cir;

            var fpm = ipm / 12.0;

            var mph = fpm * 60 / 5280;

            var mpm = fpm * 0.3048;

            var kph = mpm * 60 / 1000;
            $("input[name='circ']").val(cir.toFixed(2));

            $("input[name='speedIPM']").val(ipm.toFixed(2));

            $("input[name='speedFPM']").val(fpm.toFixed(2));

            $("input[name='speedMPH']").val(mph.toFixed(2));

            $("input[name='speedMPM']").val(mpm.toFixed(2));

            $("input[name='speedKPH']").val(kph.toFixed(2));

        }
        $(function() {

            calcValues();

        });

    // ]]>

    </script>