MikroKopter - Forum » Public BETA » Suggestions regarding upcoming FW

Suggestions regarding upcoming FW

Neues Thema Antwort

Seite: 1

Autor Neuer Beitrag
Mitglied
Registriert seit: Nov 2012
Beiträge: 225
Ort: Landshut,BY
Hi,

I'd like to make some suggestions regarding the upcoming FW releases.
Probably others have some, too...?!

For NC:

1.) in spi_slave.c the RC_Quality is build:
Line 896 if(FC.RC_Quality > 160) NaviData.RC_Quality = 200; else NaviData.RC_Quality = FC.RC_Quality


I don't understand why this is necessary - finally the value is somehow a 'fake' ;)
Could You please change this, so that NaviData.RC_Quality reflects the true value?!

2.) There is some space left in the debug struct - so I'd suggest to add following values:

LowVoltageLandingActive
LowVoltageHomeActive


For FC:

1.) I don't know if this is too much waste of resources or performance - but if You only have a FC without NC it would be great to have the BL-Ctrl values as in NC.

I've made some small changes and tested it successfully - this is almost same like the 'k' serial command in NC, with the difference, that all data is send in one and only for existing motors:

twimaster.h
//###################################
//tiny motordata struct for PC query //by Steph 2016
typedef struct
{
uint8_t Index;
uint8_t Current;
uint8_t Temperature;
uint8_t MaxPWM;
uint8_t State;
uint8_t NotReadyCnt;
} __attribute__((packed)) Motor_t;

extern Motor_t MotorT[MAX_MOTORS];
//###################################


twimaster.c
Motor_t MotorT[MAX_MOTORS];


fc.h
extern void CopyMotorTValues(void); //copy motor values to MotorT struct
extern unsigned char MotorData_ArrSize; // detected motors in CopyMotorTValues() --> Size of the array to send


fc.c
//############################################################################
//Copy motor values to tiny struct for pc queries //by Steph 2016
void CopyMotorTValues(void)
{
unsigned char i;
for(i=0;i<MAX_MOTORS && (Motor[i].State & MOTOR_STATE_PRESENT_MASK);i++)
{
MotorT[i].Index = i;
MotorT[i].Current = Motor[i].Current;
MotorT[i].Temperature = Motor[i].Temperature;
MotorT[i].MaxPWM = Motor[i].MaxPWM;
MotorT[i].State = Motor[i].State;
MotorT[i].NotReadyCnt = Motor[i].NotReadyCnt;
}
MotorData_ArrSize = i * 6;
}
//############################################################################


uart.c
Line 108: (v2.14a) MotorData_Timer and MotorData_Interval added
int Display_Timer, Debug_Timer,Kompass_Timer,Timer3D, MotorData_Timer = 0;
unsigned int DebugDataIntervall = 0, Intervall3D = 0, Display_Interval = 0, MotorData_Interval = 0;

Line 682: (v2.14a)
 case 'k': // request for Motor data;
PcZugriff = 255;
MotorData_Interval = (unsigned int)pRxData[0] * 10;
if(MotorData_Interval > 0) Request_MotorData = 1;
AboTimeOut = SetDelay(ABO_TIMEOUT);
break;


Line 830: (v2.14a)
 //send tiny motordata struct for PC query //by Steph 2016
if(((MotorData_Interval>0 && CheckDelay(MotorData_Timer)) || Request_MotorData) && UebertragungAbgeschlossen)
{
CopyMotorTValues();
SendOutData('K', FC_ADDRESS, 1, (unsigned char *) &MotorT, MotorData_ArrSize);
Request_MotorData = 0;
if(MotorData_Interval>0) MotorData_Timer = SetDelay(MotorData_Interval);
}


(Instead of using the MotorData_ArrSize it would probably better to use a return value from the CopyMotorTValues() function.)

So the received data is always 6 byte for each motor [data.Length % 6 == 0]

Would be great if this could get into the next release! ;)

Cheers,
Stephan
« Bearbeitet von Steph am 15.09.2016 14:24. »
Mitglied
Registriert seit: Nov 2012
Beiträge: 225
Ort: Landshut,BY
Zitat
2.) There is some space left in the debug struct - so I'd suggest to add following values:

LowVoltageLandingActive
LowVoltageHomeActive


Hmm, just realized that these are in the status flags... I just wonder why nobody told me... :P
Mitglied
Registriert seit: Nov 2012
Beiträge: 225
Ort: Landshut,BY
Hello again!

It's somehow discouraging, as nobody is answering here...?! :evil:


Nevertheless I've a question - maybe a suggestion:

The "s" param query to the NC seems to result in the same outcome as the "w" param ...?
Sure there's some different code behind, but the outcome is mostly the same.

Therefore I'd suggest to change the behaviour of the "s" param to what it is called in the Wiki - a new target
In this way, that one could jump through the wp list and set the desired target and index -
so if the wp at specified index is same it just switches to that point
if the point is different, the point at the index is updated and the index is set to that point.

This would be really help-& useful, I think!

Cheers,

Stephan

Neues Thema Antwort

Seite: 1

MikroKopter - Forum » Public BETA » Suggestions regarding upcoming FW