paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Lisa M 2.0 PWM servo selection


From: Gerard Toonstra
Subject: Re: [Paparazzi-devel] Lisa M 2.0 PWM servo selection
Date: Tue, 16 Sep 2014 10:34:27 -0300

Sorry, hit the wrong key and message got sent.

And then later on:

#define SERVO_FRONT_IDX 0

The actuators module uses that index to set the pwm for that channel in the define after that:

  ActuatorPwmSet(SERVO_FRONT, actuators[SERVO_FRONT_IDX]); \

Rgds,

Gerard


On Tue, Sep 16, 2014 at 10:32 AM, Gerard Toonstra <address@hidden> wrote:

Enes,

What you propose is correct I think, but you should always verify.

You can open the var/airframes/<ac-name>/generated/airframe.h file to see if the change worked out ok (assuming it compiled).

In that header file, you should notice the defines for the servo:

#define SERVO_FRONT 0

and then later on



In the conf/airframes/examples directory you have example multirotor configurations, see See quadrotor_m_2_pwm_spektrum.xml.

They use "motor_mixing" configuration sections and also use indexes into the "commands array. You can change the order there.
I haven't been able to look into how this works in detail yet.
From what I interpret here, this quad uses a + configuration, hence front/back/etc. For x configs this would be different.



  <command_laws>
    <call fun="motor_mixing_run(autopilot_motors_on,FALSE,values)"/>
    <set servo="FRONT"  value="motor_mixing.commands[0]"/>
    <set servo="BACK"   value="motor_mixing.commands[1]"/>
    <set servo="RIGHT"  value="motor_mixing.commands[2]"/>
    <set servo="LEFT"   value="motor_mixing.commands[3]"/>
  </command_laws>




    <subsystem name="motor_mixing"/>
    <subsystem name="actuators"     type="pwm">
      <define name="SERVO_HZ" value="400"/>
      <!--define name="USE_SERVOS_7AND8"/-->
    </subsystem>

  <servos driver="Pwm">
    <servo name="FRONT"   no="0" min="1000" neutral="1100" max="1900"/>
    <servo name="BACK"    no="1" min="1000" neutral="1100" max="1900"/>
    <servo name="RIGHT"   no="2" min="1000" neutral="1100" max="1900"/>
    <servo name="LEFT"    no="3" min="1000" neutral="1100" max="1900"/>
  </servos>

  <section name="MIXING" prefix="MOTOR_MIXING_">
    <define name="TRIM_ROLL" value="0"/>
    <define name="TRIM_PITCH" value="0"/>
    <define name="TRIM_YAW" value="0"/>
    <define name="NB_MOTOR" value="4"/>
    <define name="SCALE" value="256"/>
    <!-- front/back turning CW, right/left CCW -->
    <define name="ROLL_COEF"   value="{    0,    0, -256,  256 }"/>
    <define name="PITCH_COEF"  value="{  256, -256,    0,    0 }"/>
    <define name="YAW_COEF"    value="{ -256, -256,  256,  256 }"/>
    <define name="THRUST_COEF" value="{  256,  256,  256,  256 }"/>
  </section>


On Tue, Sep 16, 2014 at 7:57 AM, enes dilcan <address@hidden> wrote:
Any idea?

On Thu, Sep 11, 2014 at 7:47 PM, enes dilcan <address@hidden> wrote:
Hi,

I've building a quadrotor using Lisa M 2.0 and Turnigy Plush PWM ESC. As I see, when I choose pwm as a servo driver module, PWM1 to PWM6 initialized. 

Is it possible to change the order of pwm channels building for a quadrotor? Let me give an example to better describe my question. The servo section of sample airframe file is shown in below.
  <servos driver="Pwm">
    <servo name="FRONT" no="0" min="1000" neutral="1100" max="1900"/>
    <servo name="BACK" no="1" min="1000" neutral="1100" max="1900"/>
<servo name="LEFT" no="2" min="1000" neutral="1100" max="1900"/>
<servo name="RIGHT" no="3" min="1000" neutral="1100" max="1900"/> 
</servos>

According to "lisa_m_common.h", i think the section of "no" shows that the pwm channel that we I.

To use PWM1,PWM2,PWM3,PWM5 do I need to change the following line with  no="4"?  
    <servo name="RIGHT" no="3" min="1000" neutral="1100" max="1900"/> 

Regards,
Enes


--

nsdcn



--

nsdcn

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]