koenkooi / multiwii-firmware

Firmware - GitHub mirror of the official SVN multiwii project
https://github.com/multiwii/multiwii-firmware/wiki
13 stars 1 forks source link

General discussion #4

Open koenkooi opened 10 years ago

koenkooi commented 10 years ago

Let's put generic discussion not related to reported issues here.

koenkooi commented 10 years ago

I noticed https://github.com/multiwii/multiwii-gui-processing and I have it running on my laptop after installing the Processing IDE and the controlP5 lib. It looks like a good tool to help showing the impact of changes we make.

koenkooi commented 10 years ago

Romain, do you have a hex or quad flexbot? The current code is configured for the hex version.

gromain commented 10 years ago

Hex one, that's why I started with the Hex version! On Apr 18, 2014 2:00 PM, "Koen Kooi" notifications@github.com wrote:

Romain, do you have a hex or quad flexbot? The current code is configured for the hex version.

— Reply to this email directly or view it on GitHubhttps://github.com/koenkooi/multiwii-firmware/issues/4#issuecomment-40803965 .

gromain commented 10 years ago

The gui works well with my copter. It's quite a nice way to test for the changes.

Romain Bazile.

2014-04-18 14:21 GMT+02:00 Romain BAZILE gromain.baz@gmail.com:

Hex one, that's why I started with the Hex version! On Apr 18, 2014 2:00 PM, "Koen Kooi" notifications@github.com wrote:

Romain, do you have a hex or quad flexbot? The current code is configured for the hex version.

— Reply to this email directly or view it on GitHubhttps://github.com/koenkooi/multiwii-firmware/issues/4#issuecomment-40803965 .

koenkooi commented 10 years ago

the 'pruts' branch works quite well on my quad and hex, time to clean it up and show it to the world :)

Arne-W commented 10 years ago

I think the "pruts" is much better than the original FW. After retuning all PIDs my Hex is flying much better. Especally the baro mode is much better but you can spend a lot of time tuning the values.

Arne-W commented 10 years ago

A BIG feature could be if it were possible to monitor some data within the Android App. Configuring the PIDs is very difficult if you cannot see what a special PID is doing. 4 Values should be enough for monitoring P-, I- , D- term and PID-Sum. It would be possible to see if anythig starts oscillating during flight. For me it would be enough if there is an expert mode for this feature. I would simply transmit the 4 debug Values to the android app making it possible to store everything you want int this varialbles by patching the Code. The values should only be transmitted when the differ from 0. So this feature wont use Bandwith if no debug is configured.

koenkooi commented 10 years ago

There might be problems with the bi-directional mode: https://github.com/HexAirbot/HexNanoController_iOS/issues/3

I've ordered a few different BLE adapters (USB and serial) to get bi-directional mode and https://github.com/treymarc/multiwii-mavlink-gc working, but there are still in transit.

Arne-W commented 10 years ago

Great that would be a full featured telemetry system. Please keep me informed about your progress.

ah- commented 10 years ago

Hi, has anybody managed to get the headfree mode to work? How did you do?

koenkooi commented 10 years ago

headfree needs a working magnetometer, the one of the board doesn't work after turning on the power, it's too close of the VCC trace. You can see the effect in multiwiiconf: the heading vector will always return to it's original position after rotating it.

koenkooi commented 10 years ago

I've squashed some commits in the 'pruts' branch together and regrouped them and pushed them to the 'integration' branch. They are currently identical, but 'pruts', as the (dutch) name implies, will see more tinkering in the future.

Arne-W commented 10 years ago

Does someone know which baudrate the bluetooth module on the copter uses? I can not find intialisation of the serial port and the configuration of the bluetooth module in the multiwii code. The Android code transmits 14 dataframes a second (every 71 ms) which is not really fast. Perhaps its possible to increase the rate making the communication more robust is case of a transmission failure.

koenkooi commented 10 years ago

Either 9600 or 115200 baud. The bottle neck is the BLE part, have a look at the README here: https://github.com/HexAirbot/FlexBLE

Only small packets can be sent and only a few of them per second. When my BLE adapter arrives I'll try to find out the exact rate, but it's called low energy for a reason...

Arne-W commented 10 years ago

The technical spec in Wikipedia say BLE has an Application throughput of 0.27 Mbits which is a LOT more than 14 packets with 11 bytes per second and two times faster than the 115200 baud. If I send 50 packets with 11 bytes -> 550bytes per sec -> round about 5500 bits/sec should be possible. Even if the serial port is only 9600 baud!!

I Tried to set the rate to 20 and it works.... but I dont know if there is a sideeffect.

koenkooi commented 10 years ago

The mailman dropped off the Redbear BLE mini today, let's see if I can get that to talk to the flexbot in the upcoming long weekend

Arne-W commented 10 years ago

Yesterday evening I tried to increase the number of dataframes sent by the Android code. Monitoring the rcSerialCount value I found out that it seems to have no effect if more than 30 packets per second are sent. Nevertheless I tried flying with a rate of 50 Packages per second. If the copter was in a range of 1 -1,5 meters all worked perfect. But at longer distances (2 - 5 meters) the latency was so big that the copter became unflyable. As soon as I reduced the distance it got better again. Reducing the number of packages to 30 per second reduced the latency effect but did not eleminate it. At the moment I am using 20 frames but have not tested enough to be sure it works. Anyone have an idea whats the reason for this behaviour???

Arne-W commented 10 years ago

Check https://github.com/exxamalte/HexNanoController_Android. It seems he patched the Android code to fetch telemetry data from the copter. I have not tested by now but you should take a look!!

Arne-W commented 10 years ago

Now I have tested the latest changes from exxamalte - there is a little bug that needs to be fixed but if its done it works very good. Malte did a good job.

Arne-W commented 10 years ago

Take a look at the config https://github.com/koenkooi/multiwii-firmware/blob/flexbot-quad/config.h#L509. There is the definition of a low pass filter for the MPU Gyro. I changed the settings from "#define MPU6050_LPF_98HZ" to " #define MPU6050_LPF_42HZ" and I think the copter is flying much smoother. You should try it. And by the way in https://github.com/koenkooi/multiwii-firmware/blob/flexbot-quad/config.h#L225 the PID controller is set to type 1. I tested the type 2 Controller (the experimental one) and after compete retuning of all PIDs the copters behaviour in Angle mode is better. Even flying outside with some wind seems to be no problem - quite stable - its worth testing

PS: I feel a little bit like a soliloquiser ... ;-)

koenkooi commented 10 years ago

42Hz is indeed much better. How did you tune the PIDs?

Arne-W commented 10 years ago

I found a document describing a tuning procedure - took me about 20 battery charges... I dont know the URL at the moment - I 'm at work :-) But I will send you this evening. If you want you can have my last settings for PID-Controller 1 and for PID-Controller 2. I also patched the Android app with Maltes Telemetry system, stopwatch and a new button for changing aux1. So you can configure aux1 to the flightmode and you are able to switch mode while flying. Furthermore the app provides hover on throttle release in normal mode (not beginner) with throttle deadband. So if you release the throttle joystick hover mode is turned on and a deadband is enabled so you can use the yaw feature without disabling hover mode. As soon as you leave the throttle deadband the Phone vibrates and disables the hover mode.