Connect with us

Drone flasher

Discussion in 'General Electronics Discussion' started by Jackgiz, Aug 28, 2015.

  1. Jackgiz

    Jackgiz

    5
    0
    Aug 28, 2015
    I'm new to this forum and am trying to design and build a timer/alarm that will work in conjunction with my drone. The concept is to tap into one of the motor output ports on the flight controller board. If the motor is running there will be a string of pulses. When the motor stops the motor port goes to zero. Having recently lost a drone in the woods I want Drone 2 to have a timer circuit that will start to time out when the motor port output goes low. After approx. 3 minutes I want to activate a second timer that will flash LED's and a buzzer on and off. I'm thinking 2 to 3 seconds on and off. Hopefully the lights and noise will help me avoid a second lost drone. I've attached a circuit that I pulled together from info I found on the internet. However, being an ME with just enough EE to be dangerous I need a little help with the viability of this circuit. Any help would be greatly appreciated.

    Jack
     

    Attached Files:

  2. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    The most configurable and lowest power solution is a PIC microcontroller, but then there's all of that firmware goop. It could run for months, but for you to come up to speed on the programming would take twice that. So...

    Sticking to hardware, I've got an idea for this. One chip, two transistors, and no 555. First, rather than long on and off times, the alarms will be much more noticeable in your peripheral vision and at a distance if they are shorter and bigger (brighter/louder). A 1/10th second very loud chirp and flash every 2-3 seconds will travel better through foliage.
    1. What is the power supply voltage?
    2. What are the amplitude and frequency of the motor port pulses?

    ak
     
  3. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    436
    99
    Aug 27, 2013
    Hey Jack, Welcome to the Forum!

    As I mentioned, my vote is for a uC....cheap, quick and easy with an upgrade path for design changes....But, you are old and set in your ways, so let's answer AK's questions and see where this goes...

    @AK, Jack is a buddy of mine from the CNC forums...I suggested he post his circuit here to get some feedback....I offered to build him a prototype PCB + a quick bit of code for an ATTINY2313 ...( and a couple of mosfets), but he is bound and determined to do this **analog**, LOL.....I have been covered up with work and thought it might be best to see if some of yall could steer him in the right direction...

    @power Supply...this is an RC Quad in the 1.5kg range, so likely 3S or 4S (so 11.1V or 14.4V) with 5V readily available.....

    @Motor Pulses...I am not certain if he is planning to use one leg of the motor, or if he is planning on using one of the Flight-Controller Outputs.....if it is the latter then standard servos use a 50hz (20mS) period with pulse duration for drones typically from 700uS to 19.9mS......If he is planning on using a leg from one of the motors then the frequency could easily range from 30hz to over 20Khz.....personally I would just use the output from the Receiver, but I suspect he is thinking more along the lines of a motor leg.... ..

    My thoughts for an analog version also avoided the 555/556.....but I hadn't considered the "flashing" feature, and as AK pointed out that would not only extend battery life, but also might make it easier to detect......So, I don't currently have and thoughts on an analog solution.... my vote is still with the AVR and a couple of mosfets....LOL.....

    Fish
     
  4. Jackgiz

    Jackgiz

    5
    0
    Aug 28, 2015
    Thanks for the quick reply AnalogKid. Fish is correct, I'll be using a 3Cell LiPo battery which has a nominal 11.1 volts. The frequency will vary. Hover is estimated at 4,000 RPM and full throttle will be around 6,800 RPM. These are brushless motors and have 3 leads. I believe the motors work something like a 3 phase motor. If you switch any 2 leads the motor will spin in the opposite direction. They are driven by a speed controller board which in turn is driven by the flight controller board. The flight controller has a power, ground and signal line going to the speed controller. I could pull a signal from either side of the speed controller. The point is, when the frequency goes to zero, that's when I want the counter to start. I wanted to have an initial longer period timer so that the alarm wouldn't go off just because I landed the Quad.
    I'm open to any solution including a uC as Fish mentioned so long as it won't take me 6 months to implement. I'd probably lose another Drone by them.

    Jack
     
  5. Jackgiz

    Jackgiz

    5
    0
    Aug 28, 2015
    Oh, and Fish is correct. I do have a separate on board 5V supply.
     
  6. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    436
    99
    Aug 27, 2013
    Jack...couple of quick notes.....

    #1 --> A Servo PWM typically does not go to "0" pulse width

    #2 --> BLDC Motors are, in-fact, 3-Phase motors from an electrical point-of-view...the distinction is that they typically use permanent magnets in place of "rotor windings".....WRT to RPM vs Frequency....."frequency" here is a bit of a wild-card......Sensorless BLDC motors typically used in the hobby industry are typically driven by a "Trapezoidal" wave-form rather than the more familiar sine-wave of typical grid powered motors....the trapezoidal wave form is so named because each "leg" is left "open" during the period of time preceding and following a zero-crossing-point event....the idealized drawing has the voltage/current being "carried" by a combination of the collapsing field in the stator coils and the moving magnetic field created by the rotor magnets.... In reality this is nothing like what actually happens, lol, but it is close enough to use it to time the next switching event.....Which brings us to the next important factor.....the number of magnet pairs and the number of stator windings....The number of magnet pairs multiplied by the number of stator windings divided by 6 defines the relationship between frequency and RPM..... But none of this is particularly salient to the predominant "switching frequency" actually sent to any given leg of the motor at any given RPM....Except for the special case where the motor is being driven by the full battery voltage...each leg is actually driven by a series of PWM pulses...typically the observed PWM period is variable suggesting either a look-up table is used or current/voltage feedback is being monitored (perhaps in some ESCs, all three? don't know the answer, lol)....In any-Case attempting use a leg of the motor as a "sample" for initiating your circuit is certainly viable, but would require some pretty heavy filtering to prevent an analog circuit stable....

    This brings us to "monitoring one of the Servo lines"....the problem here is that they do not typically "go to zero"..... Remember, the control mechanism was designed for actual servos...not ESCs...so ESCs are designed to be backwards compatible with servos....this means that the range of the PWM signal sent to the ESC from the Flight Controller AND the signal sent from the Receiver to the Flight Controller ALL comply with the "standard servo specifications" which (as previously mentioned) are typically a 20mS interval with "on times" varying from ~1.5mS to ~18mS.....however, it seems that typical ESCs and Flight Controllers can be "programmed" to use pulse widths from ~700uS to 19.9mS.....this is NOT necessarily true for "typical" Receivers.....The "finer resolution" in Flight Controllers and ESCs is a modification to the "standard" specifically for multi-rotor drones....typically these features need to be enabled or programed as part of the set-up.........Sooooo, in order to use an analog circuit to detect an "error condition", you would first need to think long and hard about what the "error condition looks like"......

    Did I mention a uC would be a lot easier way to do this? Hrmmmmm....I meant too..... ;-)

    Fish
     
  7. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    First pass at a drone beacon. I don't like timers with very large capacitors,so this circuit divides down a higher frequency clock to derive the necessary timing signals. R5 sets the LED current, and should be calculated for the LED and battery voltage being used. Everything else can run on anything between 3 and 15 V. As shown, the circuit assumes +5 V.

    The circuit assumes that the incoming pulses fail low, removing the counter reset. U1 is a clock oscillator and 14-stage binary divider. The clock is approximately 64 Hz. Output Q8 goes high every 2 seconds, and C3 turns on Q1 for approx. 0.1 sec. Output Q14 goes high every 4-1/4 minutes (256 sec), so Q2 is on for 2 minutes, off for 2 minutes, etc. Transistors Q1 and Q2 form a NAND gate to drive the beeper and LED.

    ak
    DroneBeacon-1-ch.gif
     

    Attached Files:

  8. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    436
    99
    Aug 27, 2013
    AK, nicely done!.....Only potential problem I see is I don't know that the signal from the Receiver/Flight Controller ever actually "stops", and if it does stop if the line is held high or low....Jack will need to find this out before moving forward.....If the signal simply "defaults to a neutral position" when the Tx signal is lost then the input would need to be modified to some sort of missing pulse detector.....which brings me to a completely new thought....

    Jack....the Flight Controller you ordered uses a full-blown 64bit DSP core that can monitor/control pretty much anything you can conceive of....and,......I know many of the higher-end Flight Controllers offer real-time telemetry (with the addition of a Transmitter/Receiver...which I would assume you have because you are getting real-time video)....Including GPS location...wouldn't having the Lat/Long/Elevation location be enough information to "find" your drone? Maybe you just need to order a hand-held GPS so you can plug in the Lat/Long of your drone and have it guide you to it? Not trying to avoid an electronics problem....but maybe you already solved the problem and just didn't know it? Even if this is not the case, I think using the Flight Controller to trigger your alarm might be the best way to go...that would work perfectly with AK's design....

    Fish
     
  9. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    Since you get the GPS location data only if the drone is transmitting it, that's a whole buncha battery power. Hopefully you could zoom in on it in less than an hour, and the batteries have that much gas left in them after the crash - correction, unscheduled stationary event.

    And, not to be showing my age or anything, but am I the only one reacting to the phrase "...the Flight Controller you ordered uses a full-blown 64bit DSP core..." Really? 64 Bit?? DSP??? Kids these days, they got no appreciation. Why, when I was a boy we only had 4 bits, and ***no correlator***!!!

    Updated schematic on the way, adding a true AND gate saves around 5 watt-seconds per day.

    ak
     
  10. Jackgiz

    Jackgiz

    5
    0
    Aug 28, 2015
    The circuit looks great and provides some options. The only thing I'm concerned with is the 4 1/2 minute off time. Seems like the first thing I need to do is put a scope on the signal line to the ESC and also to the motor to see what happens when the throttle goes to zero. My thought was the signals went to zero but maybe not. I have the motors and ESC's but the Flight Controller hasn't arrived yet from China. I haven't even been able to find out if it has shipped yet in spite of several emails requesting a status update. I should have known that any business named Good Luck Buy was not a serious supplier. Also, this is not a 64 bit anything. It's a simple 8 bit controller. The next gen FC's will be 32 bit but currently cost about 4 X the 8bit versions. Some day I plan on upgrading once there's an installed base out there and volume helps bring the cost down a little. You know me Fish.
    I will have a real time view of GPS position however, when the plane has a stationary placement event I'm not sure what I'll be able to see on my goggles unless I record all flights. Even if I have the GPS data I'm not sure how small an area it will point me to. I saw my last Drone go down. I went on Google Maps and drew a line from where I was standing through the last sited location and I still couldn't find the damn thing. My guess it's stuck up in a tree and I can't see it because of the leaves. I'm hoping this new drone with it enhanced capability will allow me to use a mission planner app to fly back and forth over the area to see if I can find Drone 1 up in the trees. Flashing and beeping up in the trees I think will be a good idea.
    Just thought of another possible option. I have a 9 channel TX/RX. I may have a spare channel. If so I could perhaps use that spare channel to trigger the flasher.
    One of the biggest current draw are the ESC's, even when the FC is turned off. Power goes from the battery, through a connection board and then to the ESC's. There's no switch, the ESC's are on as soon as you plug in the battery. Right now the battery will go dead over night with the ESC's plugged in. If I have a spare channel could I use it to activate the alarm and deactivate the ESC's?
    Here comes the feature creep!!

    Jack
     
  11. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    4-1/4 minutes is the period of a full cycle. Tweaking the clock frequency up a bit makes this an even 4 minutes. That's 2 minutes off (the initial delay requested), then 2 minutes of beeping every 2 seconds, 2 minutes quiet, beeping, quiet...

    ak
     
  12. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    Here is an update to the schematic in post #7. Changing the position of the two transistors saves approx. 4 ws in base current energy per 24 hours. Also, C3 should be 220 uF for a 1/8 second beep/flash.

    ak
    DroneBeacon-1a-ch.gif
     

    Attached Files:

  13. Jackgiz

    Jackgiz

    5
    0
    Aug 28, 2015
    Thanks AK for clarifying the time period. I also understand why you switched Q1 and Q2. I'm not sure I understand what D1 does in the circuit. Can you explain?

    Also, any thoughts on what I can do to shut down the ESC's to preserve battery life? Here's the current specs on the motors:

    upload_2015-8-29_16-24-4.png

    This is worst case with 11" propellers. I'm likely to run with 10". Motor at Maximum is not likely to be for very long, maybe 1 or 2 seconds. Connecting one of my ESC's to a motor and then to the 11.1 volt battery I'm getting 50 mA X 4 = 200 mA. This is a Habor Freight multimeter so +/- 50%. I didn't have the 5v/grd/signal line connected to anything but I don't think that would add to the current draw with the flight controller off. The frame of the Quad is all Aluminum so I've got plenty of heat sink available.

    Jack
     

    Attached Files:

  14. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    436
    99
    Aug 27, 2013
    @jack....You only ordered an 8-Bit FC? You cheap old fart, LMFAO....then why didn't you just go with an Arduino?.....Though this revelation does explain the rather lack-luster radio you ordered.....you plan on simply Txing an analog video signal.....That clears up a lot of things in your general description of your parts, LOL. You might consider one of those 18650 format 4.2V x 6000mAh batteries dedicated to your emergency beacon...they weigh in @ less than 60g and this should give you plenty of power/time to get your wheelchair.....LMFAO !

    @AK...again...nice work :) Good catch on switching the transistors....never know when that 4Ws might be [email protected] machines.....yea, I was a bit of a late-bloomer....I waited until DOS came along before I started playing with PCs .... I guess I was just too lazy to write my own OS...:) My problem with these high-powered ARM based cores is that I never learned C, so I write firmware in ASM....and I don't think I will live long enough to write anything useful for a 64-bit, multi-core, multi-thread, mixed signal, DSP in ASM.... :-(

    Fish
     
  15. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    OK, got it right this time. A MOSFET alarm transistor takes no energy to drive (compared to a BJT), It has a crisp square drive waveform instead of an R-C tail, and the input now works with either a DC or pulsed signal. The alarm chirps once per second, 2 minutes on and 2 minutes off. The unused gate can be used to change the pattern to once every two seconds.

    ak
    DroneBeacon-3-ch.gif
     

    Attached Files:

  16. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    D1 is called a catch diode. When the counter output is high (5 V), the transistor side of the cap is at 0.7 V, the transistor Vbe. When the counter output goes low (0 V), the other side of the cap goes below ground until the diode conducts at -0.7 V. The cap discharges through the diode until the voltage across the cap is 0.7 V (the counter output is essentially at GND). Now when the counter output goes high, it pulls the transistor side of the cap up to 4.3 V. The cap now charges up through the transistor base, turning on the transistor. R3 limits the peak current to under 4 mA, a safe value for the 4401 that guarantees at least 40 mA of collector current, and closer to 100 mA if needed for the alarm devices. The cap size sets the transistor turn-on time. Without the diode to discharge the cap each cycle, the cap would eventually have a fixed 4.3 V across it and the transistor would not turn on much at all.

    ak
     
  17. AnalogKid

    AnalogKid

    2,305
    648
    Jun 10, 2015
    OK, last blast. Fixed the alarm chirp timing. With a 68 Hz clock freq, it now beeps/flashes for 1/8 second every 2 seconds, a good compromise between attention-getting and battery-saving. Initial turn-on delay is 2 minutes, then 2 minutes of alarms, 2 min. quiet, repeat.

    I never addressed the original request for an analog solution. The problem with multi-minute RC timers is that big capacitors leak. For a turn-on delay based on a single R-C time constant, that would be a 1 meg resistor and a 120-150 uF capacitor, for a peak capacitor current of 5 uA (5 V supply). But a general purpose electrolytic capacitor, such as a Panasonic cap from Digi-Key, has a leakage current of approx. 3 uA and that value varies significantly with temperature. So repeatable performance within about +/-25% is tough. Hence the clock and counter approach.

    ak
    DroneBeacon-4-ch.gif
     

    Attached Files:

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-