Showing posts with label Control. Show all posts
Showing posts with label Control. Show all posts

Sunday, 15 October 2017

CUI INC PDQ15 Remote Control Pin

Summary
This blog illustrates the measurement of the remote control pin available on the CUI INC® PDQ15 series of brick power supplies. Similar tests were conducted in a previous post with two MeanWell supplies.
CUI INC PDQ15 power supply
CUI INC PDQ15 power supply

Control Pin
From the CUI INC PDQ datasheet (page 2), the voltages required to drive the ON/OFF pin are listed as greater than 3.5V for ON and less than 1.2V for OFF.


Remote control pin specifications
Remote control pin specification
Control Pin Input Voltage Measurements
To verify the operation of the control pin on the CUI INC PDQ converter, two outputs of a Rigol DP832 linear regulator power supply were used in the same manner as a previous blog which used MeanWell converters.


Rigol DP832
Rigol DP832
An initial test was conducted to determine the ON / OFF voltage hysteresis for the converter. Turn ON was 8.7V DC and turn OFF 8.0V DC. Tests were conducted with no input on the remote control pin (floating).

For the second test, one channel of the power supply provided the input supply to the DC to DC converter and the second channel on the supply provided the supply for the control pin. Both outputs of the power supply had a common 0V connection.


PDQ bench testing
PDQ bench testing
The supply input voltage was increased, from the threshold ON voltage and the control pin threshold voltages determined and recorded.

Measurements for the CUI INC PDQ15 is listed below.

PDQ Measurements for supply vs control pin voltage
PDQ Measurements for supply vs control pin voltage

A visual representation of the above data is shown below.



PDQ Graphed measurements
PDQ Graphed measurements
The graph shown above is scaled to show the small variation in voltages required to activate the converter using the remote control pin.

Note On Temperature
The cold body temperature of a PDQ15 converter was measured at 19.2C. With a 24VDC input supply connected, no load, the PDQ15 has a quiescent power of just less than 2W. After 30 min the body of the supply had raised to 57.1C.

Summary
For this test of the characteristic response of the PDQ15 remote control pin, the measurements showed that it was similar to the MeanWell SKM series. The remote control ON/OFF voltages were flat after 14VDC although the voltages were not similar to the MeanWell SKM or SDM converters.

Thursday, 21 September 2017

MeanWell SDM SKM Remote Control Pin

Summary
This blog highlights the need for verification and validation testing when changing or updating electronic parts. In particular all facets of the device should be reviewed or tested whenever possible.

Background
In a commercial arena, new parts or those parts earmarked for an upgrade, are usually checked on paper for suitability. The time spent on the comparison between parts usually depends on the parts complexity although specifics can be inadvertently overlooked from time to time. After the new part is sanctioned for use it is commonly bench tested or bolted onto an existing design to validate operation before being included in a new hardware (PCB) design.

For this blog two MeanWell products are referenced, the SDM and SKM series of DC to DC converters.
 MeanWell SDM30-24S5
MeanWell SKM15
Operational Characteristics
Comparing the datasheets of the MeanWell SKM to the SDM series, the SKM is technically the better device. After all, the SKM is newer technology and it performs accordingly during bench tests.

One technical aspect of these converters which can be overlooked is the hardware difference between the inputs used to switch the converter ON and OFF. For the SDM this input is called an ON/OFF pin and for the SKM it is called RC for Remote Control.


SDM converter block diagram
SDM converter block diagram
The block diagram shown above illustrates in block diagram format how the control pin for the SDM converter enables or disables the PWM portion of the circuit. A similar block diagram for the SKM was not available at the time of writing this blog.

Control Pin Difference
From the MeanWell SDM datasheet, the voltages required to drive the ON/OFF pin are shown as 5.5V ON and 2.5V maximum for OFF.


SDM ON/OFF control voltages
SDM ON/OFF control voltages
The MeanWell SKM datasheet lists the voltages required to drive the ON/OFF pin as greater than 2.5V ON and 0.5V maximum for OFF.

SKM ON/OFF control voltages
SKM ON/OFF control voltages
This information is clear enough, well vague enough! Other factors also need to be considered depending on the method used to drive the control pin. These could include, type of input, input voltage range, current required to drive the input, absolute maximum ratings and response times / delays where applicable.

