payload 2013 class 26

48
Payload 2013 Class 26 By Jeff Dunker

Upload: sarila

Post on 22-Feb-2016

89 views

Category:

Documents


0 download

DESCRIPTION

Payload 2013 Class 26. By Jeff Dunker. CRASH Launch Site Opportunity. Payload build. Today. Next Class. CRASH Launch Site Opportunity. Reality check Dry run of presentation And demo of payload. Fit Check. Launch. Our Status. I have scheduled 7/17 and 7/18 as our reality check day - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Payload 2013 Class 26

Payload 2013Class 26

By Jeff Dunker

Page 2: Payload 2013 Class 26

Payload build

CRASH Launch Site Opportunity

Next Class

Today

Page 3: Payload 2013 Class 26

Launch

CRASH Launch Site Opportunity

Fit Check

Reality checkDry run of presentationAnd demo of payload

Page 4: Payload 2013 Class 26

Our Status• I have scheduled 7/17 and 7/18 as our reality check day

– First it would best if all team members are present to assist the other teams with observations and comments, We’ll do Team 1 & 2 on 7/17 and teams 3 & 4 on 7/18.

– I want all teams to do a dry run presentation of the Fit Check day chart Remember takes 3 -5 minutes no longer, I’ll time you

– I want walk through demonstration if possible of the working payload in full glory, this is being done deliberately to surface any short comings. Hardware design on paper or computer drawing, software review .

• Make rough for “Fit check presentation day chart” get to Mr. Feight• Identify Sequence of events for your payloads processing use state diagrams

write it down make sure all members have a copy and understand it, have it ready for the above review

• Get example S/W working for each sensor• Step by step integrate the sensors into the sequencer• Start looking at build orientation of parts

Page 5: Payload 2013 Class 26

Fit check day presentation

• How are you doing on this presentation? Have you come up with anymore bullet items to discuss other than my suggested starting point?– Tell them the payload name– Your goals– How you are planning to obtain those goals.

Page 6: Payload 2013 Class 26

Design’s so far• This attempts to show all the various sensors and effectors from all the teams.

Some like the Mini and Nano are on just to show size. The GPS is not the Venus but just GPS shield.

• Under the GPS shield I have the Micro SD shield• I try to show that the Mini needs a USB connection and an off board Micro SD,

and 3.3 voltage regulator• The other item is the LiPo battery boost is shown only.• The battery should be a 9 – 12 Volt not the two 1.5 AA shown.• The resistors are not all 220 in fact most are 10K• But with all that said it does show a fair amount correctly, the layout is random

IE not planned and why it is so messy.• Plus I did all the connections mostly from memory so if you use this double

check me, especially the power connections. Always before applying power to your board

Payload1234.fzz

Page 7: Payload 2013 Class 26
Page 8: Payload 2013 Class 26

Team 3• Greg offered to increase the kick off charge if you want• Use 3D printer to make the balloon to He tank adapter• One tank of party balloon He basically filled the

balloon as we saw it last time. Not much was left so you’ll need multiple tanks

• See if we can increase beyond the party balloon tank pressure in our payload

• Need to still work the 140 F temperature rise issue in the rocket too. IE test our mockup in an oven maybe!

• Need to lock down the Amp-Hour demand so we can size the batteries

Page 9: Payload 2013 Class 26

Team 3• Tough decisions time - Need to cut weight to maximize lift. • What are the absolute bare basics for the payload?• Buoyant

– Only a balloon• Means no data not avionics etc , Kind of boring like the army men one

– Buoyant but no control, floats away, probably lose it. • No data unless RF data with XBEE and they are costly of it. Need good ground recording

too!– If we plan no recovery then what would be different?

• Do pay the cost of a RF data link, what data is worth sending?

• New Idea– What if we burst the balloon to stop the ascent and then use a parachute to

return? • Easy to do a piece of nichrome wire taped to the exterior will burst it by flowing

current/heat. Could put parachute inside the balloon

• Not buoyant – Then we want to be slower than a parachutes decent to demonstrate some

success

