Hamburger wrote:David
What happens when you disable the gps support in config.h
It works perfectly, as long as the I2C GPS is unplugged as well - no problems found (although I haven't tried flying it yet - but no problems expected).
Hamburger wrote:David
What happens when you disable the gps support in config.h
Code: Select all
#if GPS
GPS_set_pids(); // at this time we don't have info about GPS init done
#endif
Code: Select all
#if GPS
if (f.I2C_INIT_DONE) GPS_set_pids(); // at this time we don't have info about GPS init done
#endif
varvar wrote:Hi Alexinparis,
please fix this bug - in EEPROM.cpp you haveCode: Select all
#if GPS
GPS_set_pids(); // at this time we don't have info about GPS init done
#endif
but should be (as in the previous version)Code: Select all
#if GPS
if (f.I2C_INIT_DONE) GPS_set_pids(); // at this time we don't have info about GPS init done
#endif
in this case if i2c_gps connected, program will send i2c command before i2c have been initialized, as result i2c sends parcel with baud rate 1MHz (or more?), and i2c_gps hang up the bus.
Thanks!
Vladimir
Alexinparis wrote: Hi,
I think it's cleaner to specify it in GPS part and not EEPROM part.
Tell me if it's ofkin last dev.
Code: Select all
/************************** all the Mega types ***********************************/
#if defined(MEGA)
#define LEDPIN_PINMODE pinMode (13, OUTPUT);pinMode (30, OUTPUT);
#define LEDPIN_TOGGLE PINB |= (1<<7); PINC |= (1<<7);
#define LEDPIN_ON PORTB |= (1<<7); PORTC |= (1<<7);
#define LEDPIN_OFF PORTB &= ~(1<<7);PORTC &= ~(1<<7);
[b] #define BUZZERPIN_PINMODE DDRH |= (1<<5) ;
#if defined PILOTLAMP
#define PL_PIN_ON PORTH |= 1<<5;
#define PL_PIN_OFF PORTH &= ~(1<<5);
#else
#define BUZZERPIN_ON PORTH |= 1<<5;
#define BUZZERPIN_OFF PORTH &= ~(1<<5);
#endif [/b]
Code: Select all
if(abs(imu.gyroADC[axis] - previousGyroADC[axis]) > 32) tilt=1;
Alexinparis wrote:main changes 2.2 -> 2.3
***Control mode***
- main PITCH/ROLL/YAW PID modification (r1474)
- the sticks scaling is no more affected by PID coefficients
- yaw rate (to the right of the PIDs in GUI) now works as stick scaling
- default yaw rate is increased (with yaw rate at 0)
- yaw PID principle is now different from PITCH&ROLL PID:
- yaw ITerm windup is very high, allowing an 'elastic' direction return after a manual perturbation
- yaw ITerm is also constrained with a windup independent limit
- yaw PTerm is constrained in order to counter the yaw jump effect.
use yaw DTerm to increase this constrain (r1573)
- yaw ITerm is canceled if the yaw stick is not centered
cbap wrote:I am having the same problem.
Set up for X quad.
Enable Dynamic balance and get the motor control tab in the control panel.
Clicking the motors doesn't seem to control them.
Then they two just seem to spin up randomly.
I've reset eeprom and tried it on more than one controller. Same issues.
Anyone know what is going on?
32 bit interface on 64 bit win 7.
Can't get the 64 bit one to work.
Cheers,
Carl
Code: Select all
uint16_t auxState = 0;
int8_t auxShift = -1;
for(i = 0; i < 4; i++)
{
auxState |= (rcData[AUX1+i] < 1300) << ++auxShift;
auxState |= (1300 < rcData[AUX1+i] && rcData[AUX1+i] < 1700) << ++auxShift;
auxState |= (rcData[AUX1+i] > 1700) << ++auxShift;
}
Code: Select all
/**************** normalize the Motors values ******************/
#define Limit85 MAXTHROTTLE + ((MAXTHROTTLE - conf.minthrottle) * 85) / 100 // Note this is a constant in MWII
int16_t overshoot;
maxMotor = 0;
for(i = 0; i < NUMBER_MOTOR; i++)
{
motor[i] = min(motor[i], Limit85);
if (motor[i] > maxMotor) maxMotor = motor[i];
}
if (maxMotor > MAXTHROTTLE) overshoot = maxMotor - MAXTHROTTLE;
else overshoot = 0;
for(i = 0; i < NUMBER_MOTOR; i++)
{
motor[i] = constrain(motor[i] - overshoot, conf.minthrottle, MAXTHROTTLE);
if ((rcData[THROTTLE] < MINCHECK) && !f.BARO_MODE)
#ifndef MOTOR_STOP
motor[i] = conf.minthrottle;
#else
motor[i] = MINCOMMAND;
#endif
if (!f.ARMED)
motor[i] = MINCOMMAND;
}
Code: Select all
float InvSqrt (float x){
union{
int32_t i;
float f;
} conv;
conv.f = x;
conv.i = 0x5f3759df - (conv.i >> 1);
return 0.5f * (conv.f * (3.0f - x * conv.f * conv.f));
}
Code: Select all
float InvSqrt(float x){
union
{
float f;
uint32_t u;
} y = {x};
y.u = 0x5F1FFFF9 - (y.u >> 1);
return 0.703952253f * y.f * (2.38924456f - x * y.f * y.f);
}
Code: Select all
float InvSqrt(float x)
{
uint32_t i = 0x5F1FFFF9 - (*(uint32_t*)&x >> 1);
float tmp = *(float*)&i;
return tmp * (1.68191409f - 0.703952253f * x * tmp * tmp);
}