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...