This week I thought I would try to make an automated iris mechanism using the DC motor to drive it, which I could potentially use as an interesting opening and closing actuation mechanism in my final project.
HOW TO MAKE AN AUTOMATED IRIS
1: MILL AND STUFF YOUR BOARD
I used Neil's pre-designed DC motor circuit board traces and interior.
Mill it on the Modela using the fab modules. Ran out of double sided tape half way through so had to improvise with some duck tape!
Stuff the board using the components specified on the board.
2: TEST THAT THE MOTOR WORKS
I used Neil's hello.H-bridge.44.c and hello.H-bridge.44.make files as they were just to check that the board worked.
First I checked that everything on the board was behaving properly (very important when dealing with power and motors!), by checking it with a multimeter:
Check the VCC and GND traces to make sure there is no short between them - simple way of doing this is to check that there is no short across the capacator
Check which outputs in the battery IDC header are GND and VCC by seeing how much voltage comes out of the different IDC ports - it is important not to get crossed or backwards as this will fry your circuit board!
Check that the 5v regulator is working when the battery is plugged in - check that you get only 5v across the capacator
Plug your board into your FabISP and the FabISP to the computer
Open Terminal, navigate to the directory where your code files are stored, and flash the chip: make -f <make filename> and then make -f <make filename> program-usbtiny
It worked!
I tried playing around with the delays to make the motor run faster and slower, and used the Zetex additions to the code to make the motor go clockwise and anticlockwise
I also found out a bit more about H-bridges:
An H-bridge enables a voltage to be applied across a load in either direction - it does this by switching on or off different sets of the 4 switches it has inside the chip
When only switches S1 and S4 are closed a positive voltage is applied across the motor. By closing only S2 and S3 switches, this voltage (an direction of the motor) is reversed
The operation of these switches can be defined in the code by defining the different pins on the Attiny to the different switches on the H-bridge chip - the traces on the board connect pins B1-B4 on the H-bridge to pins A0-A3 on the Attiny
By then turning on opposite switches, the different directions of the H-bridge voltage flow and therefore motor direction can be changed - B1 and B3 map to A1 and A3, and B2 and B4 map to A0 and A2 in this case (see data sheet schematic)
3: CUT OUT THE PARTS FOR THE IRIS ON THE LASER CUTTER
I found a pattern on the internet which worked fairly well and tested the design in cardboard and thin plastic, and modified it to have a central axial point to connect the motor to. Unfortunately the cardboard and plastic was just too heavy and rough creating too much friction for the motor to move it - next time I'll make it out of very thin plastic and leave more space for the mechanism to move