Page 10: Payload 2013 Class 26
Page 11: Payload 2013 Class 26

The Sensors Hardware and I/F software with the Arduino

• Led - Use one digital output• I2C - Wire library, Uses two analog inputs 4 & 5• ADXL345 – Uses I2C unique address, and setup• BMP085 - Uses I2C unique address, and setup• Camera – ?? I recommend dropping off the list due to weight

concerns• GPS -?? I recommend dropping off the list due to weight

concerns• RHT03 humidity -• SD card – uses D10• RF Beacon on/off control

Page 12: Payload 2013 Class 26

The Mounting• Arduino – same as before• Power switch – same as before• Battery – boost card for single cell LiPo battery• The LED – same as before• The Accelerometer – same as before• Barometer and cover – same as before• Humidity sensor – same as before• RF beacon – uses one digital line• Valves – uses one digital line each• Camera??• GPS??

Page 13: Payload 2013 Class 26

When using single cell LiPo batteries

• You need a boost circuit• Don’t forget a way to easily charge them

• If using a multi cell Li battery such as the RC type the voltage boost may be left out but you still need the easy means to charge and maybe verify a good charge on the batteries

Page 14: Payload 2013 Class 26

Spark Fun Solenoid Valve

• We can control everything with just one valve– It is open when we fill and vent it, rest of the time we

have it closed, means we need to externally operate it or communicate to the Arduino to open it when we fill it

• Their valve is too large and heavier than we want.– I’ll look into making one now. I have smaller solenoids

and DC motors too.– I’ll see if the aquarium air valves could be used

• Do you have any ideas?

Page 15: Payload 2013 Class 26

Valve/Solenoid• A solenoid is a basically an electro magnetic, in which we allow

the core to be moved by the magnetic field generate by the flow of current. Remember our DEMO. So this device now converts an electronic signal to physical motion.

• The solenoid motion can be totally contained in a package like with a solenoid valve.

• The problem for us is simple apply a voltage to the solenoid to activate it when desired

• The solenoid does require us to protect the micro controller. 1. They can draw more current that a micro processor can provide

and thus ruin the controller.2. They are inductors or coils and when the power is removed the

magnetic field persist afterwards and collapses generating a reverse voltage spike that can destroy a micro processor and other devices if not handled properly

Page 16: Payload 2013 Class 26

The electronics for driving the solenoid

Two circuits to drive a Solenoid the main difference is that the MOSFET circuit canhandle a much higher current than the bipolar one. So it is a function of how much Current your solenoid needs. The diode across the coil is needed to handle the reversevoltage caused when the magnetic field collapses

This will work just fineFor the Beacon

This will work for the valves

Beacon

Page 17: Payload 2013 Class 26

Beacon status

• I have the parts now, and am starting to build it. Two design approaches. Does anyone wish to join me on this effort?– Rebuild original, requires making some coils and

matching component attributes (on both approaches)– Modify original circuit and use 555 chip to do the

modulation part, leave RF output stage same• I have three walkie talkies that we can use to track

it. Two good ones but will need slight modification to make more portable.

Page 18: Payload 2013 Class 26

Value & Beacon control/* Power on_off control Turns on a digital port controlling a Bi-polar transitor or a FET */

