Fire Fighter Robot 「水陣」SUIJIN MK-1
by PROJECT SR in Circuits > Arduino
272 Views, 3 Favorites, 0 Comments
Fire Fighter Robot 「水陣」SUIJIN MK-1
I made Fire Extinguish Robot .
This Robot can move with teleoperation system.
This Robot system is used Arduino and XBee.
①Controller reads operation data which is joystick and button condition.
②Controller sends Receiver data of operation,
③Receiver gets data and send signal to actuator
I set Robot PV.
The movie link is here!
https://www.youtube.com/watch?v=1rKI0RFGbKo
Supplies
●Car body and Tank
Alminium frame
MDF boards
PVC board
Sprocket
Chain with attachment
●Pump
3Dprinter material
●Electric components
Arduino uno,mega
XBee
variable resistance
Electric circuit board
Bike battery
Motor Driver
Pololu24V21
MDD31A
Body Composition①
I show sinply robots architecture.
Body Composition②
Receiver module catch all data from controller and send signal or current to motor electric valve.
Body Composition②
Main Components are shown in ↑picture.
Tank
Tank material is made of PVC board.
Board is cut with CNC milling cutter and after that adhered reinforcing materials.
I used siicone sealant for prevent water leak.
Main Pump Outside
I show Main pump outside in first picture
I used metaric putty on pipe and pump for prevent water leak.
Second picture shows the connection pump and RS775motor.
Beam coupling is used.
Main Pump Intside
Pump type is volute pump.
Pump's intereller rotates and push water to exaust port along rotate direction.(Fig.①)
Housing , interpeller,cover is made with 3D printer.
Interpeller is fixed to alminuim shaft with bolt.
This shaft connects beam coupling,motor.
Pump Cover and bearing holder is set on shaft between beam coupling and interpeller.(Fig.②)
Cover and bearing holder has a hole for get through shaft.
I used PDU packing for prevent water leak. But, PDU packing material is rubber ,Friction occured Motor can't rotate.
So, I recommend to use gris . Gris can make friction lower and motor can rotate.(Fig.③)
When I put bearing to bearing holder, I used gulue. Purpose is prevent water leak and beaing off bearing holder.
Water Cannnon Plat Form
Fig.① is platform outside without nozzle.
Platform's X and Z axis can rotate and I set volume for preventig over rotation.(Fig.②)
Gear is set on motor,variable resistance,shaft. If motor rotate, variable resistance and shaft rotate.(Fig③ X-axis)
I wrote program code , If variable resistance angle will be set position, motor stop.
Z-axis is same architechture.(Fig.④~⑥)
Electric Circuit Receiver
↑This figure is receiver circuit.
Electric Circuit Controller
↑This figure is controller circuit.
Receiver Code and Flow
I set Receiver flow figure.
Controller and Receiver communicate with packet communication.
For receiver side arduino judging value or noise, I use packet communication.
Later date, I will packet communication article using arduino and XBee.
Receiver code is here
**************************************************
/*int PIN_OUT1=22;
int PIN_OUT2=23;
int PIN_OUT3=24;
int PIN_OUT4=25;//←メインモータの回転方向*/
int PIN_VREF4=4;
int PIN_VREF5=5;
int PIN_VREF6=6;
int PIN_VREF7=7;//←ここまで砲台モータ
int PIN_VREF2=2;
int PIN_VREF3=3;
int PIN_VREFD8=8;
int PIN_VREFD9=9;//←ここまでメインモータ
int PIN_SUITON=10;//←放水モータ
int PIN_solenoid=11;//電磁弁ONOFF
int PIN_SUITOND=12;//←放水モータ方向
int RcvData=0;
int RcvBuf[8];//配列数は送られてきたデータの数n カウント数はn-1
//int MT_Rin=5;
//int MT_Lin=6;
int MT_RoutSerial=0;
int MT_LoutSerial=0;
int MT_RoutSerial2=0;
int MT_LoutSerial2=0;
int MT_RSuboutSerial=0;
int MT_LSuboutSerial=0;
int i=0;
int RcvState=0;
//int RcvCountF=0;
//int RcvCountS=0;
int RcvC=0;
int MT1D=0;
int MT2D=0;
int MT1S=0;
int MT2S=0;
int RcvCount=0;
int SUITONvalue=0;
int analogupper;
int analoglower;
int VDataout1;
int VDataout2;
void setup() {
Serial.begin(9600); // 9600bpsでシリアルポートを開く
/*pinMode(PIN_OUT1,OUTPUT);
pinMode(PIN_OUT2,OUTPUT);
pinMode(PIN_OUT3,OUTPUT);
pinMode(PIN_OUT4,OUTPUT);*/
pinMode(PIN_VREF2,OUTPUT);
pinMode(PIN_VREF3,OUTPUT);
pinMode(PIN_VREF4,OUTPUT);
pinMode(PIN_VREF5,OUTPUT);
pinMode(PIN_VREF6,OUTPUT);
pinMode(PIN_VREF7,OUTPUT);
pinMode(PIN_VREFD8,OUTPUT);
pinMode(PIN_VREFD9,OUTPUT);
pinMode(PIN_SUITON,OUTPUT);
pinMode(PIN_solenoid,OUTPUT);
pinMode(PIN_SUITOND,OUTPUT);
}
void loop() {
while(Serial.available() > 0){
RcvData=Serial.read();
//Serial.println(RcvData);
//Serial.println(RcvState);
switch(RcvState){
case 0:
if(RcvData==255){
RcvState = 1;
//Serial.print("RcvData1");
//Serial.println(RcvState);
}
break;
case 1:
if(RcvData==255){
RcvState = 2;
//Serial.print(" RcvData2");
//Serial.println(RcvData);
}
else{
RcvState = 0;
}
break;
case 2:
RcvBuf[RcvCount]=RcvData;
RcvCount++;
if(RcvCount >=9){
RcvCount=0;
RcvState = 3;
//Serial.print(" RcvData*");
//Serial.println(RcvData);
}
break;
case 3:
MotorCnt();
RcvState=0;
break;
}
//Serial.print(" RcvCount*");
//Serial.println(RcvCount);
}
//Serial.print(" RcvData*");
//Serial.println(RcvData);
}
void MotorCnt(){
//モータ1の制御
//digitalWrite(13, HIGH );
//delay(100);
//digitalWrite(13, LOW );
//delay(100);
//digitalwriteが先でanalogWriteが後!!
analogupper = analogRead(A0);
VDataout1 = map(analogupper,0,1023,0,255);
analoglower = analogRead(A1);
VDataout2 = map(analoglower,0,1023,0,255);
if(RcvBuf[0]==0 || RcvBuf[0]==1){
if(RcvBuf[0] == 0){
MT_LoutSerial = RcvBuf[1];
//Serial.print("左前");
//Serial.print(MT_LoutSerial);
digitalWrite(PIN_VREFD8,HIGH);
analogWrite(PIN_VREF2,MT_LoutSerial);
}
else{
MT_LoutSerial = RcvBuf[1];
//Serial.print("左後");
//Serial.print(MT_LoutSerial);
digitalWrite(PIN_VREFD8,LOW);
analogWrite(PIN_VREF2,MT_LoutSerial);
}
if(RcvBuf[2] == 0){
MT_RoutSerial = RcvBuf[3];
//Serial.print("右前");
//Serial.println(MT_RoutSerial);
digitalWrite(PIN_VREFD9,HIGH);
analogWrite(13,MT_RoutSerial);
}
else{
MT_RoutSerial = RcvBuf[3];
//Serial.print("右後");
//Serial.println(MT_RoutSerial);
digitalWrite(PIN_VREFD9,LOW);
analogWrite(13,MT_RoutSerial);
}
}
else{//MT_RoutSerial2とLoutSerial2は回転方向表示用変数 また,回転速度の表示を行うと,ジョイスティックが中立になっても,受信側の値が0にならないので,analogwrite(PWM出力)の値は強制的に0にしている
//MT_RoutSerial2 = RcvBuf[0];
//MT_LoutSerial2 = RcvBuf[2];
//Serial.print("停止 ");
//Serial.print("左回転方向");
//Serial.print(MT_LoutSerial2);
//Serial.print("右回転方向");
//Serial.print(MT_RoutSerial2);
//Serial.print("回転速度");
//Serial.print(MT_LoutSerial);
//Serial.print(" ");
//Serial.println(MT_RoutSerial);
digitalWrite(PIN_VREFD8,LOW);
digitalWrite(PIN_VREFD9,LOW);
analogWrite(PIN_VREF2,0);
analogWrite(PIN_VREF3,0);
}
if(RcvBuf[4]==0 || RcvBuf[4]==1){
if(RcvBuf[4] == 0){//ここから配列 ボタン入力の処理を描いてゆく
if(VDataout1<170){
analogWrite(PIN_VREF4,50);
analogWrite(PIN_VREF5,0);
Serial.print("砲座X");
Serial.println(1);
}
else{ //角度が大きければ停止
analogWrite(PIN_VREF4,0);
analogWrite(PIN_VREF5,0);
Serial.print("砲座X");
Serial.println(2);
}
}
else if(RcvBuf[4] == 1){
if(VDataout1>50){
analogWrite(PIN_VREF4,0);
analogWrite(PIN_VREF5,50);
Serial.print("砲座X");
Serial.println(3);
}
else{ //角度が大きければ停止
analogWrite(PIN_VREF4,0);
analogWrite(PIN_VREF5,0);
Serial.print("砲座X");
Serial.println(4);
}
}
}
else{ //ボタンが押されていないので停止
analogWrite(PIN_VREF6,0);
analogWrite(PIN_VREF7,0);
Serial.print("砲座X");
Serial.println(5);
}
if(RcvBuf[5]==0 || RcvBuf[5]==1){
if(RcvBuf[5] == 0){
if(VDataout2<190){
analogWrite(PIN_VREF6,70);
analogWrite(PIN_VREF7,0);
Serial.print("砲座Z");
Serial.println(1);
}
else{
analogWrite(PIN_VREF6,0);
analogWrite(PIN_VREF7,0);
Serial.print("砲座Z");
Serial.println(2);
}
}
else if(RcvBuf[5] == 1){
if(VDataout2<30){
analogWrite(PIN_VREF6,0);
analogWrite(PIN_VREF7,70);
Serial.print("砲座Z");
Serial.println(3);
}
else{
analogWrite(PIN_VREF6,0);
analogWrite(PIN_VREF7,0);
Serial.print("砲座Z");
Serial.println(4);
}
}
}
else{
analogWrite(PIN_VREF6,0);
analogWrite(PIN_VREF7,0);
Serial.print("砲座Z");
Serial.println(5);
}
if(RcvBuf[6] == 1){
SUITONvalue = RcvBuf[7];
digitalWrite(PIN_SUITOND,HIGH);
analogWrite(PIN_SUITON,SUITONvalue);
digitalWrite(PIN_solenoid,HIGH);
}
else{
SUITONvalue = 0;
digitalWrite(PIN_SUITOND,HIGH);
analogWrite(PIN_SUITON,0);
digitalWrite(PIN_solenoid,LOW);
}
Serial.print("可変抵抗⇓");
Serial.println(VDataout2);
delay(100);
}
I set controler flow figure.
Controller code is here
**************************************************
int SendBuf[8];
int i;
int HDatain,VDatain,HDataout,VDataout,SUITONin,SUITONout;
int button2 =2;
int button3 =3;
int button4 =4;
int button5 =5;
int button6 =6;
int DirR;
int DirL;
int SUITON_under_R_read;
int SUITON_under_L_read;
int SUITON_top_U_read;
int SUITON_top_D_read;
int SUITONDirup_out;
int SUITONDirunder_out;
int Duty1,Duty2,Duty3;
int SubSolenoid_read;
int SubSolenoid_out;
int countn=0;
int solenoidout=0;
int SUINTONin ;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(button2,INPUT);
pinMode(button3,INPUT);
pinMode(button4,INPUT);
pinMode(button5,INPUT);
pinMode(button6,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
VDatain = analogRead(A0);
VDataout = map(VDatain,0,1023,0,220);
HDatain = analogRead(A1);
HDataout = map(HDatain,0,1023,0,220);
SUITONin = analogRead(A5);
SUITONout = map(SUITONin,0,1023,0,255);
SUITON_under_R_read = digitalRead(button2);
SUITON_under_L_read = digitalRead(button3);
SUITON_top_U_read = digitalRead(button4);
SUITON_top_D_read = digitalRead(button5);
SubSolenoid_read = digitalRead(button6);
//前進後退
if(VDataout>120){
if(HDataout>140){
DirL = 0;
DirR = 0;
Duty1 =VDataout;
Duty2 =HDataout;
}
else if(140>=HDataout && 100<HDataout){
DirL = 0;
DirR = 0;
Duty1 =(VDataout-110)*2;
Duty2 =(VDataout-110)*2;
}
else{
DirL = 0;
DirR = 0;
Duty1 =(200-HDataout);
Duty2 =VDataout;
}
}
else if(VDataout<=120 && VDataout>=95){
if(HDataout>110){
DirL = 1;
DirR = 0;
Duty1 =(HDataout-115)*2;
Duty2 =(HDataout-115)*2;
}
else if(HDataout<110){
DirL = 0;
DirR = 1;
Duty1 =(108-HDataout)*2;
Duty2 =(108-HDataout)*2;
}
else{
DirL = 2;
DirR = 2;
Duty1 =0;
Duty2 =0;
}
}
else{
if(HDataout>150){
DirL = 1;
DirR = 1;
Duty1 =(HDataout-120)*2;
Duty2 =(120-VDataout)*2;
}
else if(150>=HDataout && HDataout>100){
DirL = 1;
DirR = 1;
Duty1 =(120-VDataout)*2;//(110-VDataout)*2
Duty2 =(120-VDataout)*2;//(110-VDataout)*2
}
else{
DirL = 2;
DirR = 2;
Duty1 =(120-HDataout)*2;
Duty2 =(120-VDataout)*2;
}
}
if(SUITON_under_R_read==LOW || SUITON_under_L_read==LOW){ //砲台下側左右
if(SUITON_under_R_read==LOW){
SUITONDirunder_out=1;
}
else{
SUITONDirunder_out=0;
}
}
else{
SUITONDirunder_out=2;
}
if(SUITON_top_U_read==LOW || SUITON_top_D_read==LOW){ //砲台上側上下
if(SUITONDirup_out==LOW){
SUITONDirup_out=1;
}
else{
SUITONDirup_out=0;
}
}
else{
SUITONDirup_out=2;
}
//for無限ループからのbreakで脱出
if (SubSolenoid_read==HIGH) {
solenoidout=0;
}
else{
solenoidout=1;
}
//SendBuf[0] = 0xFF;
//SendBuf[1] = 0xFF;
SendBuf[0] = DirL;
SendBuf[1] = Duty1;
SendBuf[2] = DirR;
SendBuf[3] = Duty2;
SendBuf[4] = SUITONDirunder_out;
SendBuf[5] = SUITONDirup_out;
SendBuf[6] = solenoidout;
SendBuf[7] = SUITONout;
//SendBuf[4] = 0;
Serial.write(255);
Serial.write(255);
//Serial.print(255);
//Serial.println(255);
for(i=0;i<8;i++){
//Serial.println(SendBuf[i]);
Serial.write(SendBuf[i]);
}
Serial.write(0);
//Serial.println(0);
//Serial.print("VDataout");
//Serial.println(VDataout);
//Serial.print("HDataout");
//Serial.println(HDataout);
//Serial.println(SubSolenoid_read);
delay(200);
}
Finish
In this time, I wrote article first time on Autdesk instructables.
I think that there are some poor explanation or part.
If you have a question, please tell me.
My response speed is low , but I want to improve as possible.