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.
Lost Model Buzzer indicator
Re: Lost Model Buzzer indicator
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.
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.
Re: Lost Model Buzzer indicator
I have another solution. Some small change in MultiWii FailSave function.
In main loop add one variable:
And replace old failsave routine to new:
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.
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.
Re: Lost Model Buzzer indicator
Ok Mis,
Looks nice, I'm going to try this change.
Thanks a lot!
Looks nice, I'm going to try this change.
Thanks a lot!
Re: Lost Model Buzzer indicator
Does above code works with Spektrum?
If so I will add it to my versions as well.
//UndCon
If so I will add it to my versions as well.
//UndCon
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: Lost Model Buzzer indicator
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.