Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
actuators_mkk module

Actuators Driver for Mikrokopter V1 ESC

required xml configuration:

  • configuration section (number of motors and addresses)
  • servo section with driver="Mkk"
  • command_laws section to map motor_mixing commands to servos (max command = 255)

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="actuators_mkk">
2  <define name="I2C_TRANSACTION_QUEUE_LEN" value="8" />
3  <configure name="ACTUATORS_MKK_I2C_DEV" value="i2cX" />
4  <configure name="ACTUATORS_MKK_I2C_SCL_TIME" value="150" />
5 </module>

Module configuration options

Configure Options

  • name: ACTUATORS_MKK_I2C_DEV value: i2cX
    Description: I2C port (default i2c1)
  • name: ACTUATORS_MKK_I2C_SCL_TIME value: 150
    Description: configurable I2C timing on lpc21 boards (150 is default, use 50 for 8 motors)

Define Options

  • name: I2C_TRANSACTION_QUEUE_LEN value: 8
    Description: I2C queue length, default is 8, increase to 10 or more for 8 motors

Airframe file section

  • section name: ACTUATORS_MKK prefix: ACTUATORS_MKK_
    • name NB value: 4
      Description: number of motors
    • name ADDR value: { 0x52, 0x54, 0x56, 0x58 }
      Description: array of I2C addresses

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw actuators_mkk.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="actuators_mkk" dir="actuators" task="actuators">
<doc>
<description>
Actuators Driver for Mikrokopter V1 ESC
required xml configuration:
- configuration section (number of motors and addresses)
- servo section with driver="Mkk"
- command_laws section to map motor_mixing commands to servos (max command = 255)
</description>
<configure name="ACTUATORS_MKK_I2C_DEV" value="i2cX" description="I2C port (default i2c1)"/>
<configure name="ACTUATORS_MKK_I2C_SCL_TIME" value="150" description="configurable I2C timing on lpc21 boards (150 is default, use 50 for 8 motors)"/>
<define name="I2C_TRANSACTION_QUEUE_LEN" value="8" description="I2C queue length, default is 8, increase to 10 or more for 8 motors"/>
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4" description="number of motors"/>
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }" description="array of I2C addresses"/>
</section>
</doc>
<header>
<file name="actuators_mkk.h" dir="subsystems/actuators"/>
</header>
<makefile target="ap">
<configure name="ACTUATORS_MKK_I2C_DEV" default="i2c1" case="upper|lower"/>
<configure name="ACTUATORS_MKK_I2C_SCL_TIME" default="150"/>
<define name="ACTUATORS"/>
<define name="ACTUATORS_MKK_I2C_DEV" value="$(ACTUATORS_MKK_I2C_DEV_LOWER)"/>
<define name="USE_$(ACTUATORS_MKK_I2C_DEV_UPPER)"/>
<define name="$(ACTUATORS_MKK_I2C_DEV_UPPER)_SCLL" value="$(ACTUATORS_MKK_I2C_SCL_TIME)" cond="ifeq ($(ARCH), lpc21)"/>
<define name="$(ACTUATORS_MKK_I2C_DEV_UPPER)_SCLH" value="$(ACTUATORS_MKK_I2C_SCL_TIME)" cond="ifeq ($(ARCH), lpc21)"/>
<file name="actuators_mkk.c" dir="subsystems/actuators"/>
</makefile>
<makefile target="nps">
<define name="USE_I2C0"/>
<define name="ACTUATORS_MKK_I2C_DEV" value="i2c0"/>
<file name="actuators_mkk.c" dir="subsystems/actuators"/>
</makefile>
</module>