For this blog only the input voltage range of the control pin will be looked at in detail.

Control Pin Input Voltage Measurements
To verify the operation of the control pin on the MeanWell SKM and SDM converters, two outputs of a Rigol DP832 linear regulator power supply were used. 


Rigol DP832
Rigol DP832
An initial test was conducted to determine the ON / OFF voltage hysteresis for SDM model, 100mV, and the SKM model which had a hysteresis of 2000mV. Tests were conducted with no input on the remote control pin, floating.


MeanWell SDM, SKM supply voltage hysteresis
MeanWell SDM, SKM supply voltage hysteresis
For the second test, one channel of the power supply provided the input supply to the DC to DC converter and the second channel on the power supply provided the supply for the control pin. Both outputs of the power supply had a common 0V connection.

This is one method of testing the MeanWell supplies. There are other methods that could be used to drive the control pin although a voltage derived from the actual input supply appeared to be a common method for controlling this input pin.


SDM bench testing
SDM bench testing
The supply input voltage was increased, from the threshold ON voltage and the control pin threshold voltages determined and recorded.


SKM bench testing
SKM bench testing
Measurements for the two MeanWell supplies are shown below.

SDM Measurements for supply vs control pin voltage
SDM Measurements for supply vs control pin voltage

SKM Measurements for supply vs control pin voltage
SKM Measurements for supply vs control pin voltage
A visual representation of the above data is shown below.


SDM Graphed measurements
SDM Graphed measurements

SKM Graphed measurements
SKM Graphed measurements
Summary
When migrating between MeanWell SDM and SKM DC DC converters, reviewing the design should be performed as a matter of good design principle. 

For designs using the ON/OFF control pin, the drive circuit should be reviewed for a suitable drive level under a range of operating conditions.

At a supply voltage of 24VDC, the SDM series start operating at 3.4VDC whereas the SKM starts operating significantly lower at 1.2VDC. This of course sounds like a better hardware feature. The SKM supply could be driven from designs using lower circuit voltages, however narrowing the operating gap between 0V common and supply has its own drawbacks. Noise immunity, ESD or inadequate earthing can each introduce issues into the design if not considered carefully at design time.

Sunday, 16 April 2017

Comair Rotron Fan Program Input - Control and monitoring of 4 Wire CD24R7X

Summary
This blog investigates control and speed monitoring of a 4 wire Comair Rotron fan using the Program input and Tacho output. The fan speed was controlled using a resistor then separately tested with an optocoupler driven by an external PWM signal.

Comair Fan Control Article
Tim Shafer, of Comair Roton, wrote a brief but helpful article relating to methods of fan speed control. This article is available on the Comair Rotron website or from Digi-Key as a PDF Document. The details from Tim were a start although did not clearly define methods of interfacing with the 'Program' input connection used by Comair Rotron fans. Even after reviewing the data sheet for the fan (CD24R7X) neither a suggested resistor range or recommended PWM frequency was suggested for the fan. Time for some bench testing and fan characterisation.

Comair Rotron CD24R7X
Comair Rotron CD24R7X
A test unit was purchased from Digi-Key and arrived in the Comair Rotron packaging. There was plenty of cardboard to secure the fan inside the box for transport which was a pleasant find in these times of bubble wrap packaging. The test unit was manufactured Dec 30th, 2015 with a serial number of 362.

Comair Fan Testing
Since the fan was earmarked as a test device to regulate temperature and air quality of a room, the range of fan speeds against changes in the Program input needed to be known. With the article from Tim Schafer in mind, the Program input was tested with an optocoupler driven from a signal generator then separately with a variable resistorAdditionally the effect of fan speed against variations in power supply voltage was also captured.

Comair Fan Test Setup
To perform the required tests, the fan was connected to a Rigol DP832 PSU and Function Generator, Agilent oscilloscope and vanilla multi-meter for current measurement verification.

The Comair fan tacho output connection (open collector) was pulled up to the 24VDC supply via a 220K resistor and then monitored by the oscilloscope.

The fan program input was connected to the optocoupler collector and emitter to 0VDC. To change the speed of the fan the Program input must be connected to 0VDC. The input LED of the opto was driven directly by the function generator.


