Current sensor support in telemetry

17 views
Skip to first unread message

Giulio Berti

unread,
Apr 12, 2016, 3:00:30 AM4/12/16
to uavdevboard-dev
Hi,
after setting up a current sensor in options.h, I noticed that it's used exclusively for OSD data.
Even if SUE mentions a bmv, it does not use sensor data.

Voltage, current and used mAh would be valuable information to me, in order to measure, battery performance and I wonder whether there would be side effects to support it in SUE.
I did a test crudely modifying telemetry.c, but flan.py does not produce a csv containing those data and I don't know how to modify it.

Here is the result I obtained manually modifying the telemetry file (as example)

From the graph I learned that my battery has a very large internal resistance, dropping 1.7V when loaded with 10A ! Moreover, towards the end of the flight, It was able to deliver just 60W, although being at full throttle.


In conclusion, I think that it won't be a big challenge to include and parse such data in telemetry.c and flan.py, while the user benefit would be considerable (at least for me :D)


Lastly, I attach my crude modification to telemetry.c


Best regards,

Giulio



telemetry.c

Riccardo Kuebler

unread,
Apr 12, 2016, 4:46:35 AM4/12/16
to uavdevb...@googlegroups.com
Hi Giulio,

nice that! I agree about the importance of battery data in the telemetry. It happened already that a LOGO flight plan was not done as expected because of a weak battery (climb power!).
Having vertical acceleration is another desire for me, to be able to check actual coefficient lift. It is in the OSD layout already, but not in the telemetry file.

Best regards,
Ric
--
You received this message because you are subscribed to the Google Groups "uavdevboard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Mail priva di virus. www.avast.com

Peter Hollands

unread,
Apr 12, 2016, 5:38:15 AM4/12/16
to uavdevb...@googlegroups.com
Ric,

The aero force (gravity - acceleration) is shown for the X,Y,Z axis of the aircraft in the SUE telemetry these days. It is used by flan.pyw to calculate a ratio of angle of attack to wing loading, which can be used by the HelicalTurns code to generate more accurate turns.
I enclose a screenshot from LOG184 of Giulio's flight.  The UDB4 will show around -2000 on the Z axis when level on the ground.  

Can you use the AERO Z column towards calculating the coefficient of lift ?

Best wishes, Pete

Screen Shot 2016-04-12 at 10.32.59.png
LOG00184.ods

Peter Hollands

unread,
Apr 12, 2016, 6:06:53 AM4/12/16
to uavdevb...@googlegroups.com
Giulio,

I am essentially fine with the changes to telemetry.c to allow monitoring of voltage, ampage etc.

I would really like to start using the pull requests feature of Github for discussing these changes. That is the best place for detailed code change discussion.

So I am going to make a pull request with your changes; but I'm going to group all the battery information together in the F2: rows; there is no need for it to be separate.

Do you have a github login yet ? It would be good to know your account name.

One potential downside of extending the F2: protocol of SUE is that some memory cards are not fast enough to store the data with out OpenLog dropping characters. But clearly the change is working with yours. And most cards are faster now.

Best wishes, Pete

Giulio Berti

unread,
Apr 12, 2016, 7:01:07 AM4/12/16
to uavdevb...@googlegroups.com

Peter,
I agree to group together all battery data, it's easier to read.
My account name should be Giulio Berti.
I have a 4 years old 2GB sdcard, and the openlog communicates at 57600 baud.

Another point in favor of having battery values in the csv file is that I'll be able to use them with dashware!

Best regards,
Giulio

You received this message because you are subscribed to a topic in the Google Groups "uavdevboard-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/uavdevboard-dev/osH_9e0pd6M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to uavdevboard-d...@googlegroups.com.

Peter Hollands

unread,
Apr 12, 2016, 7:03:01 AM4/12/16
to uavdevb...@googlegroups.com
Giulio,

I have made a pull request in github.  Please can you test the small changes I have made in one of your next flights. For your convenience, I enclose the changed telemetry.c file (changes shown in the pull request).

Best wishes, Pete



telemetry.c

Giulio Berti

unread,
Apr 12, 2016, 8:52:59 AM4/12/16
to uavdevboard-dev
Pete,
thank you, I'll test it in my next flight (probably this weekend).

Another question: in order to "complete" this change in order to have battery data available also while using MavLink, shouldn't we update MAVUDBExtra.c and MAVLink.c as well?
If I got it correctly, MavLink sends used mAh in BATTERY_STATUS, but we are not currently supporting it.

Best regards,
Giulio

Peter Hollands

unread,
Apr 12, 2016, 9:03:05 AM4/12/16
to uavdevb...@googlegroups.com
Yes, you are right. MAVUDBExtra.c and MAVlink.c should now both be updated.


Best wishes, Pete



Riccardo Kuebler

unread,
Apr 12, 2016, 9:19:26 AM4/12/16
to uavdevb...@googlegroups.com
Hi Pete,

thanks for your answer.
Wow, is telemetry file reduced really that much?
On that point I would point that today I did a few flights with the Acromaster to test hovering autonomous flight.
It works, but needs some tuning, especially the flight plan. But I had some glitches and strange behaviours and am looking forward to go home and check those in the telemetry file. I mean especially pwm inputs and outputs. So those are no more recorded? Could be useful for such a problem.

About Aero*, what do they show? Acceleration in cm/sec²? Seems strange as at start it is ~2000
What does mean AoL and Wing load (should be better called lift force as wing load(ing) is already standard for weight/surface?)?

Best regards,
Ric

Peter Hollands

unread,
Apr 12, 2016, 9:32:22 AM4/12/16
to uavdevb...@googlegroups.com
Hi Ric,

The .ods (Open Office / Libre Office) spreadsheet had many columns hidden. They were there; but hidden. That was because I wanted to show the Aero Force next to the Roll and Pitch data, so I hid fields in between these. The telemetry file is not reduced in terms of fields and data at all. It is larger than ever.

If you are using Master (Trunk), then please be advised that no one will have attempted to use the hover logic with the new Helical Turns controls. Bill will need to comment on whether he thinks that hover logic will even work now, or whether it needs revising.

You will find all the usual PWM input and outputs in the telemetry file.

Aero shows  the negative of (Gravity - acceleration). So when the plane is flat and level, and with a UDB you will see a value of -2000. The Z axis of the plane in UDB Coordinates is positive downwards. Gravity is positive downwards. The Aero Force is then negative. If the plane were to pull a 1 G turn on the wings the Aero Force Z field will become 0000. And then 2G turn would show as 2000, and 3G turn would show as 4000 for a UDB4. 

Best wishes, Pete






Reply all
Reply to author
Forward
0 new messages