Tuesday, April 29, 2014
MOSFETS and the Arduino for High Voltage PWM
There are 3 pins, 1 for ground, drain, and source. Schematically the setup can be explained easily. Notice in the schematic that the 1 pin looks as though it could press down and allow current to flow between 2 and 3. This is exactly how the MOSFET works. It is a lot like a thrysistor. Notice the little Zener diode at the bottom? For those not familiar with schematics it is the Triangle with a 3 line segments on one point.
- The Servos being used have chips inside them which can execute programs when no PWM is detected for a sufficient time span. However the robot is sent commands via a CS(Control System) using a USB to Arduino protocol which then sends pwm on the digital 9 pin(keep this in mind, only certain pins can handle pwm, there are actually only 8 on the Arduino Uno which is the board of choice).
- The voltage for power was too low but this was boosted with a simple parallel circuit solution, we will replace an op amp.
- The PWM is not reaching the Servos(it is only 5V and the current of the Arduino pins).
Friday, April 25, 2014
Thursday, April 24, 2014
Arduino with sensor and ec probe controlled via Python on rpi
//C and C++ code for Arduino
#include <Servo.h>
float Count;
float Voltage;
float SensorReading;
int TimeBetweenReadings = 500; // in ms
int ReadingNumber=0;
float Time;
char Sensor[]="Hand Dynamometer";
float Intercept = -19.295;
float Slope = 175.416;
Servo myservo; // create servo object to control a servo
Servo claw; // a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
int b=0;
int posit=0; //var for storing claw position
void setup(){
Serial.begin(9600); //initialize serial communication at 9600 baud
Serial.println("Vernier Format 2");
Serial.print(Sensor);
Serial.print(" ");
Serial.println("Readings taken using Ardunio");
Serial.println("Data Set");
Serial.print("Time");
Serial.print("\t"); //tab character
Serial.println ("EC"); //change to match sensor
Serial.print("seconds");
Serial.print("\t"); // tab character
Serial.println ("μS"); //change to match sensor
myservo.attach(8);
claw.attach(7); // the servo on pin 7
}
void loop(){
Serial.print(ReadingNumber/1000.0*TimeBetweenReadings);
Count = analogRead(A0);
Voltage = Count / 1024 * 5.0;// convert from count to raw voltage
SensorReading= Intercept + Voltage * Slope;
Serial.print("\t"); // tab character
Serial.println(SensorReading);
delay(TimeBetweenReadings);// delay in between reads for stability
ReadingNumber++;
if(Serial.available()>0){
b=Serial.read();
serial.print("Data Received System functional");
if (b="4") {
for(pos = 0; pos < 360; pos += 1)
{
myservo.write(pos);
delay(15); }
}
if (b="6") {
for(pos = 0; pos < 360; pos += 1)
{
myservo.write(pos);
delay(15); }
}
if (b="2") {
for(pos = 0; pos < 360; pos += 1)
{
claw.write(posit);
delay(15); }
}
if (b="6") {
for(pos = 0; pos < 360; pos += 1)
{
claw.write(posit);
delay(15); }
}
##script to send keystrokes to arduino
import sys
import serial
Cereal=serial.Serial('/dev/AMCY0/',9600);
while 1:
print(Cereal.readline());
char = sys.stdin.read(1)
Tuesday, April 22, 2014
Monday, April 21, 2014
The Ph~F rift/ripht
Photograph, fotografia, φωτογραφία(fotografia for you Latin alphabet lovers),Foto...
European languages are said to have only a few indoeuropean ancestors, except for distinct local flavors such as basque. If this is true, the differences in the use of the allmorphs f and pH are striking. If one geographically maps the use of the allomorphs it is clear that various nations utilize different morphemes regardless of regions.
The two languages which have come to dominate Europe and the world in terms of root graphemes and phonemes are Latin and Greek. The Latin word for photograph is literally photograph, while the Greek version( when written in the Latin alphabet) is fotografia, just as it is in Spanish.
//add theory
This selection theory explains the cause of the difference in Fn language generations where n is greater than 1(meaning after the parent langisges , Latin or Greek) but it does not explain why Greek and Latin had such different philosophies(filosofias or philosofiam) regarding the glyphs.
Logically,oral language almost always precedes its Lexigraphical equivalent. This is why oral languages such as Navajo or Navaho exist without a written counterpart, but there are no known major languages which are written and have no oral equivalent. Therefore ph~f rift must have occured early on long before any later event such as the East-West schism of 1054 could have so divided the Latin and Greek worlds.
The Greek alphabet weighs in at a low 23 letters(letters in the traditional sense of English-Cryllic alphabet species) whileiys Latin also came in at 23 during the classical period.
Greek came before Latin, naturally it may have less features, and would integrate less languages( although now its monoculturizing towards English) with less lexiconic isomers such as ph and f.
Saturday, April 19, 2014
Novel Smoothing Algorithm:Morley Pinturia Naturaleza Muerta Smoothing Algorithm(Cluster Bomb Smoothing)
PImage img; int a, b,r,u;This sets up the image variable and the 4 vars we will be using.
void setup() { size(500, 500); img = loadImage("cat.jpg"); a = 1; b = 1; r=img.width; u=0; imageMode(CENTER); noStroke(); background(0); }Loading the image and setting up our variables. a & b are for rect sides or in terms of the above image they are the size of the white pieces.
void draw() { float pixel = map(11, 0, width, a, b); //creating pixel variable int x = int((img.width)-r); // sets the x pt equal to image width minus the
//size of the r val which paints the image int y= int(u);//u as the y val due, tis necessary due to language syntax color pix = img.get(x, y);//captures pixel color fill(pix, 128);//color,alphamask
rect(x-1, y, pixel, pixel); rect(x+1, y, pixel, pixel); rect(x, y-1, pixel, pixel); rect(x, y+1, pixel, pixel);//these rect lines create our Cells diagram r=r-1;//moves painting along the x axis println(r);//outputs current pos Now there must be an if statement in order to move along the y axis once a row is completed:
if(r==1000){ r=img.width; u=u+1; } } And so the symphony all together:
PImage img; int a, b,r,u; void setup() { size(500, 500); img = loadImage("cat.jpg"); a = 1; b = 1; r=img.width; u=0; imageMode(CENTER); noStroke(); background(0); } void draw() { float pixel = map(11, 0, width, a, b); int x = int((img.width)-r); int y= int(u); color pix = img.get(x, y); fill(pix, 128); rect(x-1, y, pixel, pixel); rect(x+1, y, pixel, pixel); rect(x, y-1, pixel, pixel); rect(x, y+1, pixel, pixel); r=r-1; println(r); if(r==1000){ r=img.width; u=u+1; } }
Statistically Viable Time Based Smoothing and Deconvolution Algorithm
Algorithm for image smoothing
PImage img; int a, b,z,u; void setup() { size(1000, 900); img = loadImage("sun.png"); a = 1; b = 1; z=img.width; u=0; imageMode(CENTER); noStroke(); background(255); } void draw() { float pixel = map(11, 0, width, a, b); int x = int(random(img.width)); int y = int(random(img.height)); color pix = img.get(x, y); fill(pix, 128); rect(x-1, y, pixel, pixel); rect(x+1, y, pixel, pixel); rect(x, y-1, pixel, pixel); rect(x, y+1, pixel, pixel); rect(x, y, pixel, pixel); }