paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] Booz IMU v1.2 on LPC


From: David Conger
Subject: Re: [Paparazzi-devel] Booz IMU v1.2 on LPC
Date: Sun, 17 Jun 2012 17:53:07 -0700

Hello Christoph,

At the moment I do not have Booz IMU + Booz connected. The behavior was in the messages the z axis was not reporting. Just 0s. All the other axis were reporting values. When I used an older paparazzi3 source it worked. All 3 axis. Nothing in the hardware was changed. I even used the same airframe XML file. Only difference was the source. 

Since my hardware is not connected I am unable to verify myself. Too many other things I am working on ATM. 

Regards,
David
On Jun 17, 2012, at 12:53 PM, Christoph Niemann wrote:

Hi Gautier and David again,

I tried it also using the last SVN checked into savannah (r6430). The MS2100 didn't work, but the I2C1 define didn't prevent the AP from starting. I also tried to use the driver for the v1.2 but it didn't build since the compiler somehow didn't find the defines for the signs of the gyros and accels. I didn't investigate this further, since that was a really old version.

Cheers

Christoph

2012/6/17 Christoph Niemann <address@hidden>
Hi Gautier,

it seems to be an I2C issue. I tried it again with the configfile below and it doesn't initialize. Its enough to just define USE_I2C1 and not load any modules (I tried also to load I2C modules as well, but as expected it didn't change anything). Perhaps you could try this file tomorrow.

Cheers

Christoph

<airframe name="BOOZ2_a1">
 
  <modules>
      <!--load name="mag_hmc5843.xml"/-->
  </modules>


  <servos>
    <servo name="FRONT" no="0" min="0" neutral="0" max="255"/>
    <servo name="BACK"  no="1" min="0" neutral="0" max="255"/>
    <servo name="RIGHT" no="2" min="0" neutral="0" max="255"/>
    <servo name="LEFT"  no="3" min="0" neutral="0" max="255"/>
  </servos>

  <commands>
    <axis name="PITCH"  failsafe_value="0"/>
    <axis name="ROLL"   failsafe_value="0"/>
    <axis name="YAW"    failsafe_value="0"/>
    <axis name="THRUST" failsafe_value="0"/>
  </commands>

  <section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
    <define name="NB" value="4"/>
    <define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
  </section>

  <section name="SUPERVISION" prefix="SUPERVISION_">
    <define name="MIN_MOTOR" value="2"/>
    <define name="MAX_MOTOR" value="210"/>
    <define name="TRIM_A" value="0"/>
    <define name="TRIM_E" value="0"/>
    <define name="TRIM_R" value="0"/>
    <define name="NB_MOTOR" value="4"/>
    <define name="SCALE" value="256"/>
    <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>

  <section name="IMU" prefix="IMU_">

    <define name="GYRO_P_NEUTRAL" value="32660"/>
    <define name="GYRO_Q_NEUTRAL" value="31900"/>
    <define name="GYRO_R_NEUTRAL" value="33000"/>
    <define name="GYRO_P_SENS" value=" 1.01" integer="16"/>
    <define name="GYRO_Q_SENS" value=" 1.01" integer="16"/>
    <define name="GYRO_R_SENS" value=" 1.01" integer="16"/>

    <!--define name="ACCEL_X_NEUTRAL" value="32081"/>
    <define name="ACCEL_Y_NEUTRAL" value="33738"/>
    <define name="ACCEL_Z_NEUTRAL" value="32441"/>
    <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
    <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
    <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/-->

    <define name="ACCEL_X_NEUTRAL" value="30700"/>
    <define name="ACCEL_Y_NEUTRAL" value="30650"/>
    <define name="ACCEL_Z_NEUTRAL" value="29628"/>
    <define name="ACCEL_X_SENS" value="3.08293163554" integer="16"/>
    <define name="ACCEL_Y_SENS" value="3.44880611804" integer="16"/>
    <define name="ACCEL_Z_SENS" value="3.08419219864" integer="16"/>




    <define name="MAG_X_CHAN" value="4"/>
    <define name="MAG_Y_CHAN" value="0"/>
    <define name="MAG_Z_CHAN" value="2"/>

    <define name="MAG_X_NEUTRAL" value="2358"/>
    <define name="MAG_Y_NEUTRAL" value="2362"/>
    <define name="MAG_Z_NEUTRAL" value="2119"/>

