<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from cmd_servo_detach.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="cmd_servo_detach" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>cmd_servo_detach</refname>
    <refpurpose>Command to release the pin which has been setup for servo motor</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   cmd_servo_detach(h,servo_no)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>h :</term>
      <listitem><para> Board number, reserved for future use. For this version, any number would do</para></listitem></varlistentry>
   <varlistentry><term>servo_no :</term>
      <listitem><para> 1=pin 9, 2=pin 10</para></listitem></varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
A servomotor is an rotary actuator consist of an electric motor, gears, a potentiometer and an analogue or digital electronics for control. The servomotor usualy used for a position control application (or speed for continuous rotation servos).
   </para>
   <para>
The user must give the command of the position setpoint or desired speed. This command is sent to the actuator in pulses spaced by 10 to 20 ms. The coding of these pulses is made such that a pulse of 1.5 ms corresponding to the centered position (rest), a pulse of 1 ms corresponds to an angle of 90° in the anticlockwise direction, and a pulse 2 ms corresponds to an angle of 90° clockwise. All other pulse widths give intermediate values​​.
   </para>
   <para>
A servomotor for continuous rotation, the pulse width control the rotational speed and the direction. It is recommended to use a voltage regulator to power the servomotor instead of using the Arduino board power. For simplicity, the function takes an input commnad in degrees from 0 to 180. Two actuators can be controlled with this toolbox. (modified version of 3 motors available)
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
ok = open_serial(1,9,115200)
cmd_servo_attach(1,1)
sleep(1000)
cmd_servo_move(1,1,90)
sleep(1000)
cmd_servo_move(1,1,45)
sleep(1000)
cmd_servo_detach(1,1)
sleep(1000)
close_serial(1)

   ]]></programlisting>
</refsection>

<refsection>
   <title>See also</title>
   <simplelist type="inline">
   <member><link linkend="cmd_servo_setup">cmd_servo_setup</link></member>
   <member><link linkend="cmd_servo_move">cmd_servo_move</link></member>
   </simplelist>
</refsection>

<refsection>
   <title>Authors</title>
   <simplelist type="vert">
   <member>Bruno JOFRET, Tan C.L.</member>
   </simplelist>
</refsection>
</refentry>
