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.

Sunday, July 27, 2014

Velleman Oscilloscope

My old oscilloscope, a Leader 20 Mhz Analog Scope, became difficult to maintain, and was getting old, and unreliable. Then I had a situation where I needed a scope to fix a problem. This was a situation where I really needed to see the signal to fix the problem. So I decided I needed to get something other than a full blown scope, can't afford it. I looked at various Data Acquisition equipment. I also looked at Cell Phone App Scopes which use the microphone as the signal input. There are various wireless solutions that utilize remote data acquisition, and bluetooth to get data to the phone app. But I need bandwidth, an audio frequency input isn't going to catch the high speed digital signals I want to look at. Then I found the Velleman Instruments HPS140. It can grab 40 Mega-Samples per second, and has 10 MHz bandwidth, in a pocket sized, battery powered package.
 
My work takes me to various places, and I have a need for portability.  The Velleman Instruments HPS140 is perfect for what I do.  Its a powerful scope that can look at the signal I need to look at, in a light, portable, battery powered package.  This is what I have been waiting for...
The signal the scope is monitoring is the output of sine wave generator that can go past audio frequencies.  You can hear the camera microphone aliasing as the generators output exceeds its input frequencies.  When you listen to the output in person its a fairly clean sinewave doing a sweep in frequency.  The recorded audio is very strange because of the aliasing of the microphone input.  The HPS140 can easily measure supersonic frequencies.  Its looks at a 4 Mhz clock on another board with no problems.  I am much more capable with this scope in my tool bag...

Wednesday, February 26, 2014

PWM Generator

The PIC16F876 Microcontroller has two precision PWM, Capture and Compare Module in it.  The maximum frequency of the PWM signal is 32,768 Hz, but is easily changed from the minimum frequency (dependent on clock speed) up to 32 KHz.  The Capture and Compare module is based on one of the Timers in the PIC, which drives a 10 bit accumulator in the Capture Module.  Then the Compare Module will drive an output pin high or low depending on the duty cycle register.  The resolution of the PWM is based on the size of the accumulators, and this PIC has 10 bit accumulators, or 1024 bits, so our duty cycle resolution is around 0.1 percent.  Here is a pretty picture...
If we were to compare this to an older PWM Generator based on a NE555 Timer the PIC PWM Generator is extremely precise.  The instruction cycle in the PIC at 4 MHz is 1 uS, and the PWM output can change states within 30 uS.  The NE555 Timer based PWM generators I've built range from 20% to 80% PWM, while the PIC PWM generator can go from rail to rail, 0% to 100%.  I picked a chunky transistor for the output as well.  The IRFZ44 is a 60 Volt, 50 Amp continuous, 200 Amp pulsed MOSFET.  So this PWM generator can directly drive DC motors, or it can be used to control high impedance signal level PWM controls.  Above I think I have the schematic worked out.  Below I am starting to work on the Layout.
The first build is on a protoboard, so I can work out a logical parts placement, and make sure the circuit functions before I make printed boards.  I have already built a few of these, and they are in service.  This copy is going to be my reference design, and I'll be making printed boards after this point.  This means I'll be able to take you through the layout process next.  There is an extra part on the board which is a RS232 Communications Converter.  This is to provide communications to the PC for debug, and adjustments.  There is a tentative plan to make this a Dynamic PWM generator which can be adjusted by a computer interface, or the analog speed control knob.  Probably for the printed design I will switch over to a USB interface to connect to computers that are more modern than my development machine.

Tuesday, February 4, 2014

Fifi