<!--    <define name="MAG_X_SENS" value="-4.94075530" integer="16"/>-->
<!--    <define name="MAG_Y_SENS" value=" 5.10207664" integer="16"/>-->
    <define name="MAG_X_SIGN" value="-1"/>
    <define name="MAG_Y_SIGN" value=" 1"/>
    <define name="MAG_Z_SIGN" value="-1"/>

    <define name="MAG_Z_SENS" value="4.90788848" integer="16"/>
    <define name="MAG_45_HACK" value="1"/>
<!--    <define name="MAG_X_SENS" value="-4.94075530 * sqrt(2)/2" integer="16"/> -->
<!--    <define name="MAG_Y_SENS" value=" 5.10207664 * sqrt(2)/2" integer="16"/> -->
    <define name="MAG_X_SENS" value=" 3.4936416" integer="16"/>
    <define name="MAG_Y_SENS" value=" 3.607713"  integer="16"/>

   <define name="BODY_TO_IMU_PHI"   value="RadOfDeg(4.)"/>
   <define name="BODY_TO_IMU_THETA" value="RadOfDeg(3.)"/>
   <define name="BODY_TO_IMU_PSI"   value="RadOfDeg(0.)"/>
<!--
   <define name="BODY_TO_IMU_PHI"   value="RadOfDeg(0.)"/>
   <define name="BODY_TO_IMU_THETA" value="RadOfDeg(0.)"/>
   <define name="BODY_TO_IMU_PSI"   value="RadOfDeg(0.)"/>
-->

  </section>


  <section name="STABILIZATION_RATE" prefix="STABILIZATION_RATE_">

    <define name="SP_MAX_P" value="10000"/>
    <define name="SP_MAX_Q" value="10000"/>
    <define name="SP_MAX_R" value="10000"/>

    <define name="GAIN_P" value="400"/>
    <define name="GAIN_Q" value="400"/>
    <define name="GAIN_R" value="350"/>

  </section>


  <section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_">

    <!-- setpoints -->
    <define name="SP_MAX_PHI"     value="45." unit="deg"/>
    <define name="SP_MAX_THETA"   value="45." unit="deg"/>
    <define name="SP_MAX_R"       value="90." unit="deg/s"/>
    <define name="DEADBAND_R"     value="250"/>

    <!-- reference -->
    <define name="REF_OMEGA_P"  value="800" unit="deg/s"/>
    <define name="REF_ZETA_P"   value="0.9"/>
    <define name="REF_MAX_P"    value="300." unit="deg/s"/>
    <define name="REF_MAX_PDOT" value="RadOfDeg(7000.)"/>

    <define name="REF_OMEGA_Q"  value="800" unit="deg/s"/>
    <define name="REF_ZETA_Q"   value="0.9"/>
    <define name="REF_MAX_Q"    value="300." unit="deg/s"/>
    <define name="REF_MAX_QDOT" value="RadOfDeg(7000.)"/>

    <define name="REF_OMEGA_R"  value="500" unit="deg/s"/>
    <define name="REF_ZETA_R"   value="0.9"/>
    <define name="REF_MAX_R"    value="180." unit="deg/s"/>
    <define name="REF_MAX_RDOT" value="RadOfDeg(1800.)"/>

    <!-- feedback -->
    <define name="PHI_PGAIN"  value="400"/>
    <define name="PHI_DGAIN"  value="300"/>
    <define name="PHI_IGAIN"  value="100"/>

    <define name="THETA_PGAIN"  value="400"/>
    <define name="THETA_DGAIN"  value="300"/>
    <define name="THETA_IGAIN"  value="100"/>

    <define name="PSI_PGAIN"  value="380"/>
    <define name="PSI_DGAIN"  value="320"/>
    <define name="PSI_IGAIN"  value="75"/>

    <!-- feedforward -->
    <define name="PHI_DDGAIN"   value=" 300"/>
    <define name="THETA_DDGAIN" value=" 300"/>
    <define name="PSI_DDGAIN"   value=" 300"/>

  </section>

  <section name="INS" prefix="INS_">
    <define name="BARO_SENS" value="15." integer="16"/>
  </section>

  <section name="GUIDANCE_V" prefix="GUIDANCE_V_">
   <define name="MIN_ERR_Z"   value="POS_BFP_OF_REAL(-10.)"/>
   <define name="MAX_ERR_Z"   value="POS_BFP_OF_REAL( 10.)"/>
   <define name="MIN_ERR_ZD"  value="SPEED_BFP_OF_REAL(-10.)"/>
   <define name="MAX_ERR_ZD"  value="SPEED_BFP_OF_REAL( 10.)"/>
   <define name="MAX_SUM_ERR" value="2000000"/>
   <define name="HOVER_KP"    value="500"/>
   <define name="HOVER_KD"    value="200"/>
   <define name="HOVER_KI"    value="100"/>
   <!-- 1.5m/s for full stick : BOOZ_SPEED_I_OF_F(1.5) / (MAX_PPRZ/2) -->
   <define name="RC_CLIMB_COEF" value ="163"/>
   <!-- BOOZ_SPEED_I_OF_F(1.5) * 20% -->
   <define name="RC_CLIMB_DEAD_BAND" value ="160000"/>
