Difference between revisions of "Subsystem/actuators"

From PaparazziUAV
Jump to navigation Jump to search
(updated supervision to motor mixing link)
(anchor tag links and spelling)
 
(14 intermediate revisions by 6 users not shown)
Line 3: Line 3:


Currently possible actuators subsystems are
Currently possible actuators subsystems are
* ''mkk''
* ''[[Subsystem/actuators#MKK|mkk]]''
* ''asctec''
* ''[[Subsystem/actuators#MKK_v2|mkk_v2]]''
* ''asctec_v2''
* ''[[Subsystem/actuators#Asctec_v1|asctec]]''
* ''pwm_supervision''
* ''[[Subsystem/actuators#Asctec_v2|asctec_v2]]''
* ''[[Subsystem/actuators#PWM|pwm]]''
* ''[[Subsystem/actuators#Dual_PWM|dualpwm]]''
* ''skiron''
* ''skiron''
* ''heli''
* ''heli''
* ''ardrone2''


== MKK ==
== MKK ==
Line 18: Line 22:
   <subsystem name="actuators"    type="mkk">
   <subsystem name="actuators"    type="mkk">
     <configure name="MKK_I2C_SCL_TIME" value="50"/> <!-- only LPC21xx, optional, 150 is default, use 50 for 8 motors-->
     <configure name="MKK_I2C_SCL_TIME" value="50"/> <!-- only LPC21xx, optional, 150 is default, use 50 for 8 motors-->
    <configure name="ACTUATORS_MKK_I2C_DEV" value="i2c1"/>
   </subsystem>
   </subsystem>
   <define name="I2C_TRANSACTION_QUEUE_LEN" value="10"/> <!-- default is 8, increase to 10 or more for 8 motors-->
   <define name="I2C_TRANSACTION_QUEUE_LEN" value="10"/> <!-- default is 8, increase to 10 or more for 8 motors-->
Line 27: Line 32:


=== XML configuration ===
=== XML configuration ===
required defines in section ''ACTUATORS_MKK'':
* ''NB'': number of motors
* ''ADDR'': the I2C addresses of your motors
{{Box Code|conf/airframes/myplane.xml|
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
<source lang="xml">
   <section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
   <section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
     <define name="NB" value="4"/>
     <define name="NB" value="4"/><!-- number of motors -->
     <define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
     <define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/><!-- the I2C addresses of your motors -->
   </section>
   </section>
  <servos driver="mkk">
    <servo name="FRONT"  no="0"    min="0" neutral="2" max="200"/>
    <servo name="RIGHT"  no="1"    min="0" neutral="2" max="200"/>
    <servo name="BACK"  no="2"    min="0" neutral="2" max="200"/>
    <servo name="LEFT"  no="3"    min="0" neutral="2" max="200"/>
  </servos>
</source>
</source>
}}
}}


You also need the matching [[Rotorcraft_Configuration#Supervision|Supervision section]].
The order of addresses in the list defines the numbering of motors! Warn on this during motor mixing!
MKK specific values for SUPERVISION defines:
 
You also need the matching [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]].
For Paparazzi versions  older than 5.0 MKK specific values for SUPERVISION defines:
* ''STOP_MOTOR'' : 0, optional, as the default is already 0
* ''STOP_MOTOR'' : 0, optional, as the default is already 0
* ''MIN_MOTOR'' : 3
* ''MIN_MOTOR'' : 3
* ''MAX_MOTOR'' : 200
* ''MAX_MOTOR'' : 200
The ''STOP|MIN|MAX_MOTOR'' define are not needed in version 5.0 and above.
== MKK v2 ==
Similar to the above, this is version 2 of the MKK ESCs. The configuration is the same as above, just change mkk to mkk_v2 and MKK to MKK_V2.
This also works with ESCs that have the SimonK firmware and that have I2C support. Very limited documentation is available at [https://github.com/sim-/tgy/ the github page]. It should be noted that you will need to compile and load the firmware for each motor as you will need to change the I2C address for each one to match the ADDR define. If you have success with this please post some more info here.


== Asctec v1 ==
== Asctec v1 ==
These controllers already to the mixing themselves, so the [[Rotorcraft_Configuration#Supervision|Supervision]] section is not needed.
These controllers already to the mixing themselves, so the [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]] section is not needed.
{{Box Code|conf/airframes/myplane.xml|
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
<source lang="xml">
Line 66: Line 84:
}}
}}
=== XML configuration ===
=== XML configuration ===
You need the matching [[Rotorcraft_Configuration#Supervision|Supervision section]].
You need the matching [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]].


== PWM Supervision ==
== PWM ==
Only for stm32 based autopilot boards (eg. Lisa/M, Lisa/L)
Only for stm32 based autopilot boards (eg. Lisa/M, Lisa/L)
{{Box Code|conf/airframes/myplane.xml|
{{Box Code|conf/airframes/myplane.xml|
Line 74: Line 92:
   <firmware name="rotorcraft">
   <firmware name="rotorcraft">
     ...
     ...
     <subsystem name="actuators" type="pwm_supervison">
     <subsystem name="actuators" type="pwm">
       <define name="SERVO_HZ" value="400"/>
       <define name="SERVO_HZ" value="400"/>
     </subsystem>
     </subsystem>
Line 81: Line 99:
}}
}}


The define ''SERVO_HZ'' sets a higher update frequency for the pwm controllers which is needed for good response times.
The define ''SERVO_HZ'' sets a higher update frequency for the pwm controllers which is needed for good response times on some ESCs. Some newer ESCs are said to work better with lower frequencies. More information should be added here.
=== XML configuration ===
=== XML configuration ===
{{Box Code|conf/airframes/myplane.xml|
{{Box Code|conf/airframes/myplane.xml|
Line 94: Line 112:
}}
}}
You also need the matching [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]].
You also need the matching [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]].
Example PWM specific values for SUPERVISION defines:
 
* ''STOP_MOTOR'' : 800
== Dual PWM ==
* ''MIN_MOTOR'' : 1000
This driver allows you to generate dual pulses to control for example double servos like those :
* ''MAX_MOTOR'' : 2000
 
[[File:Dual linear servos.jpg]]
 
The signal we want to generate look like that :
 
[[File:Dual_pulse.png]]
 
During the time of a regular pwm pulse (20ms) we got two parts :
* the first 1 with a total period of 4ms. During that part we generate the first pulse that is going to control for example the first servo.
* the first 2 with a total period of 16ms. During that part we generate the second pulse that is going to control for example the second servo.
 
=== How to use the driver ===
 
<span style="color:#FF0000">'''CAUTION!'''</span> <b>This module is only implemented on the lisa M and lisa S boards at the time of writing this documentation (28 mars 2014)</b>
 
First of all you are going to need to add the subsystem that is going to generate those pulses :
 
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
  <firmware name="fixedwing">
    <target name="ap"  board="lisa_s_0.1">
      ...
    </target>
 
    ...
 
    <subsystem name="actuators" type="dualpwm">
      <define name="DUAL_PWM_ON"/>
    </subsystem>
 
  </firmware>
</source>
}}
 
 
=== XML configuration ===
Then we will be able to add a servo block into the airframe file (in the same way we would for regular servos). But we have to specify the driver that we are using for those servos :
 
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
...
  <servos driver="DualPwm">
    <servo name="SWITCH"  no="3" min="1100" neutral="1500" max="1900"/>
    <servo name="pitchator"  no="2" min="1100" neutral="1500" max="1900"/>
  </servos>
...
</source>
}}
 
<span style="color:#FF0000">'''CAUTION!'''</span> <b>The tricky part about this module is that it requires the use of the full timer (that was previously shared between multiple regular pwm). In order to reduce the wast of pins we can only put that type of servos on specifics pins :
* lisa S (version 0.1) : on the servos 2 and 3 (as shown above). The dual PWM will then but outputted on the 5th pin (yes that is not logical).
* lisa M (version 2.0) : on the servos 4 and 5. The dual PWM will be outputted on the 4th pin.
</b>
 


[[Category:User_Documentation]] [[Category:Subsystems]]
[[Category:User_Documentation]] [[Category:Subsystems]]

Latest revision as of 07:48, 26 June 2015

This subsystem only needs be explicitly specified for rotorcrafts where there are several different actuators implementations and you have to add the correct one depending on the ESCs you use.

Currently possible actuators subsystems are


MKK

Mikrokopter ESCs

File: conf/airframes/myplane.xml
  <firmware name="rotorcraft">
     ...
   <subsystem name="actuators"     type="mkk">
     <configure name="MKK_I2C_SCL_TIME" value="50"/> <!-- only LPC21xx, optional, 150 is default, use 50 for 8 motors-->
     <configure name="ACTUATORS_MKK_I2C_DEV" value="i2c1"/>
   </subsystem>
   <define name="I2C_TRANSACTION_QUEUE_LEN" value="10"/> <!-- default is 8, increase to 10 or more for 8 motors-->
 </firmware>
  • MKK_I2C_SCL_TIME is specific to LPC21x based boards (e.g. booz) and has no effect for STM32 based boards (e.g. Lisa/M/L)

XML configuration

File: conf/airframes/myplane.xml
  <section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
    <define name="NB" value="4"/><!-- number of motors -->
    <define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/><!-- the I2C addresses of your motors -->
  </section>
  <servos driver="mkk">
    <servo name="FRONT"  no="0"    min="0" neutral="2" max="200"/>
    <servo name="RIGHT"  no="1"    min="0" neutral="2" max="200"/>
    <servo name="BACK"   no="2"    min="0" neutral="2" max="200"/>
    <servo name="LEFT"   no="3"    min="0" neutral="2" max="200"/>
  </servos>

The order of addresses in the list defines the numbering of motors! Warn on this during motor mixing!

You also need the matching Motor Mixing section. For Paparazzi versions older than 5.0 MKK specific values for SUPERVISION defines:

  • STOP_MOTOR : 0, optional, as the default is already 0
  • MIN_MOTOR : 3
  • MAX_MOTOR : 200

The STOP|MIN|MAX_MOTOR define are not needed in version 5.0 and above.

MKK v2

Similar to the above, this is version 2 of the MKK ESCs. The configuration is the same as above, just change mkk to mkk_v2 and MKK to MKK_V2.

This also works with ESCs that have the SimonK firmware and that have I2C support. Very limited documentation is available at the github page. It should be noted that you will need to compile and load the firmware for each motor as you will need to change the I2C address for each one to match the ADDR define. If you have success with this please post some more info here.

Asctec v1

These controllers already to the mixing themselves, so the Motor Mixing section section is not needed.

File: conf/airframes/myplane.xml
  <firmware name="rotorcraft">
     ...
    <subsystem name="actuators" type="asctec"/>
  </firmware>

Asctec v2

File: conf/airframes/myplane.xml
  <firmware name="rotorcraft">
     ...
    <subsystem name="actuators" type="asctec_v2"/>
  </firmware>

XML configuration

You need the matching Motor Mixing section.

PWM

Only for stm32 based autopilot boards (eg. Lisa/M, Lisa/L)

File: conf/airframes/myplane.xml
  <firmware name="rotorcraft">
     ...
    <subsystem name="actuators" type="pwm">
      <define name="SERVO_HZ" value="400"/>
    </subsystem>
  </firmware>

The define SERVO_HZ sets a higher update frequency for the pwm controllers which is needed for good response times on some ESCs. Some newer ESCs are said to work better with lower frequencies. More information should be added here.

XML configuration

File: conf/airframes/myplane.xml
  <servos min="0" neutral="0" max="0xff">
    <servo name="FRONT" no="0" min="1000" neutral="1000" max="2000"/>
    <servo name="BACK" no="1" min="1000" neutral="1000" max="2000"/>
    <servo name="LEFT" no="2" min="1000" neutral="1000" max="2000"/>
    <servo name="RIGHT" no="3" min="1000" neutral="1000" max="2000"/>
  </servos>

You also need the matching Motor Mixing section.

Dual PWM

This driver allows you to generate dual pulses to control for example double servos like those :

Dual linear servos.jpg

The signal we want to generate look like that :

Dual pulse.png

During the time of a regular pwm pulse (20ms) we got two parts :

  • the first 1 with a total period of 4ms. During that part we generate the first pulse that is going to control for example the first servo.
  • the first 2 with a total period of 16ms. During that part we generate the second pulse that is going to control for example the second servo.

How to use the driver

CAUTION! This module is only implemented on the lisa M and lisa S boards at the time of writing this documentation (28 mars 2014)

First of all you are going to need to add the subsystem that is going to generate those pulses :


File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
    <target name="ap"   board="lisa_s_0.1">
      ...
    </target>

    ...

    <subsystem name="actuators" type="dualpwm">
      <define name="DUAL_PWM_ON"/>
    </subsystem>

  </firmware>


XML configuration

Then we will be able to add a servo block into the airframe file (in the same way we would for regular servos). But we have to specify the driver that we are using for those servos :


File: conf/airframes/myplane.xml
...
  <servos driver="DualPwm">
    <servo name="SWITCH"  no="3" min="1100" neutral="1500" max="1900"/>
    <servo name="pitchator"  no="2" min="1100" neutral="1500" max="1900"/>
  </servos>
...

CAUTION! The tricky part about this module is that it requires the use of the full timer (that was previously shared between multiple regular pwm). In order to reduce the wast of pins we can only put that type of servos on specifics pins :

  • lisa S (version 0.1) : on the servos 2 and 3 (as shown above). The dual PWM will then but outputted on the 5th pin (yes that is not logical).
  • lisa M (version 2.0) : on the servos 4 and 5. The dual PWM will be outputted on the 4th pin.