MultiWii Sensors

Post Reply
ammarali
Posts: 8
Joined: Fri Feb 20, 2015 11:35 pm

MultiWii Sensors

Post by ammarali »

Hi Guys I am a new user and I want to know if i can use the sensors mounted on the MultiWii and send their readings to a ground station to use these readings and use them.
I dont want to use the GUI or the PID code already uploaded.
Thanks

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: MultiWii Sensors

Post by QuadBow »

Solution 1: a configurable telemetry system like FRSKY and send all relevant data to your transmitter module.
For this you need a MEGA flight controller and receiver / transmitter from the FRSKY telemetry edition.
Solution 2: send the multiwii protocol on serial0 via bluetooth to your PC or smartphone and write an own app to use those data.
For this a small p328 based flight controller is sufficiant and you don't need a specialised receiver / transmitter system.
But, the range is quite limited.

So, you should clarify in more detail what you want to do.

ammarali
Posts: 8
Joined: Fri Feb 20, 2015 11:35 pm

Re: MultiWii Sensors

Post by ammarali »

QuadBow wrote:Solution 1: a configurable telemetry system like FRSKY and send all relevant data to your transmitter module.
For this you need a MEGA flight controller and receiver / transmitter from the FRSKY telemetry edition.
Solution 2: send the multiwii protocol on serial0 via bluetooth to your PC or smartphone and write an own app to use those data.
For this a small p328 based flight controller is sufficiant and you don't need a specialised receiver / transmitter system.
But, the range is quite limited.

So, you should clarify in more detail what you want to do.


I want to make my own control theory and gui interface so i need the readings of the gyro , acc mounted on the multiwii to have a feedback in my controller

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: MultiWii Sensors

Post by QuadBow »

ammarali wrote:I want to make my own control theory and gui interface so i need the readings of the gyro , acc mounted on the multiwii to have a feedback in my controller
That's nice to hear, but leaves still many questions open.
Do you want to control a copter or do you only need the sensor data?
Will the sensor be separated from the ground station?
Do you want to control the copter via your PC?
What equipment do you already have?
Are you familiar with processing?
Are you familiar with Arduino programming?
Consider that there is a significant amount of work to be done for your plans.

ammarali
Posts: 8
Joined: Fri Feb 20, 2015 11:35 pm

Re: MultiWii Sensors

Post by ammarali »

QuadBow wrote:
ammarali wrote:I want to make my own control theory and gui interface so i need the readings of the gyro , acc mounted on the multiwii to have a feedback in my controller
That's nice to hear, but leaves still many questions open.
Do you want to control a copter or do you only need the sensor data?
Will the sensor be separated from the ground station?
Do you want to control the copter via your PC?
What equipment do you already have?
Are you familiar with processing?
Are you familiar with Arduino programming?
Consider that there is a significant amount of work to be done for your plans.


I am familiar with arduino programming and already i have made a lot of work just trying different sensors and i would like to upload my own control on the multiwii and i need to know what functions or code that can make me get the readings of the sensors the next step will be sending this data to the pc using bluetooth module but first i want to know how to extract the readings and if it is possible to upload my own code on the multiwii

Lecostarius
Posts: 46
Joined: Mon Oct 20, 2014 11:29 pm

Re: MultiWii Sensors

Post by Lecostarius »

Maybe you want to take a look into the datalogging for Crius AIOP v2 that I posted elsewhere in this forum. I set out to do exactly the same that you did - analyze in detail the control loop behaviour and how the PID works. I am now logging all the relevant sensor values every MultiWii cycle - so essentially everything - to the dataflash, and after landing, I read the log to the PC and analyze it using Matlab. If you use my code, you do not have to modify anything, as there is a PID_FINE logging scheme which you can use (which I implemented just for that purpose). Only drawback, the code is only for the Crius AIOP v2 FC.
If you do not want to do that, you might consider EZ-GUI which does datalogging over the bluetooth connection. The author is very responsive and might even introduce logging events that you need to it. For that, and for any other bluetooth data link, I recommend using the Bluetooth Mate Gold board. Its expensive (EUR 50) but rock solid both from hardware and software side. Also it offers class 1 which you will need. Having said that, I played with BT connections a bit and they sometimes get lost (probably on the smartphone/tablet side), so not good for mission critical things, but OK for datalogging.
I would be interested in your findings (and also willing to share my own log files with you, so you can get something to work/play with). PM me.

Cheers, Leco

ammarali
Posts: 8
Joined: Fri Feb 20, 2015 11:35 pm

Re: MultiWii Sensors

Post by ammarali »

