Ok, I already know the basics of powering the board, currently I am running a 3S battery through a UBEC set at 5V, and that is plugged into one of the spare servo inputs on the APM, which in turn passes the voltage to the reciever and servos.
I have a tail servo rated at 3S, direct. That one servo has power and ground directly connected to the battery, and only the signal wire goes to the APM. It worked fine for a while, but on the weekend I had an issue that led to a crash. As best as I can tell, there's some kind of interference related to my Xbee which I just added. Basically, the servo pulses whenever the Xbee is transmitting.
I suspect the issue has to do with a voltage drop on the APM side of things reducing the voltage peak of the PWM signal going to the 3S servo to drop to the point it doesn't see it anymore.
Anyway, I am considering making a few changes:
I want to de-solder the jumper which will allow me to power the APM directly, instead of using power from the servo rail. Question is, can the APM really take 3S power direct? 11.1V? I have seen mixed things about this. BTW, I am talking about a APM 2560 bought 1 month ago, if it matters.
Second thing is, I want to reconfigure my UBEC to output 6V instead of 5V, and pass that power to the servo rail. Is this OK? I know my receiver can take it as I operated like that previously. And the servo will benefit from the added speed and torque. But I have seen nothing saying if the APM can take 6V on the rail? I read the thing saying to only feed it 5V, but I assume that was when the solder was jumpered for external power?
I would then continue to use the 3S servo. Hopefully this will clear up the power problems. If I did this, what would be the voltage peak of the PWM signal going to the tail servo be? 5V (internally regulated APM level) or 6V?
The newer APMs can take a 3S directly, but it won't be able to power the Oilpan + peripherals, so it's not really an option. See here:
The only way you can connect a 6V UBEC to the servo rail is by breaking the solder jumper, but then you'd have no power to the APM. To answer your last question, the voltage peak of the PWM signal would still be the APM voltage, 5V.
My guess at your tail servo issue is a grounding problem. Can you put a multimeter (or better, a scope) between the battery negative and the UBEC output ground? The battery negative and UBEC output ground might only be loosely tied together, in which case a large momentary current draw (like Xbee transmit) might pull the ground around. If this is the problem, then adding a connection between UBEC output ground and battery negative should solve it, and *probably* won't fry anything. :-)
Ok, thanks, sounds like I need external power no matter what. So is there simply no way to power my servos with 6V? That's unfortunate. Most servos can run 6V and benefit significantly.
What's the point of even including the MIC5219 if it's simply too small to power the IMU and peripherals? Actually, if you desolder that jumper, and power the board directly, how does the IMU get power? From the servo rail, or does it come from the APM, thus overheating the MIC5219?
Would it be possible to desolder the jumper, and supply 6V power to the servo rail, as well as the MIC5219? Since the voltage drop is lower, maybe it would be able to power the IMU with 5V power, while still putting 6V on the servo rail?
Interesting idea, I hadn't even considered the ground.
The strange thing is, the setup worked fine for 2 flights (10 minutes in the air each, plus quite a long time on the ground and bench, at least 2 hours total). Then on the 3rd flight, this happened mid air. I lost the tail while testing Loiter and couldn't regain control of the heli. At first I thought something in the Loiter code caused it. Then when I powered it up on the bench again, I saw the strange bahaviour of the tail servo. I don't know if my inability to regain control was because I'm not skilled enough, or maybe the APM was rebooting? I seems like it captured datalog immediately before, and after the crash in one log file. But the actual spinning and resultant pitching and rolling does not show up.
Anyway, I wanted to determine if the servo had failed, so I disconnected Ch4 from the APM, and plugged the servo directly into the receiver (power still coming from the 3S direct). The servo still twitches with the Xbee. I disconnected the Xbee, twitching stops. Reconnect it, twitching occurs. Strange.
I then plugged a standard servo into the reciever, the same type I have on the swashplate, and it behaves normally with the Xbee.
Ok, I just checked everything I could think of, and I can't find any sources of electrical noise. Negative/ground across the UBEC. Nothing there. I checked for voltage changes on the servo rail. Nothing. Voltage between servo rail and battery output, 6.45V, not changing. Etc etc.
Now, this is just with a multimeter. I wish I had an Oscope.
My meter has a Hz setting, and it picks something up on the signal pins, about 240hz? Not sure if that's right. I tried looking for any signal between all the powers and grounds, nothing.
But, the servo continues to do it, no doubt. If I plug a normal servo in, no problem. I can't even use the 3S servo for a camera gimbal as it pulses even plugged into APM channel 8.
There isn't simply any way, but there aren't any simple ways. If you had a separate 5V source, you could imagine partitioning things up so that servos get 6V power and share a common ground with 6V ground and APM ground.
If you desolder the jumper and power the board through the MIC5219, the IMU still gets power from the APM. I actually never measured how much power the APM+IMU consumes, those numbers on the other topic are for APM, IMU, magnetometer, and GPS.
I hadn't thought of powering the MIC5219 with 6V, it just might work. I'd suggest measuring the average and peak currents of the whole setup (APM, IMU, mag, GPS, Xbee), then doing the calculation on page 9 of the datasheet.
Since you aren't measuring any voltage between battery ground and UBEC ground, it should be all right to tie them together. To do this safely, first do it with progressively smaller resistors and an ammeter in series, measuring current each time until you convince yourself that it's safe. Or just connect them -- I'd probably just connect them.
I wish I had a scope too....
What about cutting the trace linking the power side of the input servo rail and the output rail? Then apply 6V on the output rail only? I guess what I'm getting at is, I'm not sure what exactly is connected the servo rails on the APM? There's the Mux right? What else? Out of curiosity, when you are running onboard power, how does the signal jump the bridge from the APM side to the servo rail side? Is there an opto-isolator or something?
This is off the top of my head, so caution!
If you cut the 5V trace between input and output on the servo rail, the input 5V will be unconnected, and the output 5V will still be connected to the solder jumper. There's different ways you can do it with the cutting -- you may need to cut and then wire-jumper a section back to somewhere else.
To answer your question, the ground pins on the servo rail are connected to each other, then to board ground. The 5V pins on the servo rail are connected to each other, then to board 5V through the solder jumper. The signal pins on the input are connected through a protection resistor, then connected to the ATmega328 on the board, and the first four channels are also connected to the input of a multiplexer chip. The signal pins on the output are also connected through a protection resistor; the first four are then connected to the output of the multiplexer (for the failsafe mode), and the other four are then connected to the ATmega1280/2560.
No opto-isolators, just the protection resistors.
Well, I made a bit of progress on this issue.
I played around with some capacitors for a while to try and filter any noise on the powerlines. I robbed a couple big ones from an old video card. I put 1500uF on the 11V supply to the servo, and 3300uF on the servo rail of the APM. At first I thought they were making a difference. (do they need inline resistors to really act like a filter?)
What I quickly realized was that the issue is 100% determined by the location of the Xbee antenna. Moving the Xbee around, I can completely eliminate the problem, or if I point the antenna at the servo or servo wire, it goes totally nuts. I may be able to keep using this servo if I am careful.
I'll probably replace the servo wires with twisted triad wire. Move the big cap to the servo end (but honestly, I suspect the issue is coming in the signal wire). And find a really good place for the Xbee. But I'm not sure where that is yet.
Ok, I wanted to get to the bottom of this power problem, so I soldered up some connectors and ran my Power Analyser on the radio system to see what I could get.
Ok, first of all, the results for the APM and the receiver, all servo disconnected. APM was running the Xbee and GPS, but not the mag or sonar at this time. I saw a max power draw of only 0.22Amps. That's less than I thought. It's so low, I think I'm going to bring my Fluke meter from work to double check. But lets go with it for now.
Then I checked the same setup with the 3 swashplate servos plugged in. I madly stirred the sticks, and the highest I saw was only 1.57A That surprised me. So, I pushed down on the swashplate as hard as I dared, all 3 servos buzzing away, and I saw only 2.5A. Wow. So, I then decided to see what I could get out of it if I plugged another 958 servo in to the tail channel. Then, again madly stiring the sticks, this time even faster than before, I saw a peak of 3.5A. Still not even close to my advertised 7.5A limit.
But then I saw, min voltage on the display... 4.92V. That's interesting. I wonder how that happens. Maybe whatever circuit is controlling the FETs in the BEC can't respond fast enough to some voltage spikes?
Is that low enough to cause a brownout?
One of my ideas was to avoid a brownout by powering the APM and receiver with the built-in power regulator on the APM. This would ensure that no matter what, the servos can't take out the APM. Unfortunately, it seems like the power regulator on the APM really isn't big enough for the function it is intended for?
You are not getting a brown out , that' s a reset. You are getting noise. The input to your servo is 5 V and will probably work down to 1.7 or 2 volts witch is why your servo is glitching. IT"S NOISE , sorry. Digital signals such as a PWM to a servo are 0 or a 1,, more than 0 v is a 1. If this is a high end servo i suspect its digital and not some thing from 40 years ago before they made CMOS chips. I would bet that you could put a good clean 2 V ppm to that servo and it would work just fine. It's not power to the signal, it's timing. Noise messes up timing because it can fool the chips into thinking it's a real pulse.
Any how just trying to help. Rethink your problem before you waste a lot of time.
I think your barking up the wrong tree. It's a noise problem on the signal line to your tail servo. I have a Sky Fun and with the srevos that came with it it would twitch all over when the X-bee was transmitting. I replaced the servos with better one and the problem completely went away. You me be extra suceptable to RF noise on you tail servo because of how the wires are laid out. Servo's ground going one way and signal fallowing another path. If your APM was glitching out it would reboot and you would know it. I know RF shouldn't mess with the PPM signals, but strange things can happen when dealing with noise
You could try running a ground wire from the servo rail along with the signal wire and twist them together and use a ferrite.
Keep you APM powered from the BEC.
I agree that I'm probably confusing two issues. Ultimately I don't know what brought down the heli, all I know is that the first symptom was a loss of tail control. I have two things I'm investigating:
Power supply to the APM and possible brown-out or reset
Noise on the tail servo signal line.
You're wrong about the required PWM voltages. It's not true that "anything more than 0V is a 1". In fact, the specifications require a 3.5-7V peak-to-peak square wave. The APM is outputting , at best, a 5V square wave. I don't even know if it's really that high or not.
It's an interesting idea to run the ground through the APM, but I'm a little unsure about that as it might cause a ground loop problem or similar. I'll have to consider that more. But, I will look into it.
The APM may very well have reset. I don't know. I do know that most of the event was not recorded in the log.
There have been a number of people suffering a brown-out/reboot/lock-out/freeze problem lately.
Ok, I think I licked the servo noise problem. I removed my shielded wire, and ran a simple 3-conductor twisted servo wire. I ran the ground to the APM rail, instead of direct to the battery. The signal wire also goes to APM (obviously) in the same connector as the ground. The power wire directly goes to the battery. I also have a 4700uF cap glued to the servo, and a ferrite ring on the power wire only. It appears all noise is gone!
Ok, now back to questions about powering the board.
How much voltage can the board take? Is 5.3V OK?
My idea is this. Do the Jason Power Hack, and split my servo power output from the rest of the board. The servo input power rail will be linked to the board.
Change the jumper on my UBEC to supply 6V. Power the output servo rail directly from the 6V supply. I think this should work in similar fashion to how my tail servo operates. It seems to be OK feeding a higher power to the servos, and leaving the signal wire on 5V. I think good servos only need to see a peak-to-peak V of 3-4V for the PWM signal. Now my other 3 servos are powered by 6V. Then use a diode to drop the APM supply voltage 0.7V to 5.3V. I will also have a large capacitor bank to help prevent brownouts on the APM. I made one up with 5x3300uF caps that can power the board and 3 servos for ~0.1sec. Once I split the servo rail off, it should last much longer. If the servos don't have access to the cap bank, I don't really see any problem since they don't seem to have any meaningful boot time?
The other reason for the diode is to prevent the cap-bank from draining into the servo rail. It will only let power into the board, but not out of the cap-bank and into the servo output rail. That's also why I need to run at 6V, because of the 0.7V drop across the cap.
Anybody have any input?
The biggest question, is can I use a diode to drop the 6V supply to 5.3V, will that be OK for the APM?