<!--   <define name="INV_M" value ="0.2"/> -->
  </section>


 <section name="GUIDANCE_H" prefix="GUIDANCE_H_">
   <define name="PGAIN" value="100"/>
   <define name="DGAIN" value="100"/>
   <define name="IGAIN" value="0"/>
 </section>

 <section name="BAT">
   <define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
 </section>

 <section name="AUTOPILOT">
   <define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
   <define name="MODE_AUTO1"  value="AP_MODE_ATTITUDE_RC_CLIMB"/>
   <define name="MODE_AUTO2"  value="AP_MODE_ATTITUDE_Z_HOLD"/>
 </section>

 <section name="FMS">

 </section>

 <section name="MISC">
   <define name="FACE_REINJ_1"  value="1024"/>
 </section>


 <section name="SIMULATOR" prefix="NPS_">
   <define name="ACTUATOR_NAMES"  value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
   <define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
   <define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_booz2_a1.h&quot;"/>
 </section>


  <firmware name="rotorcraft">
    <target name="ap" board="booz_1.0">
      <define name="USE_I2C1" />
    </target>
    <target name="nps" board="pc">
      <subsystem name="fdm"         type="nps"/>
    </target>
    <subsystem name="radio_control" type="ppm"/>
    <subsystem name="telemetry"     type="transparent"/>
    <subsystem name="actuators"     type="mkk"/>
    <subsystem name="imu"           type="b2_v1.1"/>
    <subsystem name="gps"           type="ublox"/>
    <subsystem name="stabilization"   type="euler"/>
    <subsystem name="ahrs"          type="int_cmpl_euler"/>
    <subsystem name="ins"           type="hff"/>
  </firmware>


</airframe>


2012/6/17 Gautier Hattenberger <address@hidden>
Hi,

Maybe I have a booz/imu_v1.2 at work, so you will have to wait tomorrow before I can test it.

Can you try to load one of the i2c sensor, no matter which, configured on i2c1. It can help to tell if it is a i2c or peripheral issue.

Gautier

Le 17/06/2012 11:14, Christoph Niemann a écrit :
Hi David,

