Lost Model Buzzer indicator

Post Reply
User avatar
Berkely
Posts: 29
Joined: Fri Jan 21, 2011 8:25 pm
Location: Belgium, coast

Lost Model Buzzer indicator

Post by Berkely »

Hi,

Would it be possible to enable the buzzer to achieve a "lost model indicator"? When for example the transmitter is switched off, then the buzzer could start to beep after some x time.

I know there exist small buzzers/pcb's which are placed between a ESC ppm cable & when this signal stays the same for a longer time, then the buzzer starts to beep.

I don't think it would require a big codechange but it could be very handy when the multicopter "hangs hidden in the trees".. Ask me how I know.. :?

Regards
Berkely.

User avatar
BlueAngel
Posts: 30
Joined: Sun Feb 27, 2011 11:35 am

Re: Lost Model Buzzer indicator

Post by BlueAngel »

good idea.

I am using this buzzer:
https://www.hobbyking.com/hobbyking/sto ... duct=14521
The advantage of this buzzer is, that it beeps immediately, when its activated. (separate channel required)
So i set failsafe for the buzzer to beep.
If i get a short failsafe in the air, it immediately beeps and tells me, that something is wrong.

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Lost Model Buzzer indicator

Post by Mis »

I have another solution. Some small change in MultiWii FailSave function.
In main loop add one variable:

Code: Select all

#if defined(FAILSAFE)
  static uint8_t fsBuzz;      // For Failsave Buzzer
#endif
 


And replace old failsave routine to new:

Code: Select all

    // Failsafe routine - added by MIS
    #if defined(FAILSAFE)
      if ( failsafeCnt > (5*FAILSAVE_DELAY) && armed==1) {          // Stabilize, and set Throttle to specified level
        for(i=0; i<3; i++) {                                        // after specified guard time after RC signal is lost (in 0.1sec)
          rcHysteresis[i] = MIDRC;
          rcData[i] = MIDRC;
        }
        rcHysteresis[THROTTLE] = FAILSAVE_THR0TTLE;
        rcData[THROTTLE] = FAILSAVE_THR0TTLE;
        fsBuzz = 1;
        if (failsafeCnt > 5*(FAILSAVE_DELAY+FAILSAVE_OFF_DELAY)) {  // Turn OFF motors after specified Time (in 0.1sec)
          armed = 0;
          writeAllMotors(MINCOMMAND);
        }
      }
      if(failsafeCnt==0 && fsBuzz==1) fsBuzz = 2;              // RC signal is back
      failsafeCnt++;
      if(fsBuzz) {
        if(failsafeCnt % 6 == 0)  BUZZERPIN_ON;
        if(failsafeCnt % 6 == 4)  BUZZERPIN_OFF;
        if(fsBuzz == 2) {BUZZERPIN_OFF;  fsBuzz = 0; }      // Turn OFF Buzzer condition
      }
    #endif
    // end of failsave routine - next change is made with RcOptions setting


That's ALL. Now if we get FailSave, the buzzer start beeping fast until the RC signal come back. The buzzer beeps even after disarming motors via falisafe disarm timeout.

User avatar
Berkely
Posts: 29
Joined: Fri Jan 21, 2011 8:25 pm
Location: Belgium, coast

Re: Lost Model Buzzer indicator

Post by Berkely »

Ok Mis,

Looks nice, I'm going to try this change.

Thanks a lot!

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Lost Model Buzzer indicator

Post by UndCon »

Does above code works with Spektrum?
If so I will add it to my versions as well.


//UndCon

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Lost Model Buzzer indicator

Post by jevermeister »

Mis wrote:I have another solution. Some small change in MultiWii FailSave function.
In main loop add one variable:

Code: Select all

#if defined(FAILSAFE)
  static uint8_t fsBuzz;      // For Failsave Buzzer
#endif
 


And replace old failsave routine to new:

Code: Select all

    // Failsafe routine - added by MIS
    #if defined(FAILSAFE)
      if ( failsafeCnt > (5*FAILSAVE_DELAY) && armed==1) {          // Stabilize, and set Throttle to specified level
        for(i=0; i<3; i++) {                                        // after specified guard time after RC signal is lost (in 0.1sec)
          rcHysteresis[i] = MIDRC;
          rcData[i] = MIDRC;
        }
        rcHysteresis[THROTTLE] = FAILSAVE_THR0TTLE;
        rcData[THROTTLE] = FAILSAVE_THR0TTLE;
        fsBuzz = 1;
        if (failsafeCnt > 5*(FAILSAVE_DELAY+FAILSAVE_OFF_DELAY)) {  // Turn OFF motors after specified Time (in 0.1sec)
          armed = 0;
          writeAllMotors(MINCOMMAND);
        }
      }
      if(failsafeCnt==0 && fsBuzz==1) fsBuzz = 2;              // RC signal is back
      failsafeCnt++;
      if(fsBuzz) {
        if(failsafeCnt % 6 == 0)  BUZZERPIN_ON;
        if(failsafeCnt % 6 == 4)  BUZZERPIN_OFF;
        if(fsBuzz == 2) {BUZZERPIN_OFF;  fsBuzz = 0; }      // Turn OFF Buzzer condition
      }
    #endif
    // end of failsave routine - next change is made with RcOptions setting


That's ALL. Now if we get FailSave, the buzzer start beeping fast until the RC signal come back. The buzzer beeps even after disarming motors via falisafe disarm timeout.



Hi MIs,
this does not work if you are using the vbat routine, the vbat routine is turning off the speaker each cycle if the voltage is ok, so this inteferes with your routine, in order to make it work, I added an IF-clause to vbat, that does not turn of the speaker while failsafe is running.

We should consider to rethink some subrotuines thas use resources like LEDs and speakers so they do not interfere with eacht other.

Post Reply