Is there anyone out there who is using arduino with their subs? I am busy learning how to use it and I am a bit overwhelmed with the options. Diving routines, depth keeping, etc.
Arduino
Collapse
X
-
Tags: None
-
Re: Arduino
Terrific. It is early days for me but I have ordered a water pressure gauge and am thinking of linking tit to my piston, plus having diving and surfacing automated routines. The stuff is so inexpensive, and the quality of the relays is magic!
Comment
-
Re: Arduino
Hi Folks:
Some Years ago I began to learn Arduino. In my Ictineo II I developped some programs to do some things:
- the inner light candles
- automatic deep controller
- automatic levelling
- lost signal radio failsafe
- safe control of machinery in deep navigation
- supervision of batteries, pressure air compressed
- adjust servo run angle
- modification of run electronic speed controller
My book where I learned is the "O'Reilly's Arduino Cookbook". Is very good to explain since the beginning all about Arduino and all around it, sensors, etc is very cheep and easy to understand.
Best regards
Pedro Gómez
Comment
-
Re: Arduino
a little late coming back to this, but i just wanted to add, that this is where i got my code for reading the PWM signal from the receiver. this guy has done all the heavy lifting, and is a good reference site in general.
http://rcarduino.blogspot.com/2012/01/h ... -with.html
http://rcarduino.blogspot.com/2012/01/h ... th_25.html
http://rcarduino.blogspot.com/2012/04/h ... draft.html
however, a "next project" that i am investigating the feasibility of has me looking at offloading the servo control to secondary drivers...
The Pololu micro serial servo controller (SSC) is a very compact solution for controlling up to eight RC servos from a computer or microcontroller. Each se
and
You want to make a cool robot, maybe a hexapod walker, or maybe just a piece of art with a lot of moving parts. Or maybe you want to drive a lot of LEDs with precise PWM output. Then you ...
who doesn't want to figure out a way to drive 64 servos with an 8 channel radio?
Comment
-
Re: Arduino
Hi all..
Finally back from overseas. I have come a long way with my project but would love to have access to your sketches Pedro. My sketch so far gives me full control of the superb 8 x relay block (Arduino) and now I have designed a dive routine and surface routine which functions from double clicking the TX stick. Next is the failsafe so am very interested in what you have.
Problem. I have an old ADC1 from subtech for depth keeping that has finally died. So I pulled the senor out of it and it only reads into the arduino 'suction,' not positive pressure. I literally mean if I plug it in and analogue read the output of the sensor and suck a tube attached to the sensor it reads nicely, but not if I blow.
So I purchased another one MPX5100ap and it does the same thing. So the ADC1 must somehow overcome this. Does anyone have a lead on a sensor that will do the trick, or a way to overcome the problem. i note recommendation on these pages for mpxaz4115a. Is that the way to go? I would like to put the depth keeping management into the arduino.
Any help would be appreciated!
John
Comment
-
Re: Arduino
Hi John:
Fist at all, said that I am not an expert or Arduino microprocessor, because I have little time working in, but that I design in a simple way, it works. Reading the post, I see there are more and better ways of doing things, made without using pulseIn, for example, but at my current level of knowledge for me, seems complicated to me.
The sketch failsafe does, is read the function pulseIn in any receiver channel. (See pulseIn Ardino). What I do is to avoid false radio signal lost, I work with an average value of the signal, 4 readings taken. Signal loss is identified clearly connecting the receiver to arduino, and seeing what happens in the IDE to turn off the radio. The value displayed by the IDE is the value of signal loss and is to be taken to implement the "if" function to act on elements to emergency surface (compressed air valve open, start pump ....). I enclose a sketch.
#include <Average.h>// para la funcion failsafe losssignalradio, calculo del valor medio.
#define CNT 4 // numero de valores de los cuales extraer el valor medio.
int estado_S_I = 2;// entrada digital para recibir la señal, HIGH es superficie, LOW inmersion. Viene del rele S_I a entrada 2.
int ch2 = A5;// canal para la lectura de la señal por pulseIn. Entrada en A5 desde ch2 de Rx.
int Media;// variable para identificacion del valor medio.
int mch2[CNT];// array de lecturas del ch2, matriz de (4,1), para calculo del valor medio, definido en “#â€.
int emergencysurface = 10; // salida digital para apertura emergency blow ballast.
void setup()
{
Serial.begin(9600);// **inactivar en modo operativo
pinMode(2,INPUT);
pinMode(A5, INPUT); // es indistinto emplear un I/O digital o analogico PWM, lectura de pulseIn para losssignalradio
pinMode(10,OUTPUT);
}
void loop()
{
//
// Perdida de señal de radio en inmersion.
//
ch2 = pulseIn(A5, HIGH); // variable local para lectura pulseIn por A5 (19).
Serial.print("Channel_2] = pulseIn(A5, HIGH);
}
Media = mean(mch2,CNT),DEC;
Serial.print("media:");
Serial.println(Media);
int sumergido = digitalRead (estado_S_I);
if ((Media < 950) && (sumergido == HIGH)) // failsafe losssignalradio con filtro (valor medio) que limite los espureos mayores de 969 y situacion de inmersion logica combinada "AND".
{
digitalWrite (emergencysurface,HIGH); // abre la de emergencia hasta recuperar. Soplado temporizado.
delay(2000);// duracion del suceso en el bucle de 2 segundos
digitalWrite (emergencysurface,LOW);
}
The depth control run, reading outside pressure, that is proportional to the depth, with a Motorola MPX5050 sensor. At this signal I apply PID program, from the Arduino library, and adjust the values Kp Ki and Kd, Direct and Reverse, so that the response to the peristaltic pump is smooth. Search the Arduino PID library. I enclose a sketch.
#include <PID_v1.h>
#include <Servo.h>
double deepperiscope = 0.38; // “setpoint†del programa pres-mV para 0.2m
//double deephalfmeter = 0.65; // “setpoint†del programa pres-mV para 0.5m
//double deeponemeter = 1.1; // “setpoint†del programa pres-mV para 1.0m
//&input,&output,&setpoint
double presion = A0; // sensor MPX5050GP “input†de proa
double deep;// variable para el “setpointâ€
double output;
char Direction;
PID myPID(&presion, &output, &deep,60,30,0,Direction); // identifica los parametros del PID Kp=60, Ki=30 & Kd=0
Servo ESC;
int actuador;
void setup()
{
Serial.begin(9600); //
pinMode(A0, INPUT); // sensor MPX5050GP
myPID.SetMode(AUTOMATIC); // pone en marcha el PID
myPID.SetOutputLimits(0.0,10.0);
myPID.SetSampleTime(50);//50ms
ESC.attach(3);
}
void loop()
{
presion = analogRead(A0)*5.0/1023;//lectura analogica de presion, en continuo, en mV
deep = deepperiscope; // selecciona el setpoint
if (presion > deep)
{
myPID.SetControllerDirection(REVERSE);
myPID.Compute(); // salida al ESC
output = output * -1;
}
if (presion <= deep)
{
myPID.SetControllerDirection(DIRECT);
myPID.Compute(); // salida al ESC
output = output * 1;
}
Serial.print("presion:");// **inactivar en modo operativo.
Serial.println(presion);//**inactivar en modo operativo.
Serial.print("Ir a Profundidad:");// **inactivar en modo operativo.
Serial.println(deep);//**inactivar en modo operativo.
Serial.print("PID:");// **inactivar en modo operativo.
Serial.println(output);//**inactivar en modo operativo.
actuador = map(output,-10,10,1000,2000);//mapeo a microseconds para actuacion fina peristaltica por ESC:1000ms2000ms
ESC.writeMicroseconds(actuador);
Serial.print("ESC:");// **inactivar en modo operativo.
Serial.println(actuador);//**inactivar en modo operativo.
delay(2000); //no inactivar en modo operativo
}
I too want to know what you've mounted your submarine with Arduino, routine immersion and control relays, if I can apply to mine.
I hope we can help in this complex world of Arduino, not being experts.
Comment
-
Re: Arduino
Thanks so much for this. Very nice to has some well written material to work from.
Cheers
John
Comment
-
Re: Arduino
Hi
I have finally received the right sensor. It is MPXV7007G! It works perfectly. At 1 bar it sits at 511. Sucking it goes down and as if by magic, and four unusable sensors later, it goes up. Surface pressure is 570-511, and periscope depth is about 670.
I got this by emailing a sensor company and finally someone talked to me. Told them the problem and oila.
So it's onward and upward now. Would anyone like to buy some sensors?
John
Comment
Comment