Tuesday, November 15, 2011

Final project parts have mostly arrived

Most of your stuff is in, I think we're only waiting on the multiplying chip, which should arrive on Tuesday. Here are some details about what I've got ...


1) I received a package of 160 assorted LEDs, and 3 of the 9x14 arrays. Some assembly is required:
I have been soldering for some time now ... but I should have at least one of them ready to go by Wednesday's class. The 9x14 array plugs right into the Arduino board, then you can program it to display what you like.

2) The stepper motors are in. Stepper motors use what is called pulse width modulation, and are controlled by a digital output pin (they also require a +5V power and GND connection). The motor expects a pulse every 20ms, and the width of this pulse encodes the speed and direction. For these particular motors, a pulse width of 1.5ms is "zero", and positive and negative deviations from that correspond to higher CW and CCW rotation speeds. For example, a 2.0ms pulse width is maximum CW rotation, and 1.0ms pulse width maximum CCW rotation. Here is some simple and quickly hacked-together code which illustrates two different controls: first start at maximum speed in one direction, gradually slow down, and then speed up in the other direction; then, at fixed speed (1.75ms pulse width), move through one full rotation (52 steps):

//simple code to control a parallax continuous rotation stepper motor
int servo1 = 7, i=0;
int myAngle1;
int pulseWidth1;
void servoPulse1 (int servo1, int myAngle1) { //1.5 ms at 20ms intervals.
  pulseWidth1 = (myAngle1 ) + 1500; // Converts angle to microseconds
 
  digitalWrite(servo1, HIGH); // Set servo high (turns it on)
  delayMicroseconds(pulseWidth1); // Wait a very very small amount
  digitalWrite(servo1, LOW); // Set servo low (turns it off)
 
  delay(20); //  Refresh cycle of servo (20 ms)
}
void setup() {
  pinMode(servo1, OUTPUT);
}
void loop() {
 
  for (myAngle1=-500; myAngle1<=500; myAngle1++) {  //fast in one dir; slow down, reverse, speed up
    servoPulse1(servo1, myAngle1);
  }
 
  delay(1000);
 
  myAngle1=250;  //set a meduim speed in one direction
 
  for (i=0; i<52; i++)   {           //now just move some pulses in one direction at fixed speed
    servoPulse1(servo1,myAngle1);    //seems to be ***52*** pulses per rotation
  }
 
  delay(1000);
}
With the Arduino boards you have, it is no problem to control several stepper motors. Working from this code, you should be able to figure out how to control the motors nicely.

3) I found an old Commodore joystick I made in college, as well as some third party Commodore/Atari joysticks. Yes, I have such things just lying around my garage, and I really did make my own joystick for fun ...

4) I have an Etch-a-Sketch we can use, but it is in tough shape. I'll get a better one, but we have at least something to start with.

5) I have a transistor-based Colpitts oscillator completed and in a project box to use as a either the fixed or variable oscillator for a Theremin. It is a design I fiddled with over the summer that has somewhat improved frequency stability over the basic Colpitts design, probably it is better for the reference oscillator. Here's a schematic, which I can explain when we're in the lab next:


No comments:

Post a Comment