Test Setup: Duty Cycle Measurements
Test Setup: Duty Cycle Measurements

Test 1: PWM Control
With a PWM frequency of 1kHz, the duty cycle was changed in fixed steps and plotted against the average fan current.


Duty Cycle against Fan DC Current
Duty Cycle against Fan DC Current

The duty cycle against the derived fan RPM was measured next. To derive the fan RPM, the frequency of the Tacho output was divided by two, since the fan produces 2 PPR - Pulses Per Revolution, then multiplied by sixty to convert into Pulses Per Minute aka RPM.


Duty Cycle against Fan RPM (Derived)
Duty Cycle against Fan RPM (Derived)

From tests performed on this fan, the speed changed from 1488 RPM at full speed down to 702 RPM at the lowest speed. This range of change in RPM equated to a change in duty cycle from 99% to 1%. 


One possible method to check the rotational speed of the fan, based on the duty cycle provided to the Program input, is the formula below which serves as a guide with a + 10% variation in the Tacho reading. A line of best fit was applied on test data from a single fan.


Estimated Fan Speed (RPM) = (7.9 x Duty Cycle) + 720

Where the duty cycle is the ON duration of the period as a percentage of the total period.

Test 2: Resistive Control
With a 100k variable resistor connected between the fan Program input and 0VDC, change in the fan tech output was recorded against changes in the resistance.


Test Setup: Resistance Measurements
Test Setup: Resistance Measurements
Again the fan speed in RPM was derived from the 2 PPR Tacho output.

Program Resistance against Fan RPM (Derived)
Program Resistance against Fan RPM (Derived)
The fan RPM varied from 1485 RPM down to 714 RPM which equated to approximately a resistance in the range of 12k to 0R. Tests were conducted with resistances over 20k with no change in the fan speed noted.

One possible method to check the rotational speed of the fan, based on a resistance between the Program input and 0VDC, is the formula below which serves as a guide with a + 6% variation in the Tacho reading. 
A line of best fit was applied on the measured data between 0 and 12k for the test fan giving the estimation below.


Estimated Fan Speed (RPM) = (0.068 x Resistance in Ohms) + 720 


Test 3: Power Supply Fluctuations
Lastly the DC supply to the fan was varied with PWM to determine the stall speed of the fan for a 1% duty cycle. It should be noted that when the supply was raised above 29VDC the fan speed became erratic. The recommended 28VDC limit listed on the unit by the manufacturer should not be exceeded.

DC supply Voltage against Fan DC Current
DC supply Voltage against Fan DC Current

For the tests conducted with the fan the operational voltage range was found to be 16V to 28VDC with a stall voltage of approximately 6VDC.

Additional Measurements
The PWM frequency was varied in the range from 100Hz to 10kHz with some minor difference in the current drawn by the fan. A difference of 2% was noted between some of the duty cycle readings which may be attributed to instrumentation and or user measurement error.

As a matter of completeness the Tacho output was captured when the Program input was shorted to 0VDC, as shown below. This equated to approximately 717 RPM.


Program Input Shorted to 0V
Tacho Output: Program Input Shorted to 0V
The Tacho output shown below was captured when the Program input was connected to a 100k potentiometer to 0VDC. The pot setting was at the highest resistance. This setting equated to 1428 RPM.

Program Input with 100k Resistor to 0V
Tach Output: Program Input connected to 100k Potentiometer

Operating Specifications for the 
Comair Fan (Suggested) 
For the fan under test in this blog, the Comair Rotron CD24R7X, the suggested operating parameters are as detailed by the manufacturer with some additional information below.

Supply Voltage: 16 - 28VDC, Nominal 24VDC

Supply Current: Max 1.22A at 24VDC (Full Speed)

Fan Speed: 700-1490RPM + 5%

Program Input Resistance: 0R to 12k equating to slowest to fastest fan rotation. Estimated Fan RPM = (0.068 x Resistance in Ohms) + 720 

Program Input Frequency: PWM of 1kHz, duty cycle 1% to 100%. Estimated Fan Speed (RPM) = (7.9 x Duty Cycle) + 720

Tach Output: 2 PPR (Non-Isolated Open Collector) 28VDC at 20mA

Connections: Red           - 24VDC
                      Black         - 0VDC
                      Blue/White - Tacho Output
                      Yellow        - Program Input

