Sunday, January 4, 2015

Magnetic Stirrer 2

Back in the Metal Shop, my favorite place, I am building the mounting system for the Magnetic Stirrer.  I decided to use 0.125 Aluminum sheeting to build the frame pieces.  Its locally available at Turner Hardware.  The closest piece I could get to the size I wanted was 12" x 18", so first I had to reduce the sheet to the 8" x 8" squares I want.  Then I can mark the parts, and start cutting.
I draw lines on the part with a carbide scribe so they are durable during the cutting process.  First thing is making the holes that hold everything together during the cutting process.  The I can clamp the two pieces together so all the cuts are the same on both pieces.  Then I'll clamp the whole jig onto the Mini Mill, and make the round cuts first with an endmill.
I jam a bolt into the table, and through a T Nut to make an axis.  Then line up the part, and nibble out the circle part.  Once I found the process to do this, it makes round cuts easy, and precise.  There are some select parts I don't want to cut like this, so when I get to those parts I have to disassemble the jig, then put it back together with only the parts I want to cut.  Next is cutting the straight lines.
This is a hacksaw job, a good challenge to make straight lines.  Cut wide, and grind into tolerance, LOL!  No, I'm pretty good at making straight lines.  After this I will make the ventilation slots, and mount holes for the motor.  The bottom piece will have a clearance hole in the middle for the body of the motor, but no motor contact.  Then also on the bottom piece there is a shelf for the motor Speed Control.
I've got a little more machine work on the bottom piece, then I can do a test fit.  There is one more piece which is the shelf on top where the stir vessel is placed.  It will be 1/4" plexiglass, and I'm not sure how I want to cut it...

3D Printing

We got the 3D Printer printing last week.  Finally had some time off to work on it.  There were problems with the Extruder Head feed mechanism, too much tension.  Also the feed motor was binding.  We re-adjusted the tension on the screws that hold the feed motor to the extruder to free up its motion.  Also we disassembled the filament path into the extruder, and found some obstructions, then cleared them.  We had to coax it along a bit, but we finally made some printed pieces.
Here is a little bit of video to show the thing in action.  It takes a long time to make a part.  The large Tron took an hour , and fifteen minutes...

Monday, December 29, 2014

Magnetic Stirrer

My latest adventure with metal working, and magnets is the Magnetic Stirrer.  A friend at work gave me the idea, and it seemed like good application for the spare sheet metal, and magnets out in the garage.  The rotor is 1/8" aluminum sheet cut to 2.5" diameter.  I used a 1/4" inside diameter Arbor to mount the rotor on the motors shaft.  I had a little trouble with that because the motor shaft is 1/5", so I used a 1/4" outside diameter aluminum tubing, then bored the inside out to 1/5".  The set screw on the Arbor provides a crush fit to make the Arbor stay on the shaft.
There are two, 10 pound Neodymium Magnets, facing opposite directions, which will latch on to the Stir Bar inside the Erlenmeyer Flask on top of the Magnetic Stirrer.  The plan is to have a piece of Plexiglass sit just above the rotor, and the Erlenmeyer Flask will sit on top of the Plexiglass.  Next in the process is to fabricate the base support for the motor, and Plexiglass top, then to assemble the Pulse Width Modulation Voltage Regulator which will act as a Speed Control.

Wednesday, November 19, 2014

3D Printer

I've been working with the Velleman K8200 3D Printer.  This surprisingly affordable kit has been a really exciting project for me.  Some of my friends, and I went to a Maker's Fair at Tanner Electronics last fall.  One of my friends is a Mechanical Designer, and this Velleman kit was irresistible.
Now we have the kit assembled, and are working out the functional idiosyncrasies.  The motor stop switches needed to be adjusted.  The table needed to be leveled.  We needed to check out all the electrical connectivity, and functionality.  And now I think we are ready to print some parts.
This 3D Printer comes with all the basic parts you need to make it work.  But there are other things to be added to it that you can print, like a control board cover.  Then, also, there are even more things other people have designed, and made open source, like an extruder head light, and even enclosure pieces like the corners.  This is a wholly open source kit, even the source code for the Arduino processor board is customizable.  This is truly a miracle in rapid prototyping.