sounds interesting. The current behavior, trying to use the MS2100 is, the IMU initializes (the ADC gives values and the LEDs glow continuously) but the MAG_RAW message only gives (0,0,0). Do you think this could be a new bug? Which SVN revision do you use? (http://svn.savannah.nongnu.org/viewvc/paparazzi-software/trunk/?root=paparazzi&pathrev=6430) ? Which IMU version do you have? Could you supply the config-file, so I could do some HW-testing with the original mag?
Could someone who has a Booz-Mainboard try, what happens if the define USE_I2C1 is set?

Thanks for your help

Christoph

2012/6/16 David Conger <address@hidden>
Christoph, Have you tried with older paparazzi3 source? I found if I used older SVN paparazzi3 the single axis mag does work. With the newer Git code it does not. AJ was going to create an issue in Git. I have confirmed it many times but not until now did you also see the same issue with v1.1 Booz IMU. 
-David Conger

On Jun 16, 2012, at 9:44 AM, Christoph Niemann wrote:

I forgot: It starts with v1.1 and v1.0 since there is no USE_I2C1 in their makefiles.

2012/6/16 Christoph Niemann <address@hidden>
Yep, it also crashes without anything plugged. As I wrote, normally its a v1.1 IMU with the MS2100 (potentially broken, the SPI works, since the MAX1168 does - I disconnected the DRDY from the MS2100) placed. Currently I build it using the driver for the v1.1. If I load the HMC-Module for I2C0 it doesn't crash. If I don't load the module and do the define for I2C1 it crashes. It doesn't matter if the HMC is plugged or not.
I've got a LA but unfortunaly currently I'm not at home. Do you have a suggestion what to look for?


Christoph

2012/6/16 Gautier Hattenberger <address@hidden>
Does it also crash on the booz board without the HMC plugged ? Does it start with imu v1.0 or others without the magnetometer code ? By any chance, do you have a logical analyzer ?

Gautier

Le 16/06/2012 16:43, Christoph Niemann a écrit :
Hi Gautier,

thank you very much, but if I use v1.2 (which already has the I2C1 define) or v1.1 (in this case by loading the hmc module and changing the I2C to I2C1 (because it is connected to this port, because I want to use I2C0 for the MKK ESCs and the hmc is 3.3V I2C)) the Booz-Main board doesn't flash the LEDs anymore, when aligning the AHRS and there is no telemetry. I tried to reproduce it using a TWOG and the fixiedwing fw and there is still telemetry. I have absolutely no clue, what could be the problem, so if somebody has an idea, I would be really happy! The fact the HMC isn't needing the DRDY-line is really good :-)

Cheers

Christoph

2012/6/16 Gautier Hattenberger <address@hidden>
Hi Christoph,

The HMC58XX driver is polling the sensor, so their is no need of the DRDY pin. Also the flag USE_I2C1 is already define by the subsystem, so you should not be necessary to define it again.

Gautier

Le 16/06/2012 00:13, Christoph Niemann a écrit :
Hi Felix,

thank you very much. As usual your response was very helpful.I was just using a really old version, since then it didn't build. Now I'm using the current v3.9 and it builds. But there are still some problems: If I define USE_I2C1 the LPC won't start at all, I wasn't able to reproduce this with a TWOG. Might it be a HW-Problem? I think I should use i2c1 since it should be 3.3V I2C.
Second: I'm using this (http://www.sparkfun.com/products/9371) Breakout Board from Sparkfun. It doesn't have the DRDY-Pin. I was able to solder a wire to the pad and could solder it accordingly, but: Will it work if I define HMC5843_NO_IRQ without DRDY for the AHRS?
Last but not least I saw the "original b2_v1.2 has a 1.8V Vreg. Is it really needed?
If there is somebody, who has answers for this questions help would be highly appreciated.

Cheers

Christoph

2012/6/15 Felix Ruess <address@hidden>
Hi Christoph,

the driver for the booz imu v1.2 on LPC21xx uses the arch independent driver hcm58xx, so you don't need an arch file...
See conf/firmwares/subsystems/shared/imu_b2_v1.2.makefile

Cheers, Felix

On Thu, Jun 14, 2012 at 9:53 AM, Christoph Niemann <address@hidden> wrote:
Hi everyone,

currently I'm trying to get some old booz Hardware to work. Everything is fine and works, but the mag doesn't. It's a Booz PCB set v1.1 . So the mag is currently a MS2100. I can see the LPC sends somesthing like 0x4B to the mag, but it doesn't pull DRDY. So I guess the MS2100 is broken. I have a HMC5843 here. So what I want to try to do is to just change the type of the IMU from v1.1 (MS2100) to v1.2 (HMC5843). But the arch file for the HMC on the LPC seems to miss. Am I making a misstake or do I have to implement it? Or has somebody already implemented it? Every help would be appreciated.

Cheers

Christoph

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



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




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

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




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

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



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


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




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

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



_______________________________________________
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]