paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] paparazzi Lisa/M v2 magnetometer not working?


From: alonso acuña
Subject: Re: [Paparazzi-devel] paparazzi Lisa/M v2 magnetometer not working?
Date: Mon, 7 Jul 2014 20:19:56 -0600

Is this a problem that started after recent changes? I had never experienced and now I wanted to calibrate the magnetometer after some airframe changes and note that the mag is dead. I added the 2 sec sleep in imu_aspirin_2_spi.c  imu_impl_init(void)  and it works now.


On Sun, Jul 6, 2014 at 2:03 PM, oberthold <address@hidden> wrote:

hey joshua,

thanks for that, sounds like a perfectly reasonable fix to me for now. i
put it in imu_aspirin_2_spi.c to restrict the scope and use 2 sec. delay
which seems to do the job.

bst, oswald



address@hidden writes:

> UPDATE for any future readers from the googles searching on archives, or
> anyone else having this issue:
>
> I have "solved" the issue for me.  It's a bit of a hack-ish solution, I
> basically just added a 5-second wait before it initializes the IMU.  It
> does significantly increase the amount of time it takes for it to be
> ready to go after plugging in a battery, but hey, it works!
>
> I edit the file in paparazzi/sw/airborne/subsystems/imu.c
>
> Then I found the line where it said "void imu_init(void) {"   (the
> beginnning of the IMU initialization function)  and added a line below
> it:
>
> sys_time_usleep(5000000);
>
> 5 seconds is probably overkill, it should probably be 2 seconds, but it
> works, haven't noticed any ill effects thus far!
>
> ---
> Sent from my new email address: address@hidden
>
> On 2014-07-04 8:59 am, address@hidden wrote:
>> I did some testing, and can pretty much confirm that this is what's
>> happening.
>>
>> Here's what I did:  Connected the Lisa/M via USB, and flashed it, when
>> it's done flashing, it drops into running the payload, but WITHOUT
>> actually losing power to the board.  This way, the MPU is already
>> booted up / whatever it needs to do when the paparazzi firmware loads
>> up.  And voila!  It works as it should when I do it that way.  Though
>> obviously I can't run it that way, with the USB perpetually attached
>> :)
>>
>>> I suggest to add a delay before the configuration of the mag, I think
>>> this will solve your problem.
>>
>> I would like to do this, but.....  I quite honestly have no cue how,
>> and Google isn't showing me anything related, either.
>>
>> How would I go about adding a delay like that?  I assume I can't do it
>> in the airframe file itself or anything, as that is just xml
>> configuration?  I'm guessing I'd have to edit the code itself to add
>> it in, though I'm not sure where.
>>
>> Suppose I could just start tinkering with it, trying different places
>> until it works, but I'd prefer not to go through all that work if
>> someone already knows where the best place to add something like that
>> would be.
>>
>>
>> ---
>> Sent from my new email address: address@hidden
>>
>> On 2014-07-04 5:02 am, Gautier Hattenberger wrote:
>>> We had a similar problem using directly the hmc5883 (not through the
>>> mpu like aspirin). It seems that if you configure the reading mode (to
>>> continious mode) before the first initial reading of the sensor (which
>>> occurs after 1.3s in the worst case), the configuration is reset to 0
>>> (one shot mode).
>>> This problem is solved for all IMU using the general hmc58xx driver
>>> (in sw/airborne/peripherals) but I think it is not the case of the
>>> aspirin V2.1 which is controlling the mag as a slave of the mpu
>>> (sw/airborne/subsystems/imu/imu_aspirin_2_spi.c), so not using the
>>> direct driver.
>>> I suggest to add a delay before the configuration of the mag, I think
>>> this will solve your problem.
>>>
>>> Gautier
>>>
>>> Le 04/07/2014 12:34, oberthold a écrit :
>>>> address@hidden writes:
>>>>
>>>>> I have a paparazzi Lisa/M v2.0 (W/ Aspirin V2.1) which I am having
>>>>> troubles getting the magnetometer working properly.
>>>>>
>>>>> What I am doing to test & try getting it all worked out is via the
>>>>> telemetry link I have set up via an xbee modem, and using the GCS
>>>>> (ground control station) to change the flight mode to raw_sensors,
>>>>> the
>>>>> monitor the responses in the "messages" window.
>>>>>
>>>>> So the gyroscope works great, as does the accelerometer (which I
>>>>> calibrated and put the results in my airframe file) but the
>>>>> magnetometer
>>>>> DOES have values for it, but they never change, no matter how I
>>>>> orient
>>>>> the craft  (quadcopter) [X configuration] do the values change.
>>>>> HOWEVER, what is weird is that whenever the Lisa/M is power-cycled,
>>>>> then
>>>>> switched back into raw_sensors mode, the values are different.  So
>>>>> it's
>>>>> like they work....  but don't update.
>>>>>
>>>>> Any clue what could be wrong?
>>>> just adding to this: i seem to have the exact same problem, only i
>>>> wasn't describing it as verbosely [1]. so setting telemetry to
>>>> raw_sensors and observing the ACC/GYRO/MAG values the former two are
>>>> ok
>>>> but MAG values don't change (in about 8 out of 10 power
>>>> cycles, lisa/m v2, aspirin v2.2, current master).
>>>>
>>>> bst, opt
>>>>
>>>> [1]
>>>> https://lists.gnu.org/archive/html/paparazzi-devel/2014-07/msg00011.html
>>>>
>>>> _______________________________________________
>>>> 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]