Monday, September 1, 2014

PIC 16F1788 Analog Inputs

Another stumbling point in my adventure into the Enhanced 14 bit core was the Analog to Digital converter module.  The PIC16F1788 has optional differential analog ports, and I am using AN0 as a single ended analog signal input.  There are 4 bits in the ADCON2 register that select the negative side of the differential analog input which I had set for AN0, so AN0 was selected for both the positive, and negative input, thus there was no difference, and all I got were zeros from the ADC Module.  Once I realized this, and changed the negative side of the differential input to ground then the ADC Module started producing numbers, and I got my Analog input working.  Then I had to play with the format of the ADC numbers to get the Pulse Width Modulation Module working correctly.  The ADC is generating 12 bit numbers, and the PWM Generator Duty Cycle Register is a 10 bit number.  So what we'll do is shift the ADC over two bits, throw away the two least significant bits, effectively dividing the 12 bit number by 4, and making it a 10 bit number.
Now the analog input, and PWM Module are working right, I had a need to adjust the PWM Period to get the PWM Frequency right.  It was running at 250 Hz, and the target is 1 KHz.  This is an adjustment to the Timer 2 prescaler, which was set for 64, and I changed it to 16 to kick the frequency up times 4.  The above video shows the results of these endeavors.  The goal was to have a 1 KHz PWM signal to be a speed control of a fan motor, with a analog input signal to control the duty cycle.

Sunday, August 31, 2014

32 Mhz PIC

This is more about my Oscilloscope rather than the processor.  Using the new enhanced 14 bit core is really exciting for me now.  One of the things I have always had trouble with using PICs is the oscillator.  I start using crystal resonators, which are very fickle, and will have trouble starting if they don't have a matched impedance pathways to the PIC.  Then I moved on to real oscillators, but had that impedance matching problem, which imposed speed limits.  With an oscillator I could only go up to about 4 MHz.  But now, with the enhanced 14 bit core, and integrated oscillator I can go up to 32 MHz.  Big performance boost...
Part of the configuration on the PIC16F1788 allows me to port the internal oscillator to an I/O pin, and it can be used to synchronize another part to this parts clock.  Also this allows me to verify that the internal clock is running, sometimes that's a question.  What I was getting to is the oscilloscope is looking at the PICs 32 MHz clock.  That is impressive.  This is the Velleman HPS140i pocket Oscilloscope.  Lets see you do that with your phone app scope, LOL!

PIC16F1788 Interrupts

I've been working with the Enhanced 14 bit core lately, and porting my code over from an old 14 bit core (PIC16F876).  The new PIC16F1788 has a lot more peripheral functionality, which creates some difficulties when setting up the device.  On this particular project I am using the external interrupt to trigger a pulse generator.  In the code I defined my interrupt routine, set the interrupt register to fire on INTE (External interrupt), and branch to the pulse generator routine.  This is pretty simple on the regular, old 14 bit core, but with the enhanced 14 bit core there are analog options on port B, and they are set to on by default.  So I got everything setup, installed the new processor, and loaded my code, and went to test the board, no interrupts.  I got stuck there for some time because I didn't know about the analog select register, which disconnects the INTE interrupt signal from the external pin, and turns the port into an analog input.  The ANSEL (Analog Select Registers) are set by default, and you have to clear these bits to use the port as a digital I/O pin.
The boards I build are usually hand assembled on a piece of Vectorboard, and wired point to point.  There are noise issues because there is no ground plane in the Vectorboard.  This has been a problem in the past because I was limited to running my boards at 4 MHz.  This is the reason I moved to the Enhanced 14 bit core.  The PIC16F1788 has an internal oscillator that can run up to 32 MHz, making my pulse generator a lot faster, and solving a big problem...
This particular project required a dual core board.  Each processor has a specific task, which cannot be interrupted by another process.  One is a frequency converter running a tachometer, and the other is a PWM generator used for brushless DC motor control.  Switching from the old 14 bit core to the enhanced 14 bit core allowed me to get the high speed clock to meet the timing requirements for the project.  Now I am in the process of learning to use the PSMC (Programmable Switch Mode Controller) which can do high performance PWM, and other high performance pulse schemes used to run brushless DC motors.