Thursday, January 29, 2015

Cutting Resistors with a Robot - Meet Vincent V

We cut resistors, A LOT of resistors. Over the last 3 weeks, I have built Vincent V, a robotic resistor cutter.

We call him V for short.
Construction
I used 8mm steel plate for the body and cutter assembly. The resistor drive plate is a 5mm toothed belt on Aluminium Pulleys (Aluminum for the Americans). This is driven by a NEMA 17 stepper motor. The resistors are held down on the belt by an Acrylic top plate, and springs. The cutter is a guillotine using the 8mm plate, fround by hand to 80' for sharpness and longevity. It slides in a keyway, and is operated by a 15mm stroke pneumatic cylinder. Air at 100psi is directed to the cylinder by the servo valve.




Control
The brain behind the control is an Arduino Uno R3.
The stepper motor is driven by an L298N H Bridge
The servo valve is switched using an IRFZ510 Mosfet
The software is still being worked on, but I couldn't wait any longer to give it a go.
For testing we used the stepper motor software on this blog, and added a command to take pin13 HIGH when we needed a cut.

Next Steps
Over the coming weeks I will be tidying up the build, A dedicated Power Supply, an LCD screen, and selector buttons, along with some better code.

If you would like to know more, just ask!


Wednesday, January 21, 2015

The Blandford Radio Build

Huge Thanks to +Andy Blandford for the pictures of his radio build,
made in a "radio" biscuit tin, using our FM radio kit

Andy says
 "I was inspired to buy this kit by a radio design biscuit tin I was given at Christmas. I just finished building the radio and mounting it into the tin rather than the cardboard case provided. I have never soldered a PCB before and found the instruction book combined with the video brilliant. The radio played first time and sounds really good. Thanks Andrew Mallinson."



Great job Andy!
here is the original
and the Build Instructions



Stepper Motor, L298N and Arduino

We are driving a bi-polar stepper motor from an Arduino. To get enough current, we have interfaced an L298N H bridge



Wiring 
straight forward,I just used jumper wires for this.

Stepper Motor wires PairA to L298N Out1 and Out2,
Stepper Motor wires PairB to L298N Out3 and Out4
(how to find pairs at the bottom of this post)

Connect Arduino Pins 8,9,10,11 and GND -to-
L298N In1,In2,In3,In4, and GND

L298N is connected to a 12vdc Power supply
Arduino connected to the PC via USB



Arduino Code (cut and paste)

// Highlight from HERE

///This is a simple sketch to allow the Arduino to control
// a bi-polar stepper motor

// By Andrew Mallinson 
// Mallinson-electrical.com
// The Arduino is hooked up to a L798N H bridge
// This allows higher voltage and current to be applied to
// the stepper motor, without damaging the Arduino
//
//
// Define the Arduino pins
int RED = 8; // L298N  In1
int YELLOW = 9;//L298N In2
int GREEN = 10;//L298N In3
int BLACK = 11;//L298N In4

// Define some variables
int d = 3; //define delay - adjust this to give smooth running, lower number = higher speed
int s = 200;//steps per rev of stepper
float fwd = 1.5; // number of revs forward required - {Can be any number or increment of 0.02
float rvs = 3.0; // number of revs reverse required - {sequences are 4 steps, 50x 4 steps = 1 rev, so 4 steps=0.02 revs

void setup()
{
  pinMode(RED,OUTPUT); // set the pins to be giving signal not receiving
  pinMode(YELLOW,OUTPUT);
  pinMode(GREEN,OUTPUT);
  pinMode(BLACK,OUTPUT);
 
}
// There are four different steps, because there are 4 permutations of the poles on a bipolar stepper
// Pair Red/Yellow and Pair Green/Black

void Astep() {     // This is a subroutine to tell arduino the output which creates the first step
  digitalWrite (RED,1);  // +ve voltage out of red
  digitalWrite (YELLOW,0);// so yellow is -ve
  digitalWrite (GREEN,0);// sets green to -ve
  digitalWrite (BLACK,1);// so black must have +ve
}
void Bstep() {
  digitalWrite (RED,1);
  digitalWrite (YELLOW,0);
  digitalWrite (GREEN,1);
  digitalWrite (BLACK,0);  
}void Cstep() {
  digitalWrite (RED,0);
  digitalWrite (YELLOW,1);
  digitalWrite (GREEN,1);
  digitalWrite (BLACK,0); 
}void Dstep() {
  digitalWrite (RED,0);
  digitalWrite (YELLOW,1);
  digitalWrite (GREEN,0);
  digitalWrite (BLACK,1);  
}
void forwd()// this is a subroutine to define the sequence of steps to drive the stepper forward
{
  Astep(); // Carry out the instruction of a subroutine we created called Astep
  delay(d); // wait for a length of time defined in the setup section
  Bstep();
  delay(d);
  Cstep();
  delay(d);
  Dstep();
  delay(d);
}
void rvrs()// define the sequence of steps to drive the stepper in reverse
{
  Dstep();
  delay(d);
  Cstep();
  delay(d);
  Bstep();
  delay(d);
  Astep();
  delay(d);
}


void loop()
{
  int f=(fwd*s/4);// create a new value f based on forward turns required, steps/rev and divide by four (4 seperate steps)
  for(int i=0; i<f; i++)// setup a counter called i, if it is less than f(above), we will do this again, so add 1 to i and carry out the instruction below
  {
  forwd(); // carry out the instructions we defined in subroutine forwd
  }
  delay(1000); // wait for one second - the number is milliseconds, 1000ms = 1s
  int r=(rvs*s/4);
  for(int i=0;i<r;i++)
  {
    rvrs();
  }
  delay (1000);
}

// Highlight to HERE

Ratings
Stepper motor Voltage = 2.5v supply Voltage = 12v

This is not a problem, when we apply the voltage for a step, there is a rapid increase from 0v towards 12v, but before we get there, we are onto the next step. I have over simplified this, but effectively what we are doing is making the stepper motor more responsive.

Stepper Motor Current = 1.68A, the Arduino is not even close!

No Problem, we will use the Arduino to operate a H Bridge, this device, in simple terms, will act like a big quick switch. When Arduino says go, the L298N will switch a bigger voltage and current to the stepper.


To Find your Stepper Pairs
1st find the two pairs of windings on the stepper motor. Choose any two wires, and see if they are connected to a winding.
You can do this with a multimeter set to Ohms - reading at or around zero, or you can use a battery and an LED. Connect the battery to one stepper wire, the other to one leg of an LED with a resistor.Touch the other LED leg with any of the remaining 3 stepper wires, when it lights you have your pair.


How it works
Bi-Polar stepper motors are not very complicated. The central rotor is magnetic, and by creating a magnetic field in one of the two windings, we make the rotor "step" so that the magnets line up. This effect can be seen simply, by holding two ordinary magnets close to each other, One way they attract, but reverse one and they repel each other.