Thursday, 11 June 2015

Wireless remote controlled rocket launcher with Atmel and Arduino/Atmel source

Summary
The focus of this blog is to redesign a circa 1999 remote controlled model rocket launcher. While updating the controller design the main capability of remote launching will be retained since this is a handy feature for those capturing rocket launches on camera or video.

Throughout the blog the steps of the design are documented with screen captures along the way.

History
A garage door style remote, two button key chain transmitter, and receiver module were used for the remote control section. The receiver unit had a dedicated decoder, AX5885, which was monitored by a Motorola microcontroller (Freescale), 68HC705J1, which had the most difficult tasks of timing a buzzer and driving a MOSFET. A sealed lead acid battery provided the amps to fire the igniters (Estes parts preferred).


Original Rocket Launcher PCB circa 1999
Original Rocket Launcher PCB circa 1999

Evolution
Knowing that a quick replacement was required, with say an Arduino, the design was to take a three step approach.
  1. Produce a new test board with an Atmel micro and code in Atmel Studio. This would mean the rocket launches could continue within weeks! PCB Zone aka Circuit Labs have a quick turnaround on boards meaning the bare circuit board usually takes a week
  2. Following on from the first design would be an update with new features and some much needed safety
  3. Lastly ensure the design is friendly enough for those starting out with devices such as Arduino. This would mean porting the existing code.
Remote Control Selection
The first redesign of the launcher was always going to be a reprint of the original 1999 board with 2015 parts to return the launcher to operation. In saying that, addition a status LED for debugging and putting an on-board connector for the receiver antenna would be the only intended additions.

Beginning with the remote control, SparkFun had an ideal unit - RF Shield however the corresponding remote was out of stock, nothing at LittleBird either. So fallback was to the garage style remotes. The local supplier, Oatley Electronics, imports a 433MHz UHF 4 channel remote and with the transmitter and receiver on special, it was worth a try. Provision can be made in a later design for other receivers such as those from SparkFun or KitStop since the Oatley parts are many times the price.

What's in a Micro
There was no preference when looking for a replacement microcontroller. As other Australian bloggers such as Dave Jones from the EEVBlog tend to suggest, picking a device or hardware, having a play and making mistakes is a excellent way to learn.

For this redesign an 8 pin Atmel micro was selected to replace the previous controller. The Atmel parts are low power (uA) devices, have a stable enough internal oscillator for this task and are small enough to setup by an enthusiast.


ATtiny pinouts

Selecting a Atmel micro can appear baffling considering the many devices available on the Atmel website, however when the requirement to have Arduino support, this narrows the field drastically. Leah Buechley of High Low Tech has a page on her site dedicated to the ATtiny45 and 85 and its use with the Arduino platform. With an online community already then this micro is a perfect choice.

Basic Circuit Design
First up is the board operating voltage and associated regulator. There are a plethora of options here from linear to buck style switching regulators which would provide the 5V DC required for the board. A lower voltage was not a option based on the receiver selected, although the Taiwanese manufacturer, AutoMicro Technology, does state the receiver operates at 3V. Since there are a number of 5V low drop out linear regulators on the shelf, surface mount, an ON Semi linear regulator will be used.

Since the micro is using the internal oscillator there is no need to select an external crystal or similar device, however the micro will be kept as a DIP package to allow for off board programming.

Switching MOSFET's
This leaves the drive devices for the buzzer and igniters. Separate MOSFET's will be used to run the buzzer and igniter. 

Searching Digikey and Element14 for a small MOSFET signal device there are plenty to choose from. Main requirements to drive the buzzer, continuous drain current 50mA and the drain source voltage better than 30V. A device that is a surface mount (SOT23 style) is chosen which will easily run the buzzer and be used in another project.

Selecting a replacement for the original IRF540 follows the same process that was used for the smaller MOSFET with the added parameter of ON resistance. That is the MOSFET's drain to source resistance, for a specified gate to source voltage. 
The original part with a 25A drain current, had an ON resistance of 26milliohms. With newer technology, surface mount and less than three dollars this device can be upgraded to a IRFR7540 which has an ON resistance of 4milliohms. This device handles 90A for a drain to source of 60V, complete overkill or is it! 

Why the High Current MOSFET?
According to the ESTES data sheets, the resistance of the igniter is approximately 0.8 ohms (measured 0.7 ohms on Estes igniters). Since a sealed lead acid battery is being used and we can assume the battery is near 100% charged before use, this gives a voltage of about 12.6V DC. Applying Ohms law, 12.6V/0.8R gives almost 16 Amps. In reality there are additional system resistances due to cable cross section, terminals fittings, battery, MOSFET ON resistances and other factors that would reduce this value.

In addition it should be noted that the current mentioned above is steady state and this resistance does vary for other manufacturers igniters meaning the inrush current could certainly be higher. So choosing a MOSFET with the lowest ON resistance together with lowering the total system resistance presents the igniter with the ability to ignite correctly.

Schematic Drafting Package
From KiCad to Altium Designer there are CAD packages to suit the needs of most individuals. Additionally there are now web based community PCB tools from Altium such as Circuit Maker. These fill the gap between the novice and the experienced designer as well as providing valuable community support. This design will stay with the Altium flavour for that sole reason.

Schematic Drafting
This design will require a single A3 page due to its simplicity. This may be a sticklers mentality but A3 is the suggested industry page size however not a hard and fast rule.

Searching Digikey for an ATtiny85 (ATtiny45 would do the job also) throws up over fifty results. Narrowing the search to DIP reduced the results to two. At the time of checking, one device with a speed of 10MHz and the other 20MHz, the faster device was cheaper. So the ATtiny85-20PU can be added to the centre of the schematic straight from the Atmel libraries. In addition a small decoupling capacitor is added to the supply rail of the micro.

To make life a little easier for those who prefer to solder the micro directly into the board, rather than using a socket, an in-circuit programming header is included. Using the In System Programming (ISP) pinouts and then mapping these to the micro with net labels allows the programming header to be moved around the schematic easily, no fixed wiring. A pullup resistor is added to the reset line of the micro although the ATtiny can be configured to operate without this pin.


ATtiny Processor Connections
ATtiny Processor Connections

Next is the linear regulator which is protected from reverse power with a single diode. Again, for this design not too many bolts and braces. To avoid the loss in the diode a 15V, or higher voltage rated, Transorb and resettable fuse combination could have been used.
Linear Regulator Connections
Linear Regulator Connections

Additionally the V_BAT supply rail that will provide power to the MOSFET's is not reverse polarity protected. This is a must for the revised board, a few other blogs describe the reason - false ignition. Some of the usual fixes for this problem are to use a high current relay or an arming switch.

RX3302D Receiver Connections
RX3302D Receiver Connections

The receiver unit (RX3302) can be connected in a number of configurations, either using the receiver data output or the four digital outputs that correspond to the buttons on the remote control. The latter will suffice for this project.

A pushbutton and LED are connected to the Learn Acknowledge (LA) pin allowing replacement remotes to be programmed by holding down the pushbutton for a few seconds. The LED is switched OFF by the receiver itself when learning mode is completed or the active learning time expires.

The two output MOSFET sections look identical on the schematics, one device for driving the buzzer and the second for the igniter. On the updated design the output section will be modified to include protection and load monitoring. The addition of load monitoring is helpful for instances when there is no ignition and the rocket engine must be inspected.


MOSFET Output Devices
MOSFET Output Devices

Adding an LED for basic debugging and the schematic can be rule checked then annotated by the software.

Rocket Schematic
Rocket Schematic

PCB Drafting
The Printed Circuit Board (PCB) can be laid out without any size constraints although the smaller the board area, means usually lower the cost. Most PCB suppliers offer options to collate other people's boards to reduce costs. 

Rocket PCB (two layer)
Rocket PCB (two layer)


Rocket PCB in 3D
Rocket PCB in 3D

The PCB is laid out with the vertical receiver board running down one section of the launcher board, processor in the middle and connectors with high power switching on the opposite section of the board. 

On the reverse side of the board are the optional LED's, receiver learning push button and the receiver antenna connector. After a Design Rule Check (DRC) the PCB is ready to send for manufacture.

The PCB was produced with a black solder mask as shown below. In addition the design is also Open Source Hardware.

Manufactured Rocket PCB
Manufactured Rocket PCB

PCB Population
On complex PCB's it is common to populate the power supply section, verify its operation, then populate specific sections of the circuit. With such as small board the entire population is completed in one sitting.

After population of the components and cleaning of the solder flux the board is given a brief visual examination. Compared to the usual lighter colour green solder mask, the black makes inspection of the board a touch more difficult. 

Populated Rocket PCB
Populated Rocket PCB

With the PCB loaded there are some power up checks and voltage levels to confirm.

Power Up
Powering the populated launcher board for the first time, the power supply is set to 12V with a current limit 50mA. The current limit is deliberately set to 50mA in the event there are any problems with the board.

Power Up Test of Rocket PCB
Power Up Test of Rocket PCB

The current reading on the power supply of 12mA is acceptable and a check of the 5V linear regulator output voltage shows 5.001V, so the board looks in order and programming can begin.

As a matter of interest the power supply voltage was lowered until the regulator dropped out of regulation. The regulator drop off was at 6.3V as shown on the supply.

Atmel Studio
For the initial coding of the launcher a basic state based scheme will be used. Ideally a task based solution would be implemented, possibly in the next board iteration when some smarts are added to the board.

Using the circuit as a reference for connections to the ATtiny micro, the physical inputs and outputs can be defined with some meaningful labels in the code. Hash defines or constants are used to make the code more understandable, examples for both shown below.

Software IO Definitions in Atmel Studio
Software IO Definitions in Atmel Studio

For the ATtiny clock the internal oscillator will be used at a speed of 8Mhz divided by 8 using the internal divider. To determine the fuse configuration it's over to the datasheet or open Atmel Studio, connect to the ATtiny using a device such as a JTAGICE3. Using the Device Programming window under the Tools menu the config can be verified before adding the fuse values into the code. Hands down this is far easier than accidentally disabling the serial programming through an incorrect setting and having to resort to other methods such as high voltage programming to restore the ATtiny.

Atmel Studio Fuse Configuration
Atmel Studio Fuse Configuration

The fuses can be defined in code to make programming a little simpler. Values for the fuse settings are implemented directly as shown in the fuse configuration above.

Atmel Studio Software Fuse Setup
Atmel Studio Software Fuse Setup

Control of the outputs is made through a basic state machine of sorts. This has three states:

Software State Machine Values
Software State Machine Values

There is a single port on the ATtiny, port B 0 to 5. The appropriate bit operators are used with the logical shift to firstly set the state of outputs to zero, OFF. Next the data direction, DDRB, is configured to change default inputs to outputs.

Port Setup in Atmel Studio
Port Setup in Atmel Studio

Even though the data direction register defaults pins to inputs the launch and cancel signals to the ATiny from the remote transmitter are configured as inputs. 

Similarly the one second buzzer on startup at the end of the setup routine is not required but is a good indication the system is running.  

The state machine is a simple routine that waits for the Launch button press, turns on a buzzer for a set period, 10 seconds, and during that period checks for the Cancel button signal. At the end of the set the launch output, igniter, is activated for a set period, 2 seconds.

State Machine Routine in Atmel Studio
State Machine Routine in Atmel Studio

Improvements for the above routine in the next board revision would include mapping at least the Cancel button to an interrupt and using timers instead of a wasteful delay. [EDIT] Correction in image above, turning the buzzer off (PORTB &= ~Buzzer) moved.[EDIT]

Finally is the slim mainline that calls the port setup and then continuously executes the state control routine.

Mainline in Atmel Studio
Mainline in Atmel Studio

With the JTAGICE3 connected to the Launcher PCB, Atmel Studio code compiled and the ATtiny can be programmed.

Output Window in Atmel Studio
Output Window in Atmel Studio 

Two items of note are the program and data usage of the Atmel Studio build, 3.7% of program and 0.8% of data memory. This will be used for comparison against the Arduino build. Before proceeding with porting the Atmel Studio code to operate with Arduino some testing.


Testing
Operational testing is just confirm that the code behaves itself and when buttons are pressed the correct outputs turn ON. Everything checks out fine so it's time to perform some load test on the igniter output.

Initially with a small load of 100R and the power supply on 12V with a 3A current limit the output measures a little under 12V DC with the multimeter.

Connecting up 10R resistor to the igniter output and load testing shows that the MOSFET is not conducting fully. A meagre 0.25mA is measured by the power supply when the igniter output switch on whereas close to 1.2A is expected.

Connecting the CRO to the gate of the MOSFET during a load test the gate to source voltage (Vgs) is measured. The Vgs is around 3.6V which is above the minimum Vgs turn on threshold but not above the maximum of 3.7V. A quick change of the gate pull-down from 100k to 1M yields almost 5V during tests.


Capture - MOSFET Turn ON
Capture - MOSFET Turn ON

The image above shows the gate voltage on the yellow trace and the MOSFET drain to ground (GND). Note the upper horizontal cursor on the yellow trace shows the threshold Vgs(th) for the gate.

As final confirmation of output timing, the bottom image shows the MOSFET gate voltage on the yellow trace and drain to GND on the green trace, whilst the igniter output is activated.


Capture - Igniter Output Timing
 Capture - Igniter Output Timing

Operationally the launcher is working, now how about finally porting this to Arduino!

Arduino Port
First up the ATtiny must be added to the Arduino software. With the built-in Board Manager this is straightforward, see High-Low Tech page for details.

Next up the loading the boot-loader onto the ATtiny85 from Arduino can take some massaging of the USB drivers. After installing the Arduino software and following the steps on High-Low Tech there were still some issues with the AVRSIP mkII being recognised. The Arduino forums have some suggestions and following one thread that suggests a replacement driver, libusb-win32-bin-1.2.6.0.zip, from http://sourceforge.net/projects/libusb-win32 which worked perfectly.

Using the Arduino Burn Bootloader command the ATtiny is furnished with the boot-loader software.

After creating a new sketch the existing C from Atmel can be copied into Arduino. This will not compile as is so some minor changes are required. 

Starting with the includes from Atmel Studio, these are deleted from the Arduino sketch.

Arduino IO
Again here no preference for port IO naming. Arduino offers a convention which is port name then number, eg PB0, as defined in the Pins header file for the ATtiny.

Arduino IO Definitions
Arduino IO Definitions

The states machine and program variables remain unchanged.

Arduino State Machine Values
Arduino State Machine Values

In the Setup routine, same function name is kept, some of the statements are changed to use the Arduino direction and output types.

Arduino Port Setup
Arduino Port Setup

For the Atmel Studio project bit manipulation of the port and direction registers was implemented for setup, however Arduino adds another level of ease to this process using Digital writes and Pin modes, as shown above. Similarly the delay routine is renamed to simply delay.

Arduino Main Loop

The Arduino loop can be considered the equivalent of main for the Atmel Studio project. This main function only needs to be renamed to loop in this instance.

Lastly is the launch control where the bulk of the changes must be made.

Arduino State Machine
Arduino State Machine

The function name and variables remain unchanged for the state machine however the reads of the port pins use the Arduino digitalRead function and writes digitalWrite.

For comparison purposes, of memory usage, the ATtiny flash memory has been programmed with the Atmel Studio build and then downloaded as a HEX file for Atmel Studio. The Arduino software was used to burn the bootloader into the ATtiny and then the Arduino sketch was uploaded. By comparing the two HEX files it is easy to see the overhead that the Arduino platform. In the next release of the launcher a comparison without the bootloader will be made.

Up next some photos of the launcher as soon as the weather breaks...

Improvements
To improve the launcher design some of the following items will be considered for the second revision:
  1. Reverse Battery Protection: To prevent false launches when a MOSFET is used, when a engine is fitted and the battery is wired in reverse a high current diode with a low forward voltage will be added to the circuit
  2. Igniter Connected: In cases where the launch was cancelled or simply did not happen a load sense addition will be made to the circuit to show if the igniter is still connected
  3. Low Battery: A solution using a standalone comparator and LED can indicate that the battery has dropped below a defined threshold
  4. Alternative Transmitter and Receiver: Allow an alternative to the communications hardware used
  5. Improve User Interface: Allow for interfacing to an LCD to provide more information and control. Will require a new microcontroller for the additional features.
Design of the next revision in the Revision 2 post.

Downloads for the Project

Schematic
PCB Altium Viewer/Designer
Atmel Studio Project
Arduino Sketch
Atmel Studio Hex File
Arduino Hex file