3 way switch on tx..want to 3 way switch on rx end
- robocog
- Topic Author
- Offline
Less
More
03 May 2015 21:56 #32020
by robocog
3 way switch on tx..want to 3 way switch on rx end was created by robocog
I have a Devo 7e
Done the 2x 3 way switch
All works great, have setup both to output -100 / 0 / +100
Using the first switch to control flight modes on a CC3D flight controller
I hooked up a servo to the other 3 way switches channel and it does as expected, corresponding to the switches position
I now fancy trying to setup a 3 way power switch at the receiver end for controlling 2 devices..possibly toggling the outputs
Centre off
Push switch up, it switches circuit A on or off (Toggled)
Push down it toggles circuit B on or off
physically mounting the servo and arranging the servo horn to push toggling push switches could work...but I'm sure there is a nicer neater electronically superior method to achieve what I'm after and lighter too!
I have seen videos of people gutting a servo and hooking up the motor wires to turn on LEDs and I'm sure a couple of diodes doing this method would work, but wouldn't be toggled leaving me only being able to have circuit A or B at any one time
Open to ideas - I know there are some electronics gurus on here
Thanks in advance for any pointers
Regards
Rob
Done the 2x 3 way switch
All works great, have setup both to output -100 / 0 / +100
Using the first switch to control flight modes on a CC3D flight controller
I hooked up a servo to the other 3 way switches channel and it does as expected, corresponding to the switches position
I now fancy trying to setup a 3 way power switch at the receiver end for controlling 2 devices..possibly toggling the outputs
Centre off
Push switch up, it switches circuit A on or off (Toggled)
Push down it toggles circuit B on or off
physically mounting the servo and arranging the servo horn to push toggling push switches could work...but I'm sure there is a nicer neater electronically superior method to achieve what I'm after and lighter too!
I have seen videos of people gutting a servo and hooking up the motor wires to turn on LEDs and I'm sure a couple of diodes doing this method would work, but wouldn't be toggled leaving me only being able to have circuit A or B at any one time
Open to ideas - I know there are some electronics gurus on here
Thanks in advance for any pointers
Regards
Rob
Please Log in or Create an account to join the conversation.
- mwm
- Offline
04 May 2015 01:10 #32032
by mwm
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Replied by mwm on topic 3 way switch on tx..want to 3 way switch on rx end
I'm not an electronics guru, but I've tackled this kind of problem before.
There are a number of "rc switch" gadgets available. There may even be some that will do exactly what you want. Or like you say, you could gut a servo for parts.
But all those options are less flexible and cost more than using a cheap arduino board or similar. US shipped they are 3 to 4 dollars each, and if you're willing to wait for them from china they're a buck cheaper. I buy six-packs from china when I use the next-to-last one.
You'll also need a programmer since they don't have a USB port. That costs about as much as the micro. You can get a nano if you don't want to get a programmer, but then you've got the USB port at the RX end, and the nano costs more.
You then get to write the code that reads the servo signal from the Rx (it's straightforward if you only have one) and use it to toggle more switches than you have controls for on the Tx.
There are a number of "rc switch" gadgets available. There may even be some that will do exactly what you want. Or like you say, you could gut a servo for parts.
But all those options are less flexible and cost more than using a cheap arduino board or similar. US shipped they are 3 to 4 dollars each, and if you're willing to wait for them from china they're a buck cheaper. I buy six-packs from china when I use the next-to-last one.
You'll also need a programmer since they don't have a USB port. That costs about as much as the micro. You can get a nano if you don't want to get a programmer, but then you've got the USB port at the RX end, and the nano costs more.
You then get to write the code that reads the servo signal from the Rx (it's straightforward if you only have one) and use it to toggle more switches than you have controls for on the Tx.
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Please Log in or Create an account to join the conversation.
- robocog
- Topic Author
- Offline
04 May 2015 07:55 #32051
by robocog
Replied by robocog on topic 3 way switch on tx..want to 3 way switch on rx end
Seems pretty full on
I have also been looking at using a pic, but both methods seem like a pretty steep learning curve
I did mess with pics years ago and should have a programmer and some chips here still somewhere
BUT it was for a project where the code and schematics were already well written and documented, so I was just following a recipie!
(much like putting Deviation on the TX and adding the switches and modules!)
MUCH different to being let loose in the kitchen with just raw ingredients and a wild imagination
I have my doubts I could pull it off with a pic or arduino without a lot of hand holding, but finding for a pre built plug and play solution is not coming back with many google hits (I'm possibly not entering the right search terms)
I'm surprised I'm not finding an abundance of info :/
Regards
Rob
I have also been looking at using a pic, but both methods seem like a pretty steep learning curve
I did mess with pics years ago and should have a programmer and some chips here still somewhere
BUT it was for a project where the code and schematics were already well written and documented, so I was just following a recipie!
(much like putting Deviation on the TX and adding the switches and modules!)
MUCH different to being let loose in the kitchen with just raw ingredients and a wild imagination
I have my doubts I could pull it off with a pic or arduino without a lot of hand holding, but finding for a pre built plug and play solution is not coming back with many google hits (I'm possibly not entering the right search terms)
I'm surprised I'm not finding an abundance of info :/
Regards
Rob
Please Log in or Create an account to join the conversation.
- robocog
- Topic Author
- Offline
04 May 2015 09:48 #32055
by robocog
Replied by robocog on topic 3 way switch on tx..want to 3 way switch on rx end
Have just purchased a picaxe kit as it looks easy enough from the outside
Hoping I can do something useful with it
Will report back if its of interest to others
Regards
Rob
Hoping I can do something useful with it
Will report back if its of interest to others
Regards
Rob
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
04 May 2015 15:07 #32065
by Cereal_Killer
Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7
What I do in real life: rivergoequestrian.com/
Replied by Cereal_Killer on topic 3 way switch on tx..want to 3 way switch on rx end
Good luck man. If you arnt able to get it on the PICAXE don't give up, switch to AVR (and/or arduino), the code, especially the initialization / setup is easier than on PIC IMO.
Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7
What I do in real life: rivergoequestrian.com/
Please Log in or Create an account to join the conversation.
- mwm
- Offline
04 May 2015 20:53 - 04 May 2015 20:56 #32082
by mwm
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Replied by mwm on topic 3 way switch on tx..want to 3 way switch on rx end
Well, here's a switch that does exactly what you want:
www.robotmarketplace.com/products/0-DGSW5.html
. But note that $18 price tag!
Hobbyking has some options as well: www.hobbyking.com/hobbyking/store/RC_PRO...er+controlled+switch
If you get stuck with the coding, don't hesitate to ask. I'm not a PIC programmer, but having an arduino solution in hand might help.
Hobbyking has some options as well: www.hobbyking.com/hobbyking/store/RC_PRO...er+controlled+switch
If you get stuck with the coding, don't hesitate to ask. I'm not a PIC programmer, but having an arduino solution in hand might help.
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Last edit: 04 May 2015 20:56 by mwm.
Please Log in or Create an account to join the conversation.
- robocog
- Topic Author
- Offline
04 May 2015 21:15 #32084
by robocog
Replied by robocog on topic 3 way switch on tx..want to 3 way switch on rx end
Hmmm, thanks for that
I have managed to have a bit of a tinker with the Picaxe software and have got the following code to do what I want when the virtual switches are momentarily flipped or held in
switch 1 pushed momentarily = output 1 on and latched (simulating flipping the TX 3 way switch to up and then back the center)
switch 1 held in permanently = output number 1 flashes on and off (simulating flipping the TX 3 way switch to up and leaving it there)
switch 2 pushed momentarily = output 2 toggles to on and latched (simulating flipping the TX 3 way switch to down and then back the center)
switch 2 held permanently = output 2 flashes on and off (simulating flipping the TX 3 way switch to down and leaving it there)
Depending on where either led is in the flashing cycle when the button is held in, when the switch is released (flipping the toggle back to center on the TX) determines whether the output is left on off or flashing
Only one output can flash at any one time, both can be on or off independently
I have some code that gets the RX input and I have had a play with it and just working out whats doing what to get a hi low and neutral from it to work with the toggle switch code
The toggle switch code...
main:do
if pin3=1 then goto ch1' detect the button Channel1 push (to be replaced by pulsin being high)
if pin4=1 then goto ch2' detect the button Channel2 push (to be replaced by pulsin being low)
loop
ch1:
if b0=0 then
high 2
b0=1
else
low 2
b0=0
endif
goto main
ch2:
if b1=0 then
high 1
b1=1
else
low 1
b1=0
endif
goto main
The RX code
'Radio control 2 channel switch using PICAXE-08 or 08M
'Cycles ChA-on ChB-on ChB-off ChA-off each time RC input changes from hi to lo or vice versa
'Either channel can operate in latched or unlatched operation.
'Change the values of ThresholdA and ThresholdB as desired to change the switching points.
'PICAXE-08 connections are:
' Leg 1 +5V
' Leg 2 (Serial in) Tie to Ground through 10K resistor
' Leg 3 (In4/Out4) NC
' Leg 4 (In3) NC
' Leg 5 (In2/Out2) Pulse input from radio receiver
' Leg 6 (In1/Out1) Channel B output
' Leg 7 (Out0/Serial Out) Channel A output (must disconnect the programming cable when running program)
' Leg 8 Ground
symbol OutA=0 'Name channel A output pin (leg7)
symbol OutB=1 'Name channel B output pin (leg6)
symbol Pulse_Width=w0 'Name measured input pulse width
symbol Prev_Pulse_Width=w1 'Name previous measured input pulse width
symbol Status=b4 'Name cycle status (0 to 3)
symbol Pulse_In=2 'Name pulse input pin (leg5)
let dirs=%00000011 'Set pins 0 & 1 to outputs, rest to inputs
low OutA 'Set channel A output low initially
low OutB 'Set channel B output low initially
Status=0
'Set status 0 initially
startagn:
Pause 500 'Wait for 1/2 second initially
pulsin Pulse_In,1,Pulse_Width 'Measure and store input pulse
if Pulse_Width<50 or Pulse_Width>250 then startagn 'Go back if no valid pulse detected
Start:
Prev_Pulse_Width=Pulse_Width
pulsin Pulse_In,1,Pulse_Width 'Measure and store input pulse
if Pulse_Width<50 or Pulse_Width>250 then startagn 'Go back if no valid pulse detected
if Pulse_Width>150 and Prev_Pulse_Width<150 then Increment
if Pulse_Width<150 and Prev_Pulse_Width>150 then Increment
goto start
Increment:
Status=Status+1 'Increment Status after a low/high or high/low pulse change
if Status<4 then Cycle 'Recycle to status 0 if status gets to 4
Status=0
Cycle:
lookup Status,(%00000000,%00000001,%00000011,%00000001),b5
let pins=b5 'Turn on/off outputs A & B according to status
goto start
Plenty for me to chew on
Regards
Rob
I have managed to have a bit of a tinker with the Picaxe software and have got the following code to do what I want when the virtual switches are momentarily flipped or held in
switch 1 pushed momentarily = output 1 on and latched (simulating flipping the TX 3 way switch to up and then back the center)
switch 1 held in permanently = output number 1 flashes on and off (simulating flipping the TX 3 way switch to up and leaving it there)
switch 2 pushed momentarily = output 2 toggles to on and latched (simulating flipping the TX 3 way switch to down and then back the center)
switch 2 held permanently = output 2 flashes on and off (simulating flipping the TX 3 way switch to down and leaving it there)
Depending on where either led is in the flashing cycle when the button is held in, when the switch is released (flipping the toggle back to center on the TX) determines whether the output is left on off or flashing
Only one output can flash at any one time, both can be on or off independently
I have some code that gets the RX input and I have had a play with it and just working out whats doing what to get a hi low and neutral from it to work with the toggle switch code
The toggle switch code...
main:do
if pin3=1 then goto ch1' detect the button Channel1 push (to be replaced by pulsin being high)
if pin4=1 then goto ch2' detect the button Channel2 push (to be replaced by pulsin being low)
loop
ch1:
if b0=0 then
high 2
b0=1
else
low 2
b0=0
endif
goto main
ch2:
if b1=0 then
high 1
b1=1
else
low 1
b1=0
endif
goto main
The RX code
'Radio control 2 channel switch using PICAXE-08 or 08M
'Cycles ChA-on ChB-on ChB-off ChA-off each time RC input changes from hi to lo or vice versa
'Either channel can operate in latched or unlatched operation.
'Change the values of ThresholdA and ThresholdB as desired to change the switching points.
'PICAXE-08 connections are:
' Leg 1 +5V
' Leg 2 (Serial in) Tie to Ground through 10K resistor
' Leg 3 (In4/Out4) NC
' Leg 4 (In3) NC
' Leg 5 (In2/Out2) Pulse input from radio receiver
' Leg 6 (In1/Out1) Channel B output
' Leg 7 (Out0/Serial Out) Channel A output (must disconnect the programming cable when running program)
' Leg 8 Ground
symbol OutA=0 'Name channel A output pin (leg7)
symbol OutB=1 'Name channel B output pin (leg6)
symbol Pulse_Width=w0 'Name measured input pulse width
symbol Prev_Pulse_Width=w1 'Name previous measured input pulse width
symbol Status=b4 'Name cycle status (0 to 3)
symbol Pulse_In=2 'Name pulse input pin (leg5)
let dirs=%00000011 'Set pins 0 & 1 to outputs, rest to inputs
low OutA 'Set channel A output low initially
low OutB 'Set channel B output low initially
Status=0
'Set status 0 initially
startagn:
Pause 500 'Wait for 1/2 second initially
pulsin Pulse_In,1,Pulse_Width 'Measure and store input pulse
if Pulse_Width<50 or Pulse_Width>250 then startagn 'Go back if no valid pulse detected
Start:
Prev_Pulse_Width=Pulse_Width
pulsin Pulse_In,1,Pulse_Width 'Measure and store input pulse
if Pulse_Width<50 or Pulse_Width>250 then startagn 'Go back if no valid pulse detected
if Pulse_Width>150 and Prev_Pulse_Width<150 then Increment
if Pulse_Width<150 and Prev_Pulse_Width>150 then Increment
goto start
Increment:
Status=Status+1 'Increment Status after a low/high or high/low pulse change
if Status<4 then Cycle 'Recycle to status 0 if status gets to 4
Status=0
Cycle:
lookup Status,(%00000000,%00000001,%00000011,%00000001),b5
let pins=b5 'Turn on/off outputs A & B according to status
goto start
Plenty for me to chew on
Regards
Rob
Please Log in or Create an account to join the conversation.
- robocog
- Topic Author
- Offline
06 Jun 2015 21:34 #33560
by robocog
Replied by robocog on topic 3 way switch on tx..want to 3 way switch on rx end
Not got any further with this - despite it being an interesting little project
Managed to get pretty much everything I could wish for working on the quad and not bothered with LEDS as I'm more interested in trying to fly FPV so its only a drain on the batts
However - tonight I managed to do something I wasn't sure was possible
I hooked up a lost vehicle beeper to the CC3D flight controller on a spare output a while back
all good as it could be operated by using one of the 3 way toggle switch positions
I realized if I turned off the TX, it didn't set the beeper off (so useless as far as what happens if it flies out of range into bushes/long grass)
There seemed to be no way of getting the CC3D flight controller to use the lack of signal to trigger the beeper
I had already setup a fail safe for the throttle, in event of TX power loss, signal loss or a flyaway situation
so /if/ I loose control at least it will not burn out the motors and hopefully it should limit damage and range I need to walk to find it
I decided to have a go at setting a fail safe value on the 3 way toggle - took me several attempts at getting the orange RX to accept and acknowledge it - but it works!!
if I toggle the beeper switch with the TX on - it beeps (as it did before)
If I power down the TX , the blades stop spinning ...and it beeps!
I guess if I also go out of range it /should/ do the same
I'm sure I read a thread on here saying the orange RX and Deviated Devo will only allow failsafe on the throttle channel?
If the OP who wanted to do the same in the thread where I read this is still on here, it involved using the bind plug after setting the failsafe values on the TX and re inserting the bind plug and powering everything off and back on again
I cannot find the thread to try and nudge the fellow
Regards
Rob
Managed to get pretty much everything I could wish for working on the quad and not bothered with LEDS as I'm more interested in trying to fly FPV so its only a drain on the batts
However - tonight I managed to do something I wasn't sure was possible
I hooked up a lost vehicle beeper to the CC3D flight controller on a spare output a while back
all good as it could be operated by using one of the 3 way toggle switch positions
I realized if I turned off the TX, it didn't set the beeper off (so useless as far as what happens if it flies out of range into bushes/long grass)
There seemed to be no way of getting the CC3D flight controller to use the lack of signal to trigger the beeper
I had already setup a fail safe for the throttle, in event of TX power loss, signal loss or a flyaway situation
so /if/ I loose control at least it will not burn out the motors and hopefully it should limit damage and range I need to walk to find it
I decided to have a go at setting a fail safe value on the 3 way toggle - took me several attempts at getting the orange RX to accept and acknowledge it - but it works!!
if I toggle the beeper switch with the TX on - it beeps (as it did before)
If I power down the TX , the blades stop spinning ...and it beeps!
I guess if I also go out of range it /should/ do the same
I'm sure I read a thread on here saying the orange RX and Deviated Devo will only allow failsafe on the throttle channel?
If the OP who wanted to do the same in the thread where I read this is still on here, it involved using the bind plug after setting the failsafe values on the TX and re inserting the bind plug and powering everything off and back on again
I cannot find the thread to try and nudge the fellow
Regards
Rob
Please Log in or Create an account to join the conversation.
Time to create page: 0.060 seconds
- Home
- Forum
- General
- General Discussions
- 3 way switch on tx..want to 3 way switch on rx end