Iran Cracks RQ-170 Stealth Drone Code.

Yee haw!  Save your money boys and girls.  Looks like Iran may be going into the flight controller business soon.  Once commercialized, the RQ-170 based flight controller should outperform DJI, and Arducopter.  Maybe even give Mikrokopter a run for its money.

Views: 2145

Comment by Jack Crossfire on April 22, 2012 at 1:09pm

They managed to read the date code on the PIC microcontroller.

Comment by Ellison Chan on April 22, 2012 at 1:12pm

I'm sure that date code is encrypted.

These two guys are trying very hard to keep a straight face, during the interview.


Moderator
Comment by Sgt Ric on April 22, 2012 at 1:45pm
@Ellison, if @Jack is serious about the controller, then no, it wouldn't be encoded.
[but then again, I never have been able to figure out Jack]
... I know he's brilliant, but way over my head!
Comment by Ellison Chan on April 22, 2012 at 1:46pm

Ha ha.  They're not using PICs in the RQ-170.

Comment by Andre K. on April 22, 2012 at 1:49pm

"Maybe even give Mikrokopter a run for its money."

MK is most of all extremely overpriced - not any better. Commercial use costs all you have, source is not open at all, and written in german - so you are out of luck undestanding it easily.  It does not have automatic compass calibration, and is very prone to run away /go crazy if compass is wrong. - dangerous.  I have MK , openpilot, ardupilot - so I know :)

Comment by Ellison Chan on April 22, 2012 at 1:59pm

Andke, I don't know a word of German, and I can understand the code fine.  If you don't have enough programming experience to understand the code without reading comments, you probably shouldn't be changing the code, as it can get painful. ;-)

As for auto-compass calibration, it's not simple.  There aren't really many/any controllers that have it, including APM up to about a month ago.

Comment by Andre K. on April 22, 2012 at 2:08pm

Ellison: Comments are almost non-existent, I am referring to all constants and variables being in German.

Not many have it, but many have some way to handle such error, besides "fly in (wrong) direction until crash".

What they miss is a routine to detect when the aircraft just gets more and more away from the target destination.

Comment by Ellison Chan on April 22, 2012 at 2:37pm

Interestingly, the mag calibration routine is all English to me. ;-)

Don't know about MK, but for a plane which is constantly in motion, we use GPS to do periodic heading corrections.  With a copter, we are limited to using the compass when the its hovering.   There will be drift due to changes in magnetic field due to the difference in position from where the compass was originally calibrated.  So we'd have to do a re-calibration periodically.  However, we'll never get a solid heading hold from compass alone.  There's just too much variation, due to the motors, and other environmental issues.

void Calibrate(void)
{
        uint8_t cal;
        static uint8_t calold = 0;
        static int16_t Xmin = 0, Xmax = 0, Ymin = 0, Ymax = 0, Zmin = 0, Zmax = 0;
        static uint8_t blinkcount = 0;
        static uint8_t invert_blinking = 0;
    
        // check both sources of communication for calibration request
        if(I2C_WriteCal.CalByte) cal = I2C_WriteCal.CalByte;
        else                     cal = ExternData.CalState;


        if(cal > 5) cal = 0;
        // blink code for current calibration state
        if(cal)
        {
                if(CheckDelay(Led_Timer) || (cal != calold))
                {
                        if(blinkcount & 0x01) if(invert_blinking) LED_GRN_ON; else LED_GRN_OFF;
                        else if(invert_blinking) LED_GRN_OFF; else LED_GRN_ON;

                        // end of blinkcount sequence
                        if((blinkcount + 1 ) >= (* cal))
                        {
                                blinkcount = 0;
                                Led_Timer = SetDelay(1000);
                        }
                        else
                        {
                                blinkcount++;
                                Led_Timer = SetDelay(170);
                        }
                }
        }
        else
        {
                if(invert_blinking) LED_GRN_ON; else LED_GRN_OFF;
        }

        // calibration state machine
        switch(cal)
        {
                case 1: // 1st step of calibration
                        // initialize ranges
                        // used to change the orientation of the MK3MAG in the horizontal plane
                        Xmin =  10000;
                        Xmax = -10000;
                        Ymin =  10000;
                        Ymax = -10000;
                        Zmin =  10000;
                        Zmax = -10000;
                        Calibration.AccX.Offset = RawAccX;
                        Calibration.AccY.Offset = RawAccY;
                Calibration.AccZ.Offset = RawAccZ;
            invert_blinking = 0;
                        break;

                case 2: // 2nd step of calibration
                        // find Min and Max of the X- and Y-Sensors during rotation in the horizontal plane
                        if(UncalMagX /span> Xmin) Xmin = UncalMagX;
                        if(UncalMagX > Xmax) Xmax = UncalMagX;
                        if(UncalMagY /span> Ymin) Ymin = UncalMagY;
                        if(UncalMagY > Ymax) Ymax = UncalMagY;
            invert_blinking = 1;
                        break;

                case 3: // 3rd step of calibration
                        // used to change the orientation of the MK3MAG vertical to the horizontal plane
            invert_blinking = 0;
                        break;

                case 4:
                        // find Min and Max of the Z-Sensor
                        if(UncalMagZ /span> Zmin) Zmin = UncalMagZ;
                        if(UncalMagZ > Zmax) Zmax = UncalMagZ;
            invert_blinking = 1;
                        break;

                case 5:
                        // Save values
                        if(cal != calold) // avoid continously writing of eeprom!
                        {
                                Calibration.MagX.Range = Xmax - Xmin;
                                Calibration.MagX.Offset = (Xmin + Xmax) / 2;
                                Calibration.MagY.Range = Ymax - Ymin;
                                Calibration.MagY.Offset = (Ymin + Ymax) / 2;
                                Calibration.MagZ.Range = Zmax - Zmin;
                                Calibration.MagZ.Offset = (Zmin + Zmax) / 2;
                                if((Calibration.MagX.Range > 150) && (Calibration.MagY.Range > 150) && (Calibration.MagZ.Range > 150))
                                {
                                        // indicate write process by setting the led
                                        LED_GRN_ON;
                                        eeprom_write_block(&Calibration, &eeCalibration, sizeof(Calibration));
                                        Led_Timer = SetDelay(2000);
                                        // reset  blinkcode
                                        blinkcount = 0;
                                }
                        }
            invert_blinking = 0;
                        break;

                default:
                        break;
        }
        calold = cal;
}

Comment by Jack Crossfire on April 22, 2012 at 5:47pm

The RQ-170 probably uses a MOS 6510, acquired by the Air Force at a cost of $179.

Comment by Tom in NOVA on April 22, 2012 at 6:52pm

If the Iphone can wipe itself clean after you losing it, don't you think the RQ-170 can?

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service