Welcome to PhantomPilots.com

Sign up for a weekly email of the latest drone news & information

How does the Naza control the leds on the ESC's ???

Discussion in 'Phantom 2 Discussion' started by RogerClark, Apr 21, 2014.

  1. RogerClark

    Joined:
    Feb 12, 2014
    Messages:
    147
    Likes Received:
    0
    Hi,

    I'm making some major changes to my Phantom, and would like to know how the Naza controls the LEDS on the ESCs

    As far as I can tell the signals going to the ESC's appear to be normal PWM at around 400Hz but there is also a signal at 900Hz.

    Does anyone know if the 900Hz is some sort if PWM to control the LEDS?

    I can't see any signals from the Naza that are generating the 900Hz PWM or anything else that looks like the flashing pulses, so I presume that somehow the the Naza is sending CAN Bus data to the main PCB and this is somehow controlling the LEDs

    Does anyone know if thats how it works?

    Thanks.
     
  2. ianwood

    ianwood Taco Wrangler
    Staff Member

    Joined:
    Jan 7, 2014
    Messages:
    4,910
    Likes Received:
    1,789
    Location:
    Lost Angeles
    I don't see any LED controller chips on the ESCs like a WS2811 so I am assuming they get a PWM signal for each of the R, G, B channels. If you look at the non-Phantom Naza setup there is a separate PMU/BEC module that houses the LED and the USB connection. Probably on the Phantom mainboard.

    You looking to see if you can hijack the LEDs?
     
  3. RogerClark

    Joined:
    Feb 12, 2014
    Messages:
    147
    Likes Received:
    0
    Thanks Ian,

    That would make sense. There are 4 wires going to each ESC, so 1 could be the motor control PWM and the other 3 could be individual LED control PWM's

    I took a look at the signals using my scope and one of them appeared to be 400Hz which is probably the motor speed control and there was at least one signal line at 900Hz, which was probably PWM.

    Re: What I'm doing..
    I've taken out the Naza and put in an APM 2.5. I was going to to use a PixHawk, but its a bit too new and experimental at the moment, so I went with cheaper and more supported APM.

    I had to build an SBUS to PPM converter, as the APM didnt accept the SBUS input from the Phantom 2's built in receiver.
    I know you can buy a FrSky converter, but it would take ages to get here in the post, so I built one using a design on a German FPV site, which used an Arduino Nano (which I happened to have in my box of toys).

    I've had to replace the GPS with a standard one (uBlox LEO 6H), and I 3D printed off some new support posts and which I glued into the top shell.

    I'm still waiting on a cable for the external compass, so I've not tried flying it yet. (though if I get fed up with waiting, the APM 2.5 has an on board compass, which I've already calibrated, so it may work a bit).

    I suspect initially it may be quite unstable, but once I get it dialled in, I'm hoping to be able to do aerobatics etc.
    I've seem some clips on YouTube of people with modified Phantoms that seem to be able to do pretty extraordinary things ;-)

    But I'd like to be able to control the LED's. So thats probably my next task.
    I'll try sending them 900Hz PWM from another Arduino board and see if I can get them to come on ;-)

    Thanks

    Roger

    Edit.

    I took a closer look at the wires going to the ESC's

    There are 4 wires, 3 orange and 1 brown. The brown appears to be the 0V/Ground connection.
    which just leaves the 3 orange wires as signals

    One of the orange is the PWM for the motor attached to the ESC.

    Which leaves 2 other wires. I'm not sure if the Phantom has 3 LED colours or whether its actually displaying the 3 colours, i.e Red, Green and Yellow.
    By using Red + Green = Yellow

    [​IMG]

    In which case the other 2 orange wires are probably PWM to control the Red and the Green.

    Looks like more experimentation is required ;-)
     
  4. RogerClark

    Joined:
    Feb 12, 2014
    Messages:
    147
    Likes Received:
    0
    In case this information is of use to anyone else customizing their Phantom 2

    I've figured out how the LEDs that are under each arm (driven by the ESC board) are controlled

    Each ESC has 4 wires going to it. Three are orange and 1 is Brown

    The layout is Orange, Brown, Orange, Orange (I'm assuming that the little white dot next to the connector indicates pin 1, but I can't be sure.

    Anyway, the first Orange wire carries 1KHz PWM that controls the LED's (the other two orange seem to both have 500Hz PWM to control the motor speed).

    Note. The voltage of the PWM is 3.3V not 5V for the LED. (I'm not sure if it works at 5V I didn't like to risk blowing anything up ;-)

    Anyway, I hooked up an Ardruino Uno's PWM output via a resistor divider network to give PWM at 3.3V and it appears that the LED colour is set by the pulse width of the incoming PWM.

    It doesn't seem to matter if the PWM frequency is 1KHz or 500Hz etc, its just the pulse width that is important.

    Here are the pulse widths required to activate each colour

    Red 180uS (micro seconds)

    Green 280uS

    Yellow 380uS

    These values are approximately in the middle of acceptable pulse width bands, i.e

    Red seems to operate from around 160uS to 200uS

    Green from 260uS to 300uS

    Yellow from 360us to 400uS


    Cheers

    Roger
     
  5. ianwood

    ianwood Taco Wrangler
    Staff Member

    Joined:
    Jan 7, 2014
    Messages:
    4,910
    Likes Received:
    1,789
    Location:
    Lost Angeles
    That explains why we've never seen any blue or white flashing codes! Good job figuring it out. You could also simply drop in some neo pixels. The adafruit 8 LED strip should be just the right size:

    http://www.adafruit.com/products/1426

    Fully addressable and well supported.
     
  6. GhostMaster

    Joined:
    Dec 7, 2013
    Messages:
    793
    Likes Received:
    36
    So its possible to mod a phantom 1 with NAZA V2 and have the arm leds like the phantom 2?
     
  7. OI Photography

    Joined:
    Sep 23, 2013
    Messages:
    5,542
    Likes Received:
    17
    Location:
    Clarksville, TN
  8. GhostMaster

    Joined:
    Dec 7, 2013
    Messages:
    793
    Likes Received:
    36
    Só you are saying if i get the phantom 2 ESC all the arm LEDs will work, right?
     
  9. OI Photography

    Joined:
    Sep 23, 2013
    Messages:
    5,542
    Likes Received:
    17
    Location:
    Clarksville, TN
    No, I'm saying that mod will let you have the NAZA's LED notifications displayed on the arms like a P2...it doesn't use the P2 ESC's.