I got an opportunity to work on Fifi, and couldn't resist.  What do you think of when you hear the name Fifi?  A small dog?  A frilly plant?  Fifi's maximum takeoff weight is 60 Tons...  Neither frail, nor dainty Fifi is a Boeing Airplane Co. B-29A-60-BN Superfortress.  I'll let that sink in a while, Superfortress...
This aircraft is "prickly", as in heavily armed, with machine guns pointed in every direction.  The wartime B-29s had machine gun turrets from stem to stern.  Fifi has been refitted to be an exhibition experimental aircraft so the weaponry is inert.  Although it seems like it is still there.
I had this opportunity because my brother was doing a certification on Fifi, and I was more than happy to help.  The B-29A was built in the middle of a major war, and rushed into service which created a number of problems.  Fifi has been extensively upgraded with new engines, and some modern electronics like GPS to make her compliant with modern aviation rules.
This is the view of the cockpit standing where the turret stations were.  The Radio Bench is on my right, and the navigation station is to my left.  The B-29A has 5 flight crew; Pilot, Co-Pilot, Flight Engineer, Radio Operator, and Navigator.  Four people in Fifi's cockpit is crowded...
Fifi was built in 1942, and with extreme secrecy.  This is the hatch in the front gear bay that leads to the cockpit.  Apparently the ground crew is not allowed in the cockpit. This hatch is right in the middle of the cockpit.  The Pilot and Co-Pilot chair are forward a couple feet, and the flight engineers station is directly adjacent to the wheel well hatch.
Naturally I going to start with the engineers station, cause I'm an engineer, and not a pilot.  All of the controls and indicators for the four Wright R-3350, 18 cylinder, radial, supercharged engines.  The flight engineer had the absolute controls for the engines.  The pilot and co-pilot have access to the limit that the flight engineer sets.  This is completely a mechanical system.  Levers, wires, and pulleys tell the control surfaces what to do.  No power assist.  Its the pilots muscles against the control surfaces, I guess there are some mechanical advantages.
This is the back of the flight engineers station.  Tubes and wires from this station extend to every critical area of the ship.  Every control, and indicator from all over the ship go to this station.  This is electromechanical control at its finest in 1942, state of the art.  I am humbled to be in the presence of such workmanship.
Directly to the right of the back of the flight engineers station is the radio station.  In 1942 what they had for communication was what we think of as Ham Radio.  On top of this table are several oscillators, and some transmitters to cover the spectrum that was used in the 1940's.  Fifi has upgraded to modern Navigational, and Communications Radios.
This is the Pilot's station.  Its a bit modified.  Noticeably there is a an iPod connector, and  mount.  To the left of the yoke there is a Garmin GPS.  There are a number of indicators mounted on top of the original instrument cluster.  I understand that Fifi is trying to fit in to the brave new world.
 Here the nose section is removed.
Commemorative Air Force.
A B-29 carried the Bell X-1 on the voyage where it broke the sound barrier.
Fifi's tail just barely fits in the hangar.  The new shortwave antenna is obstructing the flag.
This is a feather in my cap...

Sunday, January 26, 2014

Learjet 25D Job

I got an opportunity to help my brother work on a Learjet 25D yesterday.  This aircraft was produced in 1980, so it is 34 years old, and still a very impressive piece of machinery.  It has had some upgrades over the years, which includes Garmin navigational equipment, and Doppler Radar.  It's beyond my descriptive capability, but a cool ship none the less...
My brother does Altimeter and Transponder Certifications for General Aviation Aircraft, which is an annual process.  Every aircraft has to have their Altimeters, and Transponders certified on an annual basis to make sure that they work within the specifications to maintain flight safety.  He describes this job as routine, and perhaps even boring, but for me it was very exciting to work on one of these awesome machines.
This particular aircraft is a Learjet 25D, and it has two main Altimeters, and one standby Altimeter.  There are also two Transponders, which communicate the aircraft's ID, and altitude to the ground traffic control computers.  There are a large number of sophisticated instruments in the cockpit, all of which have redundant backups, as well as two Cockpit Display Systems, which are digital computers that summarize all of the sensor data that the aircraft generates.  The cockpit is rather small, but has every possible control within reach of the pilot.
This aircraft is parked for extensive maintenance so they have all the access hatches open, and the cowlings have been removed from the engine nacelles.  This is an older aircraft so it has Turbojet engines.  These are relatively inefficient compared with modern technology Turbofan engines, but they still produce huge power, about 3000 pounds of thrust.  Here is a wiki for the Learjet 25.  This was a really neat experience for me, and hopefully it will lead to more of the same...