Lecostarius wrote:Maybe you want to take a look into the datalogging for Crius AIOP v2 that I posted elsewhere in this forum. I set out to do exactly the same that you did - analyze in detail the control loop behaviour and how the PID works. I am now logging all the relevant sensor values every MultiWii cycle - so essentially everything - to the dataflash, and after landing, I read the log to the PC and analyze it using Matlab. If you use my code, you do not have to modify anything, as there is a PID_FINE logging scheme which you can use (which I implemented just for that purpose). Only drawback, the code is only for the Crius AIOP v2 FC.
If you do not want to do that, you might consider EZ-GUI which does datalogging over the bluetooth connection. The author is very responsive and might even introduce logging events that you need to it. For that, and for any other bluetooth data link, I recommend using the Bluetooth Mate Gold board. Its expensive (EUR 50) but rock solid both from hardware and software side. Also it offers class 1 which you will need. Having said that, I played with BT connections a bit and they sometimes get lost (probably on the smartphone/tablet side), so not good for mission critical things, but OK for datalogging.
I would be interested in your findings (and also willing to share my own log files with you, so you can get something to work/play with). PM me.

Cheers, Leco


Check your PM

ammarali
Posts: 8
Joined: Fri Feb 20, 2015 11:35 pm

Re: MultiWii Sensors

Post by ammarali »

I want the sensors reading in order to implement a non linear based control on the multiwii and replace the Pid

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: MultiWii Sensors

Post by QuadBow »

ammarali wrote:I am familiar with arduino programming and already i have made a lot of work just trying different sensors and i would like to upload my own control on the multiwii and i need to know what functions or code that can make me get the readings of the sensors the next step will be sending this data to the pc using bluetooth module but first i want to know how to extract the readings and if it is possible to upload my own code on the multiwii

In this case a short look into imu.cpp should have revealed that there are functions like Gyro_getADC() and ACC_getADC() which read the related sensors.
However, as I have already mentioned, you also get those data via serial0, since multiwii streams those data permanently. That data stream is analysed and used by multiwiiconf. The structure of this stream is the multiwii protocol defined in protocol.cpp. So, you can connect your FC to your PC via bluetooth and you have already all related sensor data.
ammarali wrote:I want the sensors reading in order to implement a non linear based control on the multiwii and replace the Pid

And that should be done at the ground station? That would not have been my recommendation. What if the short ranging bluetooth connection is being disturbed or interrupted? What you could do is to change the PID values during the flight. The control remains at the flight controller and you even don't have to change the multiwii protocol. Of course, there is the risk that your flight controller will reach an unstable state.

ammarali
Posts: 8
Joined: Fri Feb 20, 2015 11:35 pm

Re: MultiWii Sensors

Post by ammarali »

QuadBow wrote:
ammarali wrote:I am familiar with arduino programming and already i have made a lot of work just trying different sensors and i would like to upload my own control on the multiwii and i need to know what functions or code that can make me get the readings of the sensors the next step will be sending this data to the pc using bluetooth module but first i want to know how to extract the readings and if it is possible to upload my own code on the multiwii

In this case a short look into imu.cpp should have revealed that there are functions like Gyro_getADC() and ACC_getADC() which read the related sensors.
However, as I have already mentioned, you also get those data via serial0, since multiwii streams those data permanently. That data stream is analysed and used by multiwiiconf. The structure of this stream is the multiwii protocol defined in protocol.cpp. So, you can connect your FC to your PC via bluetooth and you have already all related sensor data.
ammarali wrote:I want the sensors reading in order to implement a non linear based control on the multiwii and replace the Pid

And that should be done at the ground station? That would have been my recommendation. What if the short ranging bluetooth connection is being disturbed or interrupted? What you could do is to change the PID values during the flight. The control remains at the flight controller and you even don't have to change the multiwii protocol.


the functions Gyro_getADC() and ACC_getADC() are predefined in the muliwii ?
bluetooth connection is short ranged but will be good for indoor test flights however if i am able to get the readings using the mentioned functions it would be easy to tramit the data to a ground station using a network which is already done all i need is know if these functions are pre defined in the multiwii and if you have any link that shows how to transfer the data through serial0

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: MultiWii Sensors

Post by QuadBow »

ammarali wrote:the functions Gyro_getADC() and ACC_getADC() are predefined in the muliwii ?

Those functions are implemented in the file sensors.cpp. Why haven't you already looked into the source code?

ammarali wrote: if you have any link that shows how to transfer the data through serial0

A short google search after multiwii protocol reveals at the first place http://www.multiwii.com/wiki/index.php?title=Multiwii_Serial_Protocol

Lecostarius
Posts: 46
Joined: Mon Oct 20, 2014 11:29 pm

Re: MultiWii Sensors

Post by Lecostarius »

Hi Ammarali,

I just checked and the log file for a 65 second flight has 10 MByte (in human-readable ASCII) or 520 kByte as Matlab .mat file, so I can post neither of them here. PM me your email and I will send it to you.

BTW, which hardware do you have?

Cheers, Leco

Post Reply