6/4/15
We placed different types of light bulbs next to the receiver and recorded the various background radiations we would get from the lights. We are uncertain about the results but we may be able to use this information in the future when using the receiver on the telescope to account for possible sources of noise.
Thursday, June 4, 2015
Tuesday, June 2, 2015
Arduino Code
6/1/15
This code was taken from the internet and modified slightly to add angles.
//From bildr article: http://bildr.org/2012/08/rotary-encoder-arduino/
//these pins can not be changed 2/3 are special pins
int encoderPin1 = 2;
int encoderPin2 = 3;
int encoderSwitchPin = 4; //push button switch
float angle;
volatile int lastEncoded = 0;
volatile long encoderValue = 0;
long lastencoderValue = 0;
int lastMSB = 0;
int lastLSB = 0;
void setup() {
Serial.begin (9600);
pinMode(encoderPin1, INPUT);
pinMode(encoderPin2, INPUT);
pinMode(encoderSwitchPin, INPUT);
digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
digitalWrite(encoderPin2, HIGH); //turn pullup resistor on
digitalWrite(encoderSwitchPin, HIGH); //turn pullup resistor on
//call updateEncoder() when any high/low changed seen
//on interrupt 0 (pin 2), or interrupt 1 (pin 3)
attachInterrupt(0, updateEncoder, CHANGE);
attachInterrupt(1, updateEncoder, CHANGE);
}
void loop(){
//Do stuff here
if(digitalRead(encoderSwitchPin)){
//button is not being pushed
}else{
//button is being pushed
encoderValue=0;
}
angle=encoderValue*4.5;
Serial.print(encoderValue);
Serial.print(" ");
Serial.print("Angle=");
Serial.println(angle);
//delay(100); //just here to slow down the output, and show it will work even during a delay
}
void updateEncoder(){
int MSB = digitalRead(encoderPin1); //MSB = most significant bit
int LSB = digitalRead(encoderPin2); //LSB = least significant bit
int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number
int sum = (lastEncoded << 2) | encoded; //adding it to the previous encoded value
if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++;
if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --;
lastEncoded = encoded; //store this value for next time
}
This code was taken from the internet and modified slightly to add angles.
//From bildr article: http://bildr.org/2012/08/rotary-encoder-arduino/
//these pins can not be changed 2/3 are special pins
int encoderPin1 = 2;
int encoderPin2 = 3;
int encoderSwitchPin = 4; //push button switch
float angle;
volatile int lastEncoded = 0;
volatile long encoderValue = 0;
long lastencoderValue = 0;
int lastMSB = 0;
int lastLSB = 0;
void setup() {
Serial.begin (9600);
pinMode(encoderPin1, INPUT);
pinMode(encoderPin2, INPUT);
pinMode(encoderSwitchPin, INPUT);
digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
digitalWrite(encoderPin2, HIGH); //turn pullup resistor on
digitalWrite(encoderSwitchPin, HIGH); //turn pullup resistor on
//call updateEncoder() when any high/low changed seen
//on interrupt 0 (pin 2), or interrupt 1 (pin 3)
attachInterrupt(0, updateEncoder, CHANGE);
attachInterrupt(1, updateEncoder, CHANGE);
}
void loop(){
//Do stuff here
if(digitalRead(encoderSwitchPin)){
//button is not being pushed
}else{
//button is being pushed
encoderValue=0;
}
angle=encoderValue*4.5;
Serial.print(encoderValue);
Serial.print(" ");
Serial.print("Angle=");
Serial.println(angle);
//delay(100); //just here to slow down the output, and show it will work even during a delay
}
void updateEncoder(){
int MSB = digitalRead(encoderPin1); //MSB = most significant bit
int LSB = digitalRead(encoderPin2); //LSB = least significant bit
int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number
int sum = (lastEncoded << 2) | encoded; //adding it to the previous encoded value
if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++;
if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --;
lastEncoded = encoded; //store this value for next time
}
Motor Wiring
6/1/15
The brown wire for the motor is the power and corresponds with pin B. The paired black wire is the ground and corresponds with pin A.
6/2/15
Initial tests with the power supply and multimeter show that the wires are receiving voltage but the motor brake does not release at the required 90 volts.
The power supply produces too much current at 90 volts and thus we added a resistor in series with the motor. We need about 321 ohms to reduce the current properly so we put a 330 ohm resistor at the ground. The resistor was not powerful enough and met its demise fairly quickly. We need a higher wattage rating resistor.
After several attempts with a stronger resistor, the brake does not seem to be unlocking and it is possible that both the drive and brake need power in order to operate.
The drive socket requires an 18-5 (size-pin#) female socket to connect to. The product number on mouser.com is: 654-PT06A-18-5S.
The brown wire for the motor is the power and corresponds with pin B. The paired black wire is the ground and corresponds with pin A.
6/2/15
Initial tests with the power supply and multimeter show that the wires are receiving voltage but the motor brake does not release at the required 90 volts.
The power supply produces too much current at 90 volts and thus we added a resistor in series with the motor. We need about 321 ohms to reduce the current properly so we put a 330 ohm resistor at the ground. The resistor was not powerful enough and met its demise fairly quickly. We need a higher wattage rating resistor.
After several attempts with a stronger resistor, the brake does not seem to be unlocking and it is possible that both the drive and brake need power in order to operate.
The drive socket requires an 18-5 (size-pin#) female socket to connect to. The product number on mouser.com is: 654-PT06A-18-5S.
Motor Plate
5/29/15
Make sure the grooves we cut out are facing down, otherwise the holes will not line up. Screw in the bolt for the widened hole (the hole we drilled extra) last. This makes it easier to get them all in and screw them in.
Make sure the grooves we cut out are facing down, otherwise the holes will not line up. Screw in the bolt for the widened hole (the hole we drilled extra) last. This makes it easier to get them all in and screw them in.
Attaching The Worm Gear
5/29/15
Remove the green bars from the worm gear before attaching as they need to go around the triangle holder. Place the rod through the hole in the triangle holder and fasten the rotating rod at the base first. then secure the rod in the holder.
Remove the green bars from the worm gear before attaching as they need to go around the triangle holder. Place the rod through the hole in the triangle holder and fasten the rotating rod at the base first. then secure the rod in the holder.
Building The Triangle Base
5/20/15
We used high end marine grease to lubricate the vertices of the base. This allowed for the vertices to slide more easily and allowed us to align them with the proper holes. We found that it was better to loosen/remove two of the three struts on the center piece to better align the vertices and I-beams. We used allen wrenches and screwdrivers to pry at the holes and line up the vertices and I-beams.
We used high end marine grease to lubricate the vertices of the base. This allowed for the vertices to slide more easily and allowed us to align them with the proper holes. We found that it was better to loosen/remove two of the three struts on the center piece to better align the vertices and I-beams. We used allen wrenches and screwdrivers to pry at the holes and line up the vertices and I-beams.
Subscribe to:
Comments (Atom)