void setup() { // Pin 4 has the In-let Valve On/Off// Pin 5 has the Vent Valve On/Off// Pin 6 has the Beacon On/OFF pinMode(4, OUTPUT);} pinMode(5, OUTPUT);} pinMode(6, OUTPUT);}

void loop() { digitalWrite(4, HIGH); // set the in-let value on delay(1000); // wait for a second digitalWrite(4, LOW); // set the in-let valve off delay(1000); // wait for a second digitalWrite(5, HIGH); // set the vent value on delay(1000); // wait for a second digitalWrite(5, LOW); // set the ventvalve off delay(1000); // wait for a second digitalWrite(6, HIGH); // set the beacon power on delay(1000); // wait for a second digitalWrite(6, LOW); // set the beacon power off delay(1000); // wait for a second}

Page 19: Payload 2013 Class 26

Humidity RHT03//Function : Transmit RH & Temp. Data via PC interface , Baud rate 9600 //Connection : P2.0 connected with DHT sensor

#include <reg51.h>#include <intrins.h> //typedef unsigned char U8; /* defined for unsigned 8-bits integer variable */typedef signed char S8; /* defined for signed 8-bits integer variable */typedef unsigned int U16; /* defined for unsigned 16-bits integer variable */typedef signed int S16; /* defined for signed 16-bits integer variable */typedef unsigned long U32; /* defined for unsigned 32-bits integer variable */typedef signed long S32; /* defined for signed 32-bits integer variable */typedef float F32; /* single precision floating point variable (32bits) */typedef double F64; /* double precision floating point variable (64bits) *///#define uchar unsigned char#define uint unsigned int#define Data_0_time 4

Page 20: Payload 2013 Class 26

Humidity RHT03//----------------------------------------------////----------------Definition for IO interface--------------------////----------------------------------------------//sbit P2_0 = P2^0 ;sbit P2_1 = P2^1 ;sbit P2_2 = P2^2 ;sbit P2_3 = P2^3 ;//----------------------------------------------////----------------Definition zone--------------------////----------------------------------------------//U8 U8FLAG,k;U8 U8count,U8temp;U8 U8T_data_H,U8T_data_L,U8RH_data_H,U8RH_data_L,U8checkdata;U8 U8T_data_H_temp,U8T_data_L_temp,U8RH_data_H_temp,U8RH_data_L_temp,U8checkdata_temp;U8 U8comdata;U8 outdata[5]; U8 indata[5];U8 count, count_r=0;U8 str[5]={"RS232"};U16 U16temp1,U16temp2;

Page 21: Payload 2013 Class 26

Humidity RHT03SendData(U8 *a){

outdata[0] = a[0]; outdata[1] = a[1];outdata[2] = a[2];outdata[3] = a[3];outdata[4] = a[4];count = 1;SBUF=outdata[0];

}

void Delay(U16 j) { U8 i;

for(;j>0;j--) {

for(i=0;i<27;i++);

} }

Page 22: Payload 2013 Class 26

Humidity RHT03void Delay_10us(void) { U8 i; i--; i--; i--; i--; i--; i--; }

void COM(void) {

U8 i; for(i=0;i<8;i++)

{

U8FLAG=2;

Page 23: Payload 2013 Class 26

Humidity RHT03 while((!P2_0)&&U8FLAG++);

Delay_10us();Delay_10us();Delay_10us();

U8temp=0; if(P2_0)U8temp=1;

U8FLAG=2; while((P2_0)&&U8FLAG++);

if(U8FLAG==1)break;

U8comdata<<=1;

U8comdata|=U8temp; //0 }//rof }

Page 24: Payload 2013 Class 26

Humidity RHT03//-----Sub-program for reading %RH ------------//----All the variable bellow is global variable--------//----Temperature's high 8bit== U8T_data_H------//----Temperature's low 8bit== U8T_data_L------//----Humidity's high 8bit== U8RH_data_H-----//----Humidity's low 8bit== U8RH_data_L-----//----Check-sum 8bit == U8checkdata-----

void RH(void){

P2_0=0; Delay(5); P2_0=1; Delay_10us(); Delay_10us(); Delay_10us(); Delay_10us(); P2_0=1;

Page 25: Payload 2013 Class 26

Humidity RHT03 if(!P2_0) { U8FLAG=2; while((!P2_0)&&U8FLAG++); U8FLAG=2; while((P2_0)&&U8FLAG++); COM(); U8RH_data_H_temp=U8comdata; COM(); U8RH_data_L_temp=U8comdata; COM(); U8T_data_H_temp=U8comdata; COM(); U8T_data_L_temp=U8comdata; COM(); U8checkdata_temp=U8comdata; P2_0=1;

Page 26: Payload 2013 Class 26

Humidity RHT03 U8temp=(U8T_data_H_temp+U8T_data_L_temp+U8RH_data_H_temp+U8RH_data_L_temp); if(U8temp==U8checkdata_temp) { U8RH_data_H=U8RH_data_H_temp; U8RH_data_L=U8RH_data_L_temp;

U8T_data_H=U8T_data_H_temp; U8T_data_L=U8T_data_L_temp; U8checkdata=U8checkdata_temp; }//fi }//fi

}

Page 27: Payload 2013 Class 26

Humidity RHT03//----------------------------------------------// main()//----------------------------------------------void main(){

U8 i,j;

TMOD = 0x20; TH1 = 253; TL1 = 253;TR1 = 1; SCON = 0x50; ES = 1;EA = 1; TI = 0;RI = 0;SendData(str) ; Delay(1); while(1){

Page 28: Payload 2013 Class 26

Humidity RHT03 RH(); //--------------------------

str[0]=U8RH_data_H; str[1]=U8RH_data_L; str[2]=U8T_data_H; str[3]=U8T_data_L; str[4]=U8checkdata; SendData(str) ;

Delay(20000);}//elihw

}// main

Page 29: Payload 2013 Class 26

Humidity RHT03void RSINTR() interrupt 4 using 2{

U8 InPut3;if(TI==1) {

TI=0;if(count!=5) {

SBUF= outdata[count];count++;

}}

if(RI==1) {

InPut3=SBUF;indata[count_r]=InPut3;count_r++;RI=0;

Page 30: Payload 2013 Class 26

Humidity RHT03if (count_r==5){

count_r=0;str[0]=indata[0]; str[1]=indata[1]; str[2]=indata[2];

str[3]=indata[3]; str[4]=indata[4]; P0=0;

}}

}

Page 31: Payload 2013 Class 26

Team 4• Greg has offered to delay your ejection if you like until after the

main chute is deployed to minimize your environment for the glider

• Need glider mockup or actual to know if we can lifted the planned payload. And control it too. Need to start doing experiments with it.

• I can try to boost it with a kite and then let it drop since CRASH is closed due to fire danger– Start simple straight glide with dummy weights– Then add avionics to do simple circle down pattern– Etc

• Need to lock down the Amp-Hour demand so we can size the batteries

Page 32: Payload 2013 Class 26
Page 33: Payload 2013 Class 26

The Sensors Hardware and I/F software with the Arduino

• I2C - Wire library, Uses two analog inputs 4 & 5• ADXL345 – Uses I2C unique address, and setup• Compass HML5823L - Uses I2C unique address, and

setup• Horizontal kick out switch - uses digital output• SD card – uses D10 varies by maker• Camera - ??• Venus GPS – Softserial and d10 & d11 may need to de

conflict with SD card• Servo – Linear regulator uses digital output

Page 34: Payload 2013 Class 26

Horizontal Switch Normally Open

22

22

Button.fzz

Fritzing Example

+5v

10K

Page 35: Payload 2013 Class 26

Horizontal Switch Normally Closed

2 7

27

2

2

The source code for this: You’ll find is in:Files, Examples, 1. Digital as Button, NOTE: code is written for Figures 3.2 or 3.4 notice the opposite happens depending on which button type you have

10K

Page 36: Payload 2013 Class 26

Software Digital Switch and turn LED on/off

/* Button Turns on and off a light emitting diode(LED) connected to digital pin 13, when pressing a pushbutton attached to pin 2. The circuit: * LED attached from pin 13 to ground * pushbutton attached to pin 2 from +5V * 10K resistor attached to pin 2 from ground or VCC depend on which button type and action * Note: on most Arduinos there is already an LED on the board attached to pin 13. created 2005 by DojoDave <http://www.0j0.org> modified 28 Oct 2010 by Tom Igoe, 3/1/13 by Jeff Dunker This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Button*/// constants won't change. They're used here to set pin numbers:const int buttonPin = 2; // the number of the pushbutton pinconst int ledPin = 13; // the number of the LED pin

// variables will change:int buttonState = 0; // variable for reading the pushbutton status

Page 37: Payload 2013 Class 26

void setup() { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); }void loop(){ // read the state of the pushbutton value: buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed. // if it is, the buttonState is HIGH: if (buttonState == HIGH) { // turn LED on: digitalWrite(ledPin, HIGH); } else { // turn LED off: digitalWrite(ledPin, LOW); }}

Page 38: Payload 2013 Class 26

Compass connections

Magentometer.fzz

Page 39: Payload 2013 Class 26

Compass/*An Arduino code example for interfacing with the HMC5883

by: Jordan McConnell SparkFun Electronics created on: 6/30/11 license: OSHW 1.0, http://freedomdefined.org/OSHW

Analog input 4 I2C SDAAnalog input 5 I2C SCL*/

#include <Wire.h> //I2C Arduino Library

#define address 0x1E //0011110b, I2C 7bit address of HMC5883

void setup(){ //Initialize Serial and I2C communications Serial.begin(9600); Wire.begin(); //Put the HMC5883 IC into the correct operating mode Wire.beginTransmission(address); //open communication with HMC5883 Wire.send(0x02); //select mode register Wire.send(0x00); //continuous measurement mode Wire.endTransmission();}

Page 40: Payload 2013 Class 26

Compassvoid loop(){ int x,y,z; //triple axis data

//Tell the HMC5883 where to begin reading data Wire.beginTransmission(address); Wire.send(0x03); //select register 3, X MSB register Wire.endTransmission(); //Read data from each axis, 2 registers per axis Wire.requestFrom(address, 6); if(6<=Wire.available()){ x = Wire.receive()<<8; //X msb x |= Wire.receive(); //X lsb z = Wire.receive()<<8; //Z msb z |= Wire.receive(); //Z lsb y = Wire.receive()<<8; //Y msb y |= Wire.receive(); //Y lsb }

Page 41: Payload 2013 Class 26

Compass

//Print out values of each axis Serial.print("x: "); Serial.print(x); Serial.print(" y: "); Serial.print(y); Serial.print(" z: "); Serial.println(z); delay(250);}

Page 42: Payload 2013 Class 26

GPS connections

• Power and RX TX

Page 43: Payload 2013 Class 26

Venus GPS

#include <SoftwareSerial.h>

SoftwareSerial gpsSerial(10, 11); // RX, TX (TX not used)const int sentenceSize = 80;

char sentence[sentenceSize];

void setup(){ Serial.begin(9600); gpsSerial.begin(9600);}

Page 44: Payload 2013 Class 26

Venus GPSvoid loop(){ static int i = 0; if (gpsSerial.available()) { char ch = gpsSerial.read(); if (ch != '\n' && i < sentenceSize) { sentence[i] = ch; i++; } else { sentence[i] = '\0'; i = 0; displayGPS(); } }}

Page 45: Payload 2013 Class 26

Venus GPSvoid displayGPS(){ char field[20]; getField(field, 0); if (strcmp(field, "$GPRMC") == 0) { Serial.print("Lat: "); getField(field, 3); // number Serial.print(field); getField(field, 4); // N/S Serial.print(field); Serial.print(" Long: "); getField(field, 5); // number Serial.print(field); getField(field, 6); // E/W Serial.println(field); }}

Page 46: Payload 2013 Class 26

Venus GPSvoid getField(char* buffer, int index){ int sentencePos = 0; int fieldPos = 0; int commaCount = 0; while (sentencePos < sentenceSize) { if (sentence[sentencePos] == ',') { commaCount ++; sentencePos ++; } if (commaCount == index) { buffer[fieldPos] = sentence[sentencePos]; fieldPos ++; } sentencePos ++; } buffer[fieldPos] = '\0';}

Page 47: Payload 2013 Class 26

The Mounting

• Arduino – • Power switch – same as before• Battery – • The Accelerometer – same as before• Compass –• GPS and antenna• Servo regulator and glider• Horizontal switch

Page 48: Payload 2013 Class 26

Break point

• Where do milk shakes come from?• From nervous cows

• What do you get when you cross a car with a sandwich?

• A traffic jam

• Where is Dracula's American office?• The Vampire State Building