Code: Select all
// For Mode Active
#define STABLEMODE 1
#define BAROMODE 4
#define MAGMODE 8
//#define BOXCAMSTAB 2
//#define BOXCAMTRIG 32
#define ARMEDMODE 32
#define GPSHOMEMODE 64
#define GPSHOLDMODE 128
Code: Select all
// For Mode Active
#define STABLEMODE 1
#define BAROMODE 4
#define MAGMODE 8
//#define BOXCAMSTAB 2
//#define BOXCAMTRIG 32
#define ARMEDMODE 32
#define GPSHOMEMODE 64
#define GPSHOLDMODE 128
modelci wrote:
If the decoration is turned off may be accelerated horizon.
I do not see anything wrong with the altitude representation. Now(r1240), it always starts from zero. I do not know, what can I do?
kataventos wrote:This is what I call a smooth horizon line, on V7 I had almost no info but it was smooth!
http://www.youtube.com/watch?v=8b3XXbMeRtQ
modelci wrote:kataventos wrote:This is what I call a smooth horizon line, on V7 I had almost no info but it was smooth!
http://www.youtube.com/watch?v=8b3XXbMeRtQ
But, this screen is very empty.
Code: Select all
// For Mode Active
#define STABLEMODE 1 // OK
#define BAROMODE 4 // OK
#define MAGMODE 8 // OK
#define BOXCAMSTAB 16 //Don´t no because I do not have info on OSD
#define BOXCAMTRIG 256 //Don´t no because I don´tuse
#define ARMEDMODE 32 // OK
#define GPSHOMEMODE 64 // OK
#define GPSHOLDMODE 128 // OK
kataventos wrote:Altitude: It seems that it is not holding altitude, it is jumping between 0 and correct reading.
shikra wrote:@modelci
I see you have added minim hardware support. Do you know if its working for anyone.
I was just about to start writing a simple OSD for myself. Might as well use yours/JG code!!
I tried to upload, but get blank screen - does this config require cam input? or to be connected to multiwwi to display anything. I was hoping to see a startup screen. Tried adding internal sync enable, but not seeing anything still. I know I should look deeper in the code, but you can probably answer quicker!
it displays ardupilot OK..
Thanks for the development!
Code: Select all
nextMSPrequest++;
switch (nextMSPrequest) {
case 1:
MSPcmdsend=MSP_IDENT;
break;
case 2:
MSPcmdsend=MSP_ATTITUDE;
break;
case 3:
MSPcmdsend=MSP_STATUS;
break;
case 4:
MSPcmdsend=MSP_ATTITUDE;
break;
case 5:
MSPcmdsend=MSP_RAW_IMU;
break;
case 6:
MSPcmdsend=MSP_ATTITUDE;
break;
case 7:
MSPcmdsend=MSP_RAW_GPS;
break;
case 8:
MSPcmdsend=MSP_ATTITUDE;
break;
case 9:
MSPcmdsend=MSP_COMP_GPS;
break;
case 10:
MSPcmdsend=MSP_ATTITUDE;
break;
case 11:
MSPcmdsend=MSP_ALTITUDE;
break;
case 12:
MSPcmdsend=MSP_ATTITUDE;
break;
case 13:
MSPcmdsend=MSP_RC_TUNING;
break;
case 14:
MSPcmdsend=MSP_ATTITUDE;
break;
case 15:
MSPcmdsend=MSP_PID;
break;
case 16:
MSPcmdsend=MSP_ATTITUDE;
break;
case 201:
MSPcmdsend=MSP_STATUS;
break;
case 202:
MSPcmdsend=MSP_RAW_IMU;
break;
case 203:
MSPcmdsend=MSP_ATTITUDE;
break;
default:
MSPcmdsend=MSP_RC;
if(askPID==0)
{
nextMSPrequest = 0;
}
else
{
nextMSPrequest = 200;
}
break;
}
blankserialRequest(MSPcmdsend);
Code: Select all
if (cmdMSP==MSP_ALTITUDE)
{
MwAltitude =read32();
MwVario = read16();
Code: Select all
if (cmdMSP==MSP_ALTITUDE)
{
MwAltitude =read32()/100;
MwVario = read16()/100;
Code: Select all
// For Altitude
//int holdRelativeAltitude=0;
char altitudeOk=0;
//int altitudeMax;
//int absoluteAltitudeAtStart = 0;
int altitude = 0;
//int32_t oldMwAltitude=0;
float climbRate = 0;
trailblazer wrote:I figured out the problem with the "not so smooth" horizon display:
The problem is the low update rate of the attitude values due to the large amount of serial requests! I have added requests for that values in the case/switch code for every second request.
A quick test of that is very promising, I get a much higher framerate for the horizon bar. I hope that this tweak does not affect the other calculations or displays.
Like that:
Code: Select all
nextMSPrequest++;
switch (nextMSPrequest) {
case 1:
MSPcmdsend=MSP_IDENT;
break;
case 2:
MSPcmdsend=MSP_ATTITUDE;
break;
case 3:
MSPcmdsend=MSP_STATUS;
break;
case 4:
MSPcmdsend=MSP_ATTITUDE;
break;
case 5:
MSPcmdsend=MSP_RAW_IMU;
break;
case 6:
MSPcmdsend=MSP_ATTITUDE;
break;
case 7:
MSPcmdsend=MSP_RAW_GPS;
break;
case 8:
MSPcmdsend=MSP_ATTITUDE;
break;
case 9:
MSPcmdsend=MSP_COMP_GPS;
break;
case 10:
MSPcmdsend=MSP_ATTITUDE;
break;
case 11:
MSPcmdsend=MSP_ALTITUDE;
break;
case 12:
MSPcmdsend=MSP_ATTITUDE;
break;
case 13:
MSPcmdsend=MSP_RC_TUNING;
break;
case 14:
MSPcmdsend=MSP_ATTITUDE;
break;
case 15:
MSPcmdsend=MSP_PID;
break;
case 16:
MSPcmdsend=MSP_ATTITUDE;
break;
case 201:
MSPcmdsend=MSP_STATUS;
break;
case 202:
MSPcmdsend=MSP_RAW_IMU;
break;
case 203:
MSPcmdsend=MSP_ATTITUDE;
break;
default:
MSPcmdsend=MSP_RC;
if(askPID==0)
{
nextMSPrequest = 0;
}
else
{
nextMSPrequest = 200;
}
break;
}
blankserialRequest(MSPcmdsend);
Code: Select all
void displayAltitude(void)
{
//MwAltitude=MwAltitude/estAltValue;
//AbsoluteAltitudeAtStart = 0;
if(!altitudeOk&&(allSec>5)&&armed){
//absoluteAltitudeAtStart = MwAltitude ;
altitudeOk=1;
altitudeMAX=0;
}
if(!armed) {
altitudeOk=0;
//absoluteAltitudeAtStart=0;
}
if(unitSystem) altitude = MwAltitude * 3.28;
if(!unitSystem) altitude = MwAltitude;
screenBuffer[0]=MwAltitudeAdd[unitSystem];
screenBuffer[1]=0;
MAX7456_WriteString(screenBuffer,MwAltitudePosition[videoSignalType][screenType]);
if(altitudeOk && (altitude > altitudeMAX)) altitudeMAX = altitude;
itoa(altitude,screenBuffer,10);
MAX7456_WriteString(screenBuffer,MwAltitudePosition[videoSignalType][screenType]+1);
}
void displayClimbRate(void)
{
climbRate=MwVario;
int xx=0;
int pos;
screenBuffer[0]=MwClimbRateAdd[unitSystem];
screenBuffer[1]=0;
MAX7456_WriteString(screenBuffer,MwClimbRatePosition[videoSignalType][screenType]);
if(!unitSystem) xx= climbRate * 3.28;
if(unitSystem) xx= climbRate ;
itoa(xx,screenBuffer,10);
MAX7456_WriteString(screenBuffer,MwClimbRatePosition[videoSignalType][screenType]+1);
if (climbRate > 10) screenBuffer[0]=0xB3;
else
if (climbRate > 5) screenBuffer[0]=0xB2;
else
if (climbRate > 2) screenBuffer[0]=0xB1;
else
if (climbRate > 1) screenBuffer[0]=0xB0;
else screenBuffer[0]=0xBC;
if (climbRate < -10) screenBuffer[0]=0xB4;
else
if (climbRate < -5) screenBuffer[0]=0xB5;
else
if (climbRate < -2) screenBuffer[0]=0xB6;
else
if (climbRate < -1) screenBuffer[0]=0xB7;
screenBuffer[1]=0;
if (climbRate>= -1) pos = MwClimbRatePosition[videoSignalType][screenType]-2;
else pos = MwClimbRatePosition[videoSignalType][screenType]-2+LINE;
MAX7456_WriteString(screenBuffer,pos);
}
kataventos wrote:Is this just part of the code for altitude and climbing rate, or can I try to compile it and test?
modelci wrote:It came to my knowledge the limit.
trailblazer wrote:.....
.......
For the high Y-axis resolution a modified charset is necessary. I can share the files if anyone is interested. Of course, you can add it in the developer version if you like.
trailblazer wrote:I managed to push the vertical resolution to 18Bits/Line. The virtual horizon is now very precise and as smooth as possible. With two scaling factors the display can be trimmed to the camerasignal (roll should be ok for all configs, pitchvalue may depend on the camerlens), meaning a really good matching "horizonline" :)
The limit for the frame rate is now the screenrefresh (10hz atm) , not the computing - as it seems in the first place.
For the high Y-axis resolution a modified charset is necessary. I can share the files if anyone is interested. Of course, you can add it in the developer version if you like.
carlonb wrote:trailblazer wrote:.....
Can you please address me in what i need for char set mod tools? (and some examples)![]()
Carlo
Code: Select all
// Altitude
void send_Altitude(void)
{
uint16_t Datas_altitude_bp;
uint16_t Datas_altitude_ap;
static uint16_t Start_altitude;
if (!f.ARMED)
{
Start_altitude = EstAlt / 100;
}
Datas_altitude_bp = (EstAlt / 100) - Start_altitude;
Datas_altitude_ap = (EstAlt % 100);
sendDataHead(ID_Altitude_bp);
write_FrSky16(Datas_altitude_bp);
sendDataHead(ID_Altitude_ap);
write_FrSky16(Datas_altitude_ap);
}
modelci wrote:They are not different. Only, try this:
In GlobalVariables.h
int32_t MwAltitude=0; ----> uint32_t MwAltitude=0;
int16_t MwVario=0; ----> uint16_t MwVario=0;
int altitude = 0; ----> uint32_t altitude = 0;
We don't show after the decimal point. Maybe later.
modelci wrote:We're told to data from the barometer. Highly variable. It becomes negative sometimes.
I bring the code into the old and publish it. Necessary for me to negative values.
modelci wrote:I have mw fc cards. I do not have my osd card. Are you not be able to provide a screenshot.
alexia wrote:does it a complet osd or it s a beta software?
where we can buy it
modelci wrote:Ah, finally I can see. My bad english! I take care of it. I do not know, to be fix on not to be fix.
Code: Select all
void displayAltitude(void)
{
MwAltitude=MwAltitude;
//absoluteAltitudeAtStart = 0;
if(!altitudeOk&&(allSec>5)&&armed){
//absoluteAltitudeAtStart = MwAltitude ;
altitudeOk=MwAltitude;
altitudeMAX=MwAltitude;
}
if(!armed) {
altitudeOk=0;
//absoluteAltitudeAtStart=0;
}
if(unitSystem) altitude = MwAltitude /100;
if(!unitSystem) altitude = MwAltitude /100;
screenBuffer[0]=MwAltitudeAdd[unitSystem];
screenBuffer[1]=0;
MAX7456_WriteString(screenBuffer,MwAltitudePosition[videoSignalType][screenType]);
if (altitudeOk) altitudeMAX = 0;
itoa(altitude,screenBuffer,10);
MAX7456_WriteString(screenBuffer,MwAltitudePosition[videoSignalType][screenType]+1);
}
Code: Select all
// For Altitude
int holdRelativeAltitude=0;
char altitudeOk=0;
//int altitudeMax;
int absoluteAltitudeAtStart = 0;
int altitude =1;
int32_t oldMwAltitude=0;
float climbRate = 0;
Code: Select all
// EstAlt ( in multiwii code ) unit value is equal( how much EstAlt have to be to equal 1 meter )
//#define estAltValue 100
Code: Select all
void displayClimbRate(void)
{
climbRate=MwVario;
int xx=0;
int pos;
screenBuffer[0]=MwClimbRateAdd[unitSystem];
screenBuffer[1]=0;
MAX7456_WriteString(screenBuffer,MwClimbRatePosition[videoSignalType][screenType]);
if(!unitSystem) xx= climbRate / 60; //* 3.28
if(unitSystem) xx= climbRate / 60;
itoa(xx,screenBuffer,10);
MAX7456_WriteString(screenBuffer,MwClimbRatePosition[videoSignalType][screenType]+1);
if (climbRate > 10) screenBuffer[0]=0xB3;
else
if (climbRate > 5) screenBuffer[0]=0xB2;
else
if (climbRate > 2) screenBuffer[0]=0xB1;
else
if (climbRate > 1) screenBuffer[0]=0xB0;
else screenBuffer[0]=0xBC;
if (climbRate < -10) screenBuffer[0]=0xB4;
else
if (climbRate < -5) screenBuffer[0]=0xB5;
else
if (climbRate < -2) screenBuffer[0]=0xB6;
else
if (climbRate < -1) screenBuffer[0]=0xB7;
screenBuffer[1]=0;
if (climbRate>= -1) pos = MwClimbRatePosition[videoSignalType][screenType]-2;
else pos = MwClimbRatePosition[videoSignalType][screenType]-2+LINE;
MAX7456_WriteString(screenBuffer,pos);
}
Code: Select all
const int amperageOffset=123; //ACS755 Offset
..
..
rawamperage = analogRead(amperagePin)-amperageOffset;
if(rawamperage<0) rawamperage=0;
amperage = (float(rawamperage))/1.23;
carlonb wrote:Hi all,
I want experimenting with "MAX7456Charwizard" but after download it and unzipped, if I double click on "swing-layout-1.0.3.jar" or "AbsoluteLayout.jar" I receive this error message "Failed to load Main-class manifest attribute from C:\.....\...\AbsoluteLayout.jar".
May be I need to download something about Java .... ? NOTE: My O.S. is Windows XP SP2.
Please help me.
Thanks, Carlo