View Full Version : Discussion Computer/RX switchover circuit
wandroid
Jan 14, 2008, 02:31 PM
I've been playing around with a NewMicros IsoPod. My goal is to use
a SparkFun single axis IMU to control only the pitch axis of a delta-wing using the Kalman filter from the Sourceforge autopilot project. At the moment I'm just sampling the IMU and sending the accelerometer and gyro data up to a Mac Mini via the serial port. This is just a bench test and reference platform to get the filter working using the original C code under Xcode in OSX. The idea is that once I get the filter going, I'll implement the Kalman code in IsoMax on the IsoPod using the original C code on the Mac as a reference for debugging.
As a next step, I want to fly the IsoPod with an app that simply echos the PWM from the RX to the servos as kind of a simple fly-by-wire mode. I'll just sample the PWM on two input pins using timer/capture mode, and stuff the values to the PWM registers to control the servos. I think I really need to
have a fail-safe for this, especially when I start testing actual control loop
code. I'd like to use the 'Gear' channel on my DX7 system to switch the system over so that I can connect my servos directly back to the RX in case the controller is completely hosed. I want to use a pair of 2:1 muxes such that the muxes select aileron and elevator PWM either from the RX directly, or from the IsoPod. the muxes to be steered by the 'Gear' switch on my TX. My problem is in getting from the gear channel PWM to a steady-state signal for steering the muxes. I think I've figured out how to do this with a 555 timer and set/reset flop, but I'm wondering if there's a simpler solution. I should think the issue of using a spare channel to create a simple on/off signal must be one that comes up a lot. Anyone know of a simple way to do this? No mechanical solutions please 8) I'd like to do something more elegant than a servo and a switch.
zlite
Jan 14, 2008, 03:30 PM
Could the PicoSwitch (http://www.dimensionengineering.com/PicoSwitch.htm) do the trick? It could simply switch on/off a RC bypass circuit.
wandroid
Jan 14, 2008, 04:52 PM
I think that would do it. I was thinking of something that's all electronic
though. I don't need to switch a lot of current. They mention an LED to
indicate when the switch is open/closed. Could probably grab the signal
that turns on the LED. Thanks. That would certainly be a quick solution.
zlite
Jan 14, 2008, 05:02 PM
I have one; it's tiny. According the packaging, "LED flashing means no radio link, LED off means switch is off, LED on means switch is on"
jbeanelliott
Jan 14, 2008, 07:12 PM
You might be somewhat interested in the related thread about servo/receiver mux circuits titled "switch between manual/autopilot?" at:
http://www.rcgroups.com/forums/showthread.php?t=360746
zlite
Jan 14, 2008, 10:50 PM
Or just buy it already made (http://reactivetechnologies.com/RxMux.html) from Reactive Technologies. Not cheap: $99!
danstrider
Jan 15, 2008, 08:42 AM
$99 is an insurance policy though ... putting a circuit inbetween the servos and receiver is really scary if you think about it. I have flown the RxMux boards for several years without a failure and can confidently say every time I hit the switch, I get control back. Even for a $100 airplane, if the RxMux saves the homebrew circuit from accidentally crashing the airplane, then it already paid for itself.
wandroid, there are certainly other, cheaper circuits on the thread that Jbeanelliot listed. Just test the pudding out of whatever you eventually use (and definitely post about it too)!
Fun sounding project, cheers!
Dan
zlite
Jan 15, 2008, 10:26 AM
Hugo Vincent of the Albatross project in NZ have released an awesome-looking open source fail-safe/RxMux board (http://open.grcnz.com/trac/servo-switch/wiki). Can even datalog Rx commands...
clolson
Jan 15, 2008, 01:06 PM
$99 is an insurance policy though ... putting a circuit inbetween the servos and receiver is really scary if you think about it. I have flown the RxMux boards for several years without a failure and can confidently say every time I hit the switch, I get control back. Even for a $100 airplane, if the RxMux saves the homebrew circuit from accidentally crashing the airplane, then it already paid for itself.
wandroid, there are certainly other, cheaper circuits on the thread that Jbeanelliot listed. Just test the pudding out of whatever you eventually use (and definitely post about it too)!
Fun sounding project, cheers!
Dan
I have to 2nd Dan's words. I've used 3 of the RxMux boards and they have worked great and been rock solid. I highly recommend them for switching between manual flight and computer control.
Curt.
clolson
Jan 15, 2008, 01:22 PM
Hugo Vincent of the Albatross project in NZ have released an awesome-looking open source fail-safe/RxMux board (http://open.grcnz.com/trac/servo-switch/wiki). Can even datalog Rx commands...
This does look very interesting. I really like the concept of mixing in some intelligence for data logging or driving servos via a serial input. Are these available for purchase, or do you have to build them yourself?
Thanks,
Curt.
zlite
Jan 15, 2008, 01:31 PM
I think you have to build them youself, but the Eagle files and other necessary stuff is there on the site. Maybe one of us should see if we can get a group order together and send the board files off to a fab? They typically don't work in units of less than 10. Or, if someone wants to build the whole thing and sell them, I can check with Hugo if he's ok with that (I suspect he would be).
wandroid
Jan 15, 2008, 05:39 PM
Wow! Didn't expect so many responses. Figures I'd check just after finishing
schematic capture of my own attempt. Also did a block diagram that I've
pasted in here. Now not sure if I want to roll-my-own-or not. Always wanted
to try prototyping a single layer SMT board. Will probably at least breadboard
it to see if it works. Will have to try it with an ESC and motor to see what the
noise looks like. The downstream 5V side of the ESC should be pretty clean.
I just finished a schematic using a 74HC157 for the muxes. Don't want to
post it until I see if it works.
wandroid
Jan 15, 2008, 05:42 PM
Well, thought I attached a PDF. I did the 'upload' from the menu. Guess it
doesn't work the way I thought. Haven't done many posts on RCGroups. I
need to figure out what that upload did.
If anyone is interested in the diagram I'll e-mail it, unless I can get the
pdf of jpg post to work.
The idea for my implementation comes from the first circuit shown at:
http://www.discovercircuits.com/DJ-Circuits/oneshots.htm
I'm using the second stage of this circuit, just an edge triggered one-shot.
I'm clocking the second half of the 4013 with the ~Q output of this
one-shot to sample the original RX 'gear' signal on the D input. If the
signal from the RX lasts longer than the 1.5 ms one shot, it clocks in a 1,
else a 0. The latched signal from this second flop is used to drive the mux
select. Looking at the ready-made unit, I suspect it's similar.
dmgoedde
Jan 16, 2008, 12:18 AM
Or just buy it already made (http://reactivetechnologies.com/RxMux.html) from Reactive Technologies. Not cheap: $99!$99!!! Dang, this is another thing that is a subset of what I have made for AttoPilot, and some company is charging $99 for it. I see the mention of an open-source version, though I am tempted to make up a dedicated prototype, get a tester or two if anyone willing, then sell them for = or < than what people can make them for themself (counting the time and trouble). Any takers? There is no reason at all this should cost more than $40 in my opinion. How about 15 inputs, 1 control input, and 15 outputs?
zlite
Jan 16, 2008, 09:18 AM
Any takers? There is no reason at all this should cost more than $40 in my opinion. How about 15 inputs, 1 control input, and 15 outputs?
You've got at least one taker here! I'll bet we could drum up demand for a dozen or so.
CenTexFlyer
Jan 16, 2008, 11:47 AM
I would go for one
wandroid
Jan 16, 2008, 03:21 PM
$99!!! Dang, this is another thing that is a subset of what I have made for AttoPilot, and some company is charging $99 for it. I see the mention of an open-source version, though I am tempted to make up a dedicated prototype, get a tester or two if anyone willing, then sell them for = or < than what people can make them for themself (counting the time and trouble). Any takers? There is no reason at all this should cost more than $40 in my opinion. How about 15 inputs, 1 control input, and 15 outputs?
I'd be willing to test, although I'm going to go ahead with my own since I've
already laid out and routed a board. As for cost, the connectors have been
the most expensive part so far. I'm using 7 shrouded header surface mount
connectors. Bought 10 for 20 bucks. A 4013, 74HC157, diode, cap resistor
total less than $5.00. I can do four channels with the 74HC157. Pretty
sure I'm going to go with a through-hole board since all those connectors require
enough room that the DIP components aren't a problem. Also easier to route
all the connecter wires with through hole. I think the cost of professionally
fab'd boards would be the biggest expense. Not sure what it would be, I plan
to try my own proto PC board, the main reason I want to build my own.
dmgoedde
Jan 16, 2008, 08:13 PM
I'd be willing to test, although I'm going to go ahead with my own since I've
already laid out and routed a board. As for cost, the connectors have been
the most expensive part so far. I'm using 7 shrouded header surface mount
connectors. Bought 10 for 20 bucks. A 4013, 74HC157, diode, cap resistor
total less than $5.00. I can do four channels with the 74HC157. Pretty
sure I'm going to go with a through-hole board since all those connectors require
enough room that the DIP components aren't a problem. Also easier to route
all the connecter wires with through hole. I think the cost of professionally
fab'd boards would be the biggest expense. Not sure what it would be, I plan
to try my own proto PC board, the main reason I want to build my own.
You are sooo right. I looked into 8" male servo leads for my AttoPilot lately. Even buying in volume, pre-made 8" servo leads (male) are around $2.30 each!!! I could not talk the company down. Not to mention, these are HARD to find, so I had little leverage.
For PCB cost, I have used Pad2Pad, and it runs about $2 per square inch for 2-sided 1/16" PCB, though the turn-around time was very good, and quality PERFECT. I bought 25 PCBs, each about 3"x1", shipped cost was around $5.50 each.
Here is what I have on my mind for this RxMUX design:
Ability to use an external power supply to power the servos rather than from Rx, or can select to use Rx Vdd if you want.
I can do these hardware schemes:
1) 10 channels each A and B input, to 10 output, or
2) 7 each A,B,C input to 7 output, or
3) 6 each A,B,C,D input to 6 outputs.
Selection of input would be by position of an auxillary channel, AB design would be <1500us for A, >=1500us for B. The choices #2 and #3 could work via dial knob on your Tx.
Also, three modes of operation, selectable via a switch on the board, that is polled once at startup (to prevent switch movement during use to change operation mode):
1) "dumb" passthrough, high/low input is merely copied to output, resolution is << 1 us, like around 0.2us (maybe better, as this is a very simple and short loop in assembly code)
2) "smart" passthrough, for servo signals, sanity check that inputs are within sensible window of say 900 to 2100 us pulse width, if they are outside of allowed range, then they are not updated to the output, rather the last good signal's pulse width keeps coming out of the output. Resolution to better than 0.5us.
3) "smart" passthrough, PWM to PPM conversion. Overlapping input Rx pulses are seperated out such that outputs are seperated by 2.5ms on rising edge. Useful for things like FMA CoPilot on the receiving end. Resolution to better than 0.5us.
Seemless 3V/5V logic compatible on the input side, use with ANY Rx system that codes servo position in standard 1-2ms wide logic pulses.
A finished board with just plated through holes would be SIGNIFICANTLY cheaper to make and sell at reduced cost, it would be up to you to solder your own connectors. The plated through holes would be well-seperated, and easy to do by hand soldering. My components cost + PCB would be around $20-25. For time and effort, I think another $20, for the first 10 or so samples if the interest is there. More interest than that, and I'll be swamped.
The only caveat to my design, is that output logic would be 3.3V high. I just want to be up-front about that, BUT have had no issues with any testers of AttoPilot. It seems that all brands of speed controls and servos are 100% great with 3.3V logic.
Dean
zlite
Jan 16, 2008, 08:38 PM
Sounds great! Firmware preloaded, I assume...
dmgoedde
Jan 16, 2008, 09:30 PM
Sounds great! Firmware preloaded, I assume...
Yes. Ready to go out of the box.
wandroid
Jan 17, 2008, 11:57 PM
Sounds like you're going with a micro-controller solution. Sounds good!
Lotsof features. My project is quite a bit more modest. I'm just looking
to mux the elevons on my delta wing. I bread-boarderd the 4013 circuit
today and I'm happy with it. It's a very simple one-shot and flop as
described above to get the mux select signal. I tried only the pulse width
dectector/mux select logic today. I tried it on the bench with a bench supply
and signal generator. Found that I can run the supply and input down to 3 V
and it still can do the mux select. Also works up past 6V. I think it will have
pretty good supply and noise margn. With a .01 uf cap and 500K trim pot, I
was able to set the switchover pulsewidth dead-on at 1.5ms, and the margin
was less than .10 ms to detect on/off even with the wide power supply swing.
Bottom line is I think I can do 4 channels, reliable, no frills, for under two
bucks in components, not including connectors and PC board. The current
through-hole board is about 1.75" x 2.0", but I only have connectors
for two channels, a total of 7. The connectors are the three channels from the
RX aile, elev, and the gear channel for control, the aile an elev inputs
from the uC, and the two servo outputs. I'm thinking that if I do away
with the connectors and just solder on wires with male connectors, I can
make the board smaller and it would be a lot easier to fit it into various
planes. Probably cheaper too. The problem with that is that wires soldered
to a PC board are more prone to breakage.
You are sooo right. I looked into 8" male servo leads for my AttoPilot lately. Even buying in volume, pre-made 8" servo leads (male) are around $2.30 each!!! I could not talk the company down. Not to mention, these are HARD to find, so I had little leverage.
For PCB cost, I have used Pad2Pad, and it runs about $2 per square inch for 2-sided 1/16" PCB, though the turn-around time was very good, and quality PERFECT. I bought 25 PCBs, each about 3"x1", shipped cost was around $5.50 each.
Here is what I have on my mind for this RxMUX design:
Ability to use an external power supply to power the servos rather than from Rx, or can select to use Rx Vdd if you want.
I can do these hardware schemes:
1) 10 channels each A and B input, to 10 output, or
2) 7 each A,B,C input to 7 output, or
3) 6 each A,B,C,D input to 6 outputs.
Selection of input would be by position of an auxillary channel, AB design would be <1500us for A, >=1500us for B. The choices #2 and #3 could work via dial knob on your Tx.
Also, three modes of operation, selectable via a switch on the board, that is polled once at startup (to prevent switch movement during use to change operation mode):
1) "dumb" passthrough, high/low input is merely copied to output, resolution is << 1 us, like around 0.2us (maybe better, as this is a very simple and short loop in assembly code)
2) "smart" passthrough, for servo signals, sanity check that inputs are within sensible window of say 900 to 2100 us pulse width, if they are outside of allowed range, then they are not updated to the output, rather the last good signal's pulse width keeps coming out of the output. Resolution to better than 0.5us.
3) "smart" passthrough, PWM to PPM conversion. Overlapping input Rx pulses are seperated out such that outputs are seperated by 2.5ms on rising edge. Useful for things like FMA CoPilot on the receiving end. Resolution to better than 0.5us.
Seemless 3V/5V logic compatible on the input side, use with ANY Rx system that codes servo position in standard 1-2ms wide logic pulses.
A finished board with just plated through holes would be SIGNIFICANTLY cheaper to make and sell at reduced cost, it would be up to you to solder your own connectors. The plated through holes would be well-seperated, and easy to do by hand soldering. My components cost + PCB would be around $20-25. For time and effort, I think another $20, for the first 10 or so samples if the interest is there. More interest than that, and I'll be swamped.
The only caveat to my design, is that output logic would be 3.3V high. I just want to be up-front about that, BUT have had no issues with any testers of AttoPilot. It seems that all brands of speed controls and servos are 100% great with 3.3V logic.
Dean
zlite
Jan 18, 2008, 12:21 AM
Just got the Reactive Technologies board. Nice piece of gear, with good documentation. But to that $99 price tag ($108 with shipping), add the cost of ALL the connectors. It doesn't come with anything, soldered or not, and the part numbers of the connectors it suggests you buy to connect Rx or servos don't exist, or at least not within Google's universe. You'd think that for this kind of money they could at least throw in the most common connectors, ready for soldering if you want them.
Anybody know where you can buy the "Samtec TSW-108-25-G-T-RA" connectors recommended?
zik
Jan 18, 2008, 01:06 AM
Hi zlite,
Check out Samtec's site at: http://www.samtec.com/technical_specifications/overview.aspx?series=TSW
I haven't checked recently but they used to have a nice sampling policy. If you ask nicely you may be able to score a couple for free.
LukeZ
Jan 18, 2008, 01:59 AM
Dean, I'd be willing to buy one of your MUX boards if you decide to make them.
Luke
danstrider
Jan 18, 2008, 08:26 AM
I second zik. I requested a sample from samtec and got enough triple-right-angle to do two boards.
Dan
dmgoedde
Jan 20, 2008, 04:33 PM
Dean, I'd be willing to buy one of your MUX boards if you decide to make them.
Luke
Thanks LukeZ. Yes, I am making my MUX as described above. As pointed out, mine will be a microcontroller solution, and have many features built in. I can't even begin to approach the $2 solution using trim pots and caps, but I can beat the hell out of $99 + shipping and outperform the $99 unit, by using tested and proven code objects that have already been used in AttoPilot by many people.
I could provide a PCB with plated through-holes for the ins/outs, or for a nominal charge have connections of your choice already attached. The most expense would be associated with JR/Hitec style male servo leads, being around $2.50 each. Header pins are very cheap.
jbeanelliott
Jan 20, 2008, 05:25 PM
Any chance that a future version of the mux would have RS232 input and output? I am interested in a device that would input the PWM servo signals
and convert them to an RS232 data stream that my embedded computer could read and then output another RS232 data stream that would be converted to PWM servo outputs.
I would probably buy one of your MUX circuits as described now anyway.
-John Elliott (Seattle)
Thanks LukeZ. Yes, I am making my MUX as described above. As pointed out, mine will be a microcontroller solution, and have many features built in. I can't even begin to approach the $2 solution using trim pots and caps, but I can beat the hell out of $99 + shipping and outperform the $99 unit, by using tested and proven code objects that have already been used in AttoPilot by many people.
I could provide a PCB with plated through-holes for the ins/outs, or for a nominal charge have connections of your choice already attached. The most expense would be associated with JR/Hitec style male servo leads, being around $2.50 each. Header pins are very cheap.
dmgoedde
Jan 21, 2008, 01:16 AM
Got PCB layout done tonight.
Some quick specs:
Size: 33x40mm
PCB: 2-sided, components on 1 side, all SMD
4 position DIP selector, for 16 selectable modes of operation
8 A inputs, 8 B inputs
8 C ouputs
1 selector channel input (besides the 8 A and B inputs)
<1500us "A", >= 1500 "B" selected
LED for A and B each, to indicate clearly which is selected
Firmware upgradabale.
Rx logic 3/5V compatible automatically
Time resolution will be <1us on choices #2 and #3, and about 0.4us on choice #1.
Special consideration given to use of smallest SMD components.
Construction with professional PCBs, on 0.0625" FR4
Solder pasting + reflow
100% inspection and testing using test equipment
Three modes I have on my mind (RS232 is another great idea in this thread)
1) "dumb" logic passthrough
2) "smart" passthrough, sanity checked for servo signals to be within normal range, but incoming pulse order is preserved
3) like #2, but ouputs are ordered to not be overlapping (provided they're servo signals. E.g. overlapping PWM--> serial PPM
Modes 4-16) ? Any other ideas? What specifically about RS232?
Also, 4 DIP switch setup is read only one at beginning, to prevent change of mode during operation.
I'll submit PCB design to fab house in the next week. First samples ready in about 30 days. Given that constuction requires little/no hand soldering, it will go together quick. Code will be adapted from what is tried and true for AttoPilot.
I don't really need to know how many people want one right now, I'll just plan on making a dozen or so at first.
$50 without headers attached (but nice plated through holes)
$65 with triple row right angle headers. Headers on all inputs make it easy to solder your JR/Hitec or Futaba leads or other wire choices, and I'll even incude the small heat shrink tubing.
I'd be willing to provide boards with 'real' servo leads on the inputs, but keep in mind they are not cheap (like $2.40 each), though BalsaPR.com sells a kit to make your own, but that is a LOT of tedious manual labor to the point it is (IMHO) easier to just buy them pre-made.
zlite
Jan 21, 2008, 01:21 AM
Bravo! Count me in for your first batch.
dmgoedde
Jan 21, 2008, 01:35 AM
Any chance that a future version of the mux would have RS232 input and output? I am interested in a device that would input the PWM servo signals
and convert them to an RS232 data stream that my embedded computer could read and then output another RS232 data stream that would be converted to PWM servo outputs.
I would probably buy one of your MUX circuits as described now anyway.
-John Elliott (Seattle)
Great ideas. I just have to research it, and have a clear idea of exactly what you are describing. I have never done that, so the solutions are not jumping out in my mind, but it can be done.
dmgoedde
Jan 27, 2008, 05:28 PM
I found servo leads (JR/Hitec) for $0.79 at Hobby City(https://www.unitedhobbies.com/UNITEDHOBBIES/store/uh_viewItem.asp?idProduct=3847). They're on backorder, but I will order 200 or 300, and pass them on with these first units, at my cost, for people that want them.
I'm having trouble finding triple row right angle headers in stock from a place that I can just throw an order in. Other than that, I ordered components yesterday and will be ready to submit PCB design to fabhouse in the next couple days.
For now, I'm planning just a 2 position DIP switch, to choose 4 modes of operation. There are indicator LEDs on each A and B side, plus a status output line (high = A selected, low = B).
Greg_Granville
Jan 28, 2008, 08:11 AM
I went through the search for triple row headers a few months ago for a power distribution/regulator board I did for a 50cc plane with 8 high torque servos. I finally gave up and just ordered some single row headers (DigiKey WM6536-ND) and went straight in instead of RA.
I've designed a new version of the board which includes digital isolators, and will be ordering parts for it soon. If you do find a source of 3-row RA headers, I'd be interested in knowing where you found them :)
For now, the single row pin headers are working OK, so in my case I guess it's not a big deal either way.
On the subject of the short servo leads, I just bought the servo terminals at Hobby City for .40c per pair. I used their servo wire and was able to crimp on the connectors and make lot of short leads to my exact length for about .50c each.
BTW - I'm following the Attopilot project closely. Noticed it only recently, but from what I'm seeing, I'm pretty sure I'll be standing in line when they are ready :)
zlite
Jan 28, 2008, 10:46 AM
I went through the search for triple row headers a few months ago for a power distribution/regulator board I did for a 50cc plane with 8 high torque servos. I finally gave up and just ordered some single row headers (DigiKey WM6536-ND) and went straight in instead of RA.
You can find triple-row headers from Samtec. http://www.samtec.com/technical_spe...aspx?series=TSW (http://www.samtec.com/technical_specifications/overview.aspx?series=TSW)
dmgoedde
Jan 28, 2008, 01:59 PM
On the subject of the short servo leads, I just bought the servo terminals at Hobby City for .40c per pair. I used their servo wire and was able to crimp on the connectors and make lot of short leads to my exact length for about .50c each.
BTW - I'm following the Attopilot project closely. Noticed it only recently, but from what I'm seeing, I'm pretty sure I'll be standing in line when they are ready :)
Nice to meet you Greg. At one time I bought a servo lead kit from balsapr.com. It weas great and inexpensive, BUT there is no way I wuld be able to crimp 200 or 300 of these things and get anything else done! I would always choose to make my own for personal use, like under a dozen pieces.
On the Atto thing, thank you, I sent you a PM with some recent devlopments (lest I go off topic on this thread).
Dean
dmgoedde
Jan 29, 2008, 01:24 PM
You can find triple-row headers from Samtec. http://www.samtec.com/technical_spe...aspx?series=TSW (http://www.samtec.com/technical_specifications/overview.aspx?series=TSW)
Thx ZLite, I have ordered samples from them and got price quotes already, and if it is like I think, will be ordering a bunch.
Thanks, I owe you one.
Dean
air
Apr 24, 2008, 04:42 AM
Hi Dean,
Just wondering if these boards are available now?
I made a suggestion in the RX Mux thread that it would be nice if there was some sort of intelligence built into the switch over operation such that a glitch wouldnt cause a switch over. For example if a short sequence could be relayed over the switching channel instead of a simple on/off.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.