Pulsin with RC receiver
When reading the stick position from an RC receiver.· Am I supposed to use a resistor inline?· I setup a SX chip so it reads in the pulsin from the channel.· What is happens most of the time is that it makes a camera take a picture when the stick is at a certain position.· If the stick is high it takes 3 pictures in rapid succession.· If it is mid stick, the camera takes a picture every 1 second.· If the stick is low it doesn't take a picture.· The other stick on the controller moves a pan and tilt mechinism.
The problem comes up when it's attached to the pan and tilt with the other channels driving servos.· It works fine in low, and mid stick, but when I select High stick it will do the 3 rapid pics once, then seems to shut off.· Disconnecting the unit and reconnecting it doesn't work unless I wait a couple minutes.·
My thoughts were, either I'm stressing the servos and the battery pack for the servos is going too low in voltage so that it doesn't create pulses for the sx chip to see or the motors when speeding up and slowing down are sending spikes back though the receiver and into the sx chip.· The SX chip is only connected to the pulse line, and the ground so I didn't see how that would effect this.
Of course on the bench without the other stuff it works fine.
Russ
·
The problem comes up when it's attached to the pan and tilt with the other channels driving servos.· It works fine in low, and mid stick, but when I select High stick it will do the 3 rapid pics once, then seems to shut off.· Disconnecting the unit and reconnecting it doesn't work unless I wait a couple minutes.·
My thoughts were, either I'm stressing the servos and the battery pack for the servos is going too low in voltage so that it doesn't create pulses for the sx chip to see or the motors when speeding up and slowing down are sending spikes back though the receiver and into the sx chip.· The SX chip is only connected to the pulse line, and the ground so I didn't see how that would effect this.
Of course on the bench without the other stuff it works fine.
Russ
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
' =========================================================================
'
'·· File...... pwidth2
'·· Purpose... Trigger a camera shutter
'·· Author.... Russell Wizinsky
'·· E-mail.... Russw@professorwiz.com
'·· Major Revision and program redone by JonnyMac - SX Forum / Parallax
'·· Started...8/1/08
'·· Updated...8/31/08
'
' =========================================================================
'
' Program Description
'
' The purpose of the program is to trigger a the shutter of a camera
' dependent on the movement of a remote control for Airplanes / Helis
' Down position will be camera off / standby
' Midstick will be single shot
' Top Stick will be 3 round bursts
' After all camera shots there will be a 1 second delay
'
' Conditional Compilation Symbols
'
'
' Device Settings
'
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42
FREQ··········· 4_000_000
ID············· "CLICKS"
'
' I/O Pins
'
Led7··········· PIN···· RC.7 OUTPUT
Led6··········· PIN···· RC.6 OUTPUT
Led5··········· PIN···· RC.5 OUTPUT
Led4··········· PIN···· RC.4 OUTPUT
Led1··········· PIN···· RC.0 OUTPUT
Camera········· PIN···· RB.4 OUTPUT
Receiver······· PIN···· RC.1 INPUT
'
' Constants
'
IsOn··········· CON···· 1
IsOff·········· CON···· 0
'
' Variables
'
pWidth········· VAR···· Byte
' =========================================================================
' INTERRUPT
' =========================================================================
' RETURNINT
' =========================================================================
· PROGRAM Start
' =========================================================================
'
' Subroutine / Function Declarations
'
DELAY_MS······· SUB···· 1, 2
PIC1··········· SUB···· 0
PIC3··········· SUB···· 0
CLICKS········· SUB···· 0
'
' Program Code
'
Start:
· PLP_A = %00000000
· PLP_B = %00010000
· PLP_C = %11110011
Main:
· PULSIN Receiver, 1, pWidth
· IF pWidth > 200 THEN
··· PIC3
· ELSEIF pWidth > 100 THEN
··· PIC1
· ENDIF
· DELAY_MS 1000
· GOTO Main
'
' Subroutine / Function Code
'
' Use: DELAY_MS duration
' -- shell for PAUSE
SUB DELAY_MS
· IF __PARAMCNT = 1 THEN
··· __WPARAM12_MSB = 0
· ENDIF
· PAUSE __WPARAM12
· ENDSUB
'
SUB PIC1
· CLICKS
· ENDSUB
'
SUB PIC3
· CLICKS
· CLICKS
· CLICKS
· ENDSUB
'
SUB CLICKS
· Led4 = IsOn
· Led5 = IsOn
· Led6 = IsOn
· Led7 = IsOn
· Camera = IsOn
· DELAY_MS 300
· Led4 = IsOff
· Led5 = IsOff
· Led6 = IsOff
· Led7 = IsOff
· Camera = IsOff
· DELAY_MS 200
· ENDSUB
'
' User Data
'