Andres Rodriguez
New Member
The purpose of this circuit is to ignite the glowplug in an RC airplane and also to sound a buzzer if the transmitter is turned off.
The glow should ignite at about 1/4 throttle (pulses about 100). I am reading the throttle signal in pin3. The trigger point will be set on the workbench using a trim pot and reading ADC on pin 2. Signal from a different channel will be used to fine tune the trigger point (if neccessary) from the transmitter without opening the airplane. If the plane is lost a buzzer will sound when the transmitter is off and the pulses from both channels go to zero.
I would appreciate any comments or suggestions regarding the circuit or the code. One of my doubts is the value of the trim pot considering that the voltage is supplied from the 1.2V battery that drives the glow plug. If that voltage is too low, I could use 4.8V from the receiver battery. But in that case I would like to know the current because I am concerned about running out of power for the receiver and servos.
The glow should ignite at about 1/4 throttle (pulses about 100). I am reading the throttle signal in pin3. The trigger point will be set on the workbench using a trim pot and reading ADC on pin 2. Signal from a different channel will be used to fine tune the trigger point (if neccessary) from the transmitter without opening the airplane. If the plane is lost a buzzer will sound when the transmitter is off and the pulses from both channels go to zero.
I would appreciate any comments or suggestions regarding the circuit or the code. One of my doubts is the value of the trim pot considering that the voltage is supplied from the 1.2V battery that drives the glow plug. If that voltage is too low, I could use 4.8V from the receiver battery. But in that case I would like to know the current because I am concerned about running out of power for the receiver and servos.
Code:
; Target PICAXE:8M
; *******************************
'Ports
Symbol Thr=input3
Symbol Adj=input1
Symbol Trm=input2
Symbol Buzz=output2
Symbol Glow=output4
'Variables
Symbol Th=b0
Symbol Ad=b1
Symbol Tr=W1
Th=0
Ad=0
Tr=0
Low Glow
Low Buzz
Main:
readadc10 2,Tr
pulsin 3,1,Th
pulsin 1,1,Ad
If Th=0 or Ad=0 then goto Alarm
Ad=Ad/4
Tr=Tr/4
Th=Th-Ad
Th=Th-Tr
If Th<100 then goto Ignite
Low Glow
goto Main
Alarm:
high Buzz
Pause 500
Low Buzz
Pause 100
High Buzz
Pause 500
Low Buzz
Pause 100
High Buzz
Pause 500
Low Buzz
Pause 100
High Buzz
Pause 1500
Low Buzz
Goto Main
Ignite:
High Glow
Goto Main
Attachments
-
15.6 KB Views: 69