Who is online?
In total there are 21 users online :: 0 Registered, 0 Hidden and 21 Guests :: 1 Bot
None
Most users ever online was 180 on Tue Nov 05, 2019 6:03 am
Latest topics
Search
Most Viewed Topics
Statistics
Our users have posted a total of 12534 messages in 1992 subjects
We have 1021 registered users
The newest registered user is Mike Echo
Similar topics
4 posters
Flight controllers as sub levelers
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°51
Re: Flight controllers as sub levelers
well that was a fail, I started doing some basic tests but the barometer kept slowly moving indicating a leak, I gave it a coat of superglue but the leak remained. So I eventually just put the whole thing underwater to see where it was coming from, to my surprise the connector started bubbling. turns out the air was going though the wires insulation to the outside. so this time i have stripped it down and conformal coated the whole board apart from the sensor ports, this should also seal around the wires.
david f likes this post
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°52
Re: Flight controllers as sub levelers
david f likes this post
17b- Posts : 9
Join date : 2023-06-19
- Post n°53
Re: Flight controllers as sub levelers
Does it work now as expected?
geofrancis likes this post
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°54
Re: Flight controllers as sub levelers
17b wrote:Does it work now as expected?
I have been giving it some time for the glue to cure before I do any testing but it looks good when i give it a little pressure as its not changing over time. im going to try and get it installed in the sub and tested sometime this weekend. i still need to program the inav controller logic switches to operate the ballast pump. My plan is to have a 3 position switch that changes the output so it can switch between static and dynamic diving depth control, and I still need to install the depth sounder too.
david f and SimonH like this post
17b- Posts : 9
Join date : 2023-06-19
- Post n°55
Re: Flight controllers as sub levelers
Are you going to use telemetry as feedback?
geofrancis likes this post
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°56
Re: Flight controllers as sub levelers
17b wrote:Are you going to use telemetry as feedback?
yes im running a frsky r9 868mhz receiver with telemetry.
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°57
Re: Flight controllers as sub levelers
Its been a while since i had a look at this. there has been a lot of progress with Inav recently, one of the things is VTOL aircraft support. It doesnt sound like much but it makes working a submarine much simpler.
When you think about it a Submarine is basically a VTOL aircraft, it has control surfaces like a plane and a vertical lift system using ballast, what we want to do is to seamlessly go between the 2 modes. by setting it up as a VTOL with 2 different flight profiles we can transition between static and dynamic diving.
another advancement is in telemetry support, Inav and Betaflight use telemetry called MSP that wasn't supported by anything up to now, thats why I was still using the less than ideal frsky R9 system but now mLRS has full telemetry support im switching it over, this lets me change settings and get live telemetry while the boat is in the water. mLRS runs on ExpressLRS hardware. so it shares a lot of features. the main difference is express LRS is a high-speed RC system that can send telemetry, mLRS is a high-speed telemetry system that can send RC. 30hz vs 100hz for RC makes no difference for surface vehicles.
most of the parts have arrived so I want to get it tested soon.
When you think about it a Submarine is basically a VTOL aircraft, it has control surfaces like a plane and a vertical lift system using ballast, what we want to do is to seamlessly go between the 2 modes. by setting it up as a VTOL with 2 different flight profiles we can transition between static and dynamic diving.
another advancement is in telemetry support, Inav and Betaflight use telemetry called MSP that wasn't supported by anything up to now, thats why I was still using the less than ideal frsky R9 system but now mLRS has full telemetry support im switching it over, this lets me change settings and get live telemetry while the boat is in the water. mLRS runs on ExpressLRS hardware. so it shares a lot of features. the main difference is express LRS is a high-speed RC system that can send telemetry, mLRS is a high-speed telemetry system that can send RC. 30hz vs 100hz for RC makes no difference for surface vehicles.
most of the parts have arrived so I want to get it tested soon.
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°58
Re: Flight controllers as sub levelers
I have been thinking about what would be the best way to interface submarine sensors to the flight controller, hacking them over i2c isnt ideal so I have been looking at MSP telememtry as its the native protocal that Inav uses and it allows you to use MSP to send just about every sensor type over the serial link, so what i think is going to be the best approach is building a sensor interface with something like a ESP32 that can take water pressure, sonar depth, and water speed, scale them so sonar depth will match up with barometric sensor in water, and the speed sensor can be calibrated. with this setup it should just be a matter of connecting it to the flight controller and setting all the sensor types to MSP and it should fly underwater like a plane.
I have been looking at different ways to try and hold depth and I havent ruled any of them out yet.
the first is to set it up as a VTOL aircraft with the 2 ballast tanks setup as lift motors with the water jet pump for yaw when in static diving mode and when its in dynamic diving mode it would use the planes to hold its depth.
the second method is to use the inav Programmable logic switches to control the depth, I have a test version setup, its very simple to get working, one way is to use the depth to trigger high and low depth limits that runs the pump, another would be to try and use the difference between the requested depth and actual depth and vertical speed to scale the pump speed but that gets very complicated to do with just logic conditions.
the last way would be to just do it all on the arduino. essentially it would run a pid for depth, and get its inputs from the flight controller that would essentially always be in dynamic diving mode with the ballast tanks used to trim the planes level.
https://github.com/yajo10/MSP-Arduino
https://github.com/iNavFlight/inav/blob/master/src/main/msp/msp_protocol_v2_sensor_msg.h
I have a rough draft that compiles but its not been tested yet
I have been looking at different ways to try and hold depth and I havent ruled any of them out yet.
the first is to set it up as a VTOL aircraft with the 2 ballast tanks setup as lift motors with the water jet pump for yaw when in static diving mode and when its in dynamic diving mode it would use the planes to hold its depth.
the second method is to use the inav Programmable logic switches to control the depth, I have a test version setup, its very simple to get working, one way is to use the depth to trigger high and low depth limits that runs the pump, another would be to try and use the difference between the requested depth and actual depth and vertical speed to scale the pump speed but that gets very complicated to do with just logic conditions.
the last way would be to just do it all on the arduino. essentially it would run a pid for depth, and get its inputs from the flight controller that would essentially always be in dynamic diving mode with the ballast tanks used to trim the planes level.
https://github.com/yajo10/MSP-Arduino
https://github.com/iNavFlight/inav/blob/master/src/main/msp/msp_protocol_v2_sensor_msg.h
I have a rough draft that compiles but its not been tested yet
- Code:
#include <Wire.h>
#include <MSP.h>
#include "MS5611.h"
#include "ms4525do.h"
bfs::Ms4525do pres;
byte received;
float diffPressurePa;
int16_t temp;
int distances = 0;
int distance = 0;
unsigned char buffer_RTT[4] = { 0 };
uint8_t CS;
#define COM 0x55
int Distance = 0;
MSP msp;
MS5611 MS5611(0x77);
void setup() {
Serial.begin(115200);
Serial1.begin(115200);
Serial2.begin(115200);
msp.begin(Serial2);
Wire.begin(22, 23); // adjust ESP32 pins if needed
pres.Config(&Wire, 0x28, 1.0f, -1.0f);
}
void loop() {
MS5611.read();
Serial.print("T:\t");
Serial.print(MS5611.getTemperature(), 2);
Serial.print("\tP:\t");
Serial.print(MS5611.getPressure(), 2);
Serial.println();
Serial1.write(COM);
if (Serial1.available() > 0) {
delay(1000);
if (Serial1.read() == 0xff) {
buffer_RTT[0] = 0xff;
for (int i = 1; i < 4; i++) {
buffer_RTT[i] = Serial1.read();
}
CS = buffer_RTT[0] + buffer_RTT[1] + buffer_RTT[2];
if (buffer_RTT[3] == CS) {
distance = (buffer_RTT[1] << 8) + buffer_RTT[2];
distances = (distance / 10);
}
}
}
if (pres.Read()) {
Serial.print(pres.pres_pa(), 6);
Serial.print("\t");
Serial.print(pres.die_temp_c(), 6);
Serial.print("\n");
}
uint8_t sonarrange[] = { 255, distances };
uint8_t barorange[] = { 1, millis(), MS5611.getPressure(), (MS5611.getTemperature(), 2) };
uint8_t speed[] = { 1, millis(), pres.pres_pa(), pres.die_temp_c() };
msp.send(0x1F01, &sonarrange, sizeof(sonarrange));
msp.send(0x1F05, &barorange, sizeof(barorange));
msp.send(0x1F06, &speed, sizeof(speed));
}
david f likes this post
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°59
Re: Flight controllers as sub levelers
I forgot all about this, If i cant get my modified ms5611 sensor to work im going to order one of these, with the MSP adapter im not restrained to just the sensors supported by inav.
https://www.theassociationofmodelsubmariners.com/t1981-depth-sensor-lora-telemetry
https://www.theassociationofmodelsubmariners.com/t1981-depth-sensor-lora-telemetry
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°60
Re: Flight controllers as sub levelers
Marylandradiosailor likes this post
geofrancis- Posts : 323
Join date : 2021-09-24
- Post n°61
Re: Flight controllers as sub levelers
I have converted the adapter over to a ESP32S3, its as powerfull as a regular esp32 and the mini boards are pin compatible with the RP2040 zero so it will make it much easier to configure with the hull closed if it has wifi.
https://www.aliexpress.com/item/1005007274442944.html
https://www.aliexpress.com/item/1005007385048661.html
The code has been changed over to the MPRLS pressure sensor, I'm just waiting for it to arrive so I can start testing.
https://github.com/geofrancis/MSP_Submarine_Adapter/blob/main/sub_esp32s3_mprls/sub_esp32s3_mprls.ino
https://www.aliexpress.com/item/1005007274442944.html
https://www.aliexpress.com/item/1005007385048661.html
The code has been changed over to the MPRLS pressure sensor, I'm just waiting for it to arrive so I can start testing.
https://github.com/geofrancis/MSP_Submarine_Adapter/blob/main/sub_esp32s3_mprls/sub_esp32s3_mprls.ino
Tue Oct 29, 2024 4:46 pm by tsenecal
» RC Drift Gyro for pitch control
Sun Oct 20, 2024 2:04 pm by geofrancis
» WW2 mini sub build
Thu Oct 17, 2024 2:34 pm by geofrancis
» sonar data link
Mon Oct 14, 2024 4:31 pm by geofrancis
» Robbe Seawolf V2
Sat Oct 12, 2024 3:52 pm by geofrancis
» ExpressLRS - 868/915 Mhz equipment
Fri Oct 11, 2024 8:58 pm by Marylandradiosailor
» Flight controllers as sub levelers
Fri Oct 11, 2024 8:14 pm by geofrancis
» 868/915 Mhz as a viable frequency for submarines.
Thu Oct 10, 2024 3:21 am by tsenecal
» Microgyro pitch controller corrosion
Wed Oct 02, 2024 11:32 am by geofrancis