This commit is contained in:
parent
cb8a49775d
commit
555e0ce49d
@ -20,6 +20,7 @@ will consitute of a breaking change warranting a new major release:
|
|||||||
- `SensorProcessing` now includes an FDIR for GPS altitude. If the measured GPS altitude is out
|
- `SensorProcessing` now includes an FDIR for GPS altitude. If the measured GPS altitude is out
|
||||||
of bounds of the range defined in the `AcsParameters`, the altitude defaults to an altitude
|
of bounds of the range defined in the `AcsParameters`, the altitude defaults to an altitude
|
||||||
set in the `AcsParameters`.
|
set in the `AcsParameters`.
|
||||||
|
- `AcsController` will now never command a RW speed larger than the maximum allowed speed.
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
|
@ -78,19 +78,19 @@ void PtgCtrl::ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters
|
|||||||
pErrorSign[i] = pError[i];
|
pErrorSign[i] = pError[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Torque for quaternion error
|
// torque for quaternion error
|
||||||
double torqueQuat[3] = {0, 0, 0};
|
double torqueQuat[3] = {0, 0, 0};
|
||||||
MatrixOperations<double>::multiply(*gainMatrix, pErrorSign, torqueQuat, 3, 3, 1);
|
MatrixOperations<double>::multiply(*gainMatrix, pErrorSign, torqueQuat, 3, 3, 1);
|
||||||
VectorOperations<double>::mulScalar(torqueQuat, -1, torqueQuat, 3);
|
VectorOperations<double>::mulScalar(torqueQuat, -1, torqueQuat, 3);
|
||||||
|
|
||||||
// Torque for rate error
|
// torque for rate error
|
||||||
double torqueRate[3] = {0, 0, 0};
|
double torqueRate[3] = {0, 0, 0};
|
||||||
MatrixOperations<double>::multiply(*(acsParameters->inertiaEIVE.inertiaMatrix), deltaRate,
|
MatrixOperations<double>::multiply(*(acsParameters->inertiaEIVE.inertiaMatrix), deltaRate,
|
||||||
torqueRate, 3, 3, 1);
|
torqueRate, 3, 3, 1);
|
||||||
VectorOperations<double>::mulScalar(torqueRate, cInt, torqueRate, 3);
|
VectorOperations<double>::mulScalar(torqueRate, cInt, torqueRate, 3);
|
||||||
VectorOperations<double>::mulScalar(torqueRate, -1, torqueRate, 3);
|
VectorOperations<double>::mulScalar(torqueRate, -1, torqueRate, 3);
|
||||||
|
|
||||||
// Final commanded Torque for every reaction wheel
|
// final commanded Torque for every reaction wheel
|
||||||
double torque[3] = {0, 0, 0};
|
double torque[3] = {0, 0, 0};
|
||||||
VectorOperations<double>::add(torqueRate, torqueQuat, torque, 3);
|
VectorOperations<double>::add(torqueRate, torqueQuat, torque, 3);
|
||||||
MatrixOperations<double>::multiply(rwPseudoInv, torque, torqueRws, 4, 3, 1);
|
MatrixOperations<double>::multiply(rwPseudoInv, torque, torqueRws, 4, 3, 1);
|
||||||
@ -108,7 +108,7 @@ void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters *pointingLawP
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculating momentum of satellite and momentum of reaction wheels
|
// calculating momentum of satellite and momentum of reaction wheels
|
||||||
double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3};
|
double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3};
|
||||||
double momentumRwU[4] = {0, 0, 0, 0}, momentumRw[3] = {0, 0, 0};
|
double momentumRwU[4] = {0, 0, 0, 0}, momentumRw[3] = {0, 0, 0};
|
||||||
VectorOperations<double>::mulScalar(speedRws, acsParameters->rwHandlingParameters.inertiaWheel,
|
VectorOperations<double>::mulScalar(speedRws, acsParameters->rwHandlingParameters.inertiaWheel,
|
||||||
@ -119,11 +119,11 @@ void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters *pointingLawP
|
|||||||
MatrixOperations<double>::multiply(*(acsParameters->inertiaEIVE.inertiaMatrix), satRate,
|
MatrixOperations<double>::multiply(*(acsParameters->inertiaEIVE.inertiaMatrix), satRate,
|
||||||
momentumSat, 3, 3, 1);
|
momentumSat, 3, 3, 1);
|
||||||
VectorOperations<double>::add(momentumSat, momentumRw, momentumTotal, 3);
|
VectorOperations<double>::add(momentumSat, momentumRw, momentumTotal, 3);
|
||||||
// calculating momentum error
|
// calculating momentum error
|
||||||
double deltaMomentum[3] = {0, 0, 0};
|
double deltaMomentum[3] = {0, 0, 0};
|
||||||
VectorOperations<double>::subtract(momentumTotal, pointingLawParameters->desatMomentumRef,
|
VectorOperations<double>::subtract(momentumTotal, pointingLawParameters->desatMomentumRef,
|
||||||
deltaMomentum, 3);
|
deltaMomentum, 3);
|
||||||
// resulting magnetic dipole command
|
// resulting magnetic dipole command
|
||||||
double crossMomentumMagField[3] = {0, 0, 0};
|
double crossMomentumMagField[3] = {0, 0, 0};
|
||||||
VectorOperations<double>::cross(deltaMomentum, magFieldEst, crossMomentumMagField);
|
VectorOperations<double>::cross(deltaMomentum, magFieldEst, crossMomentumMagField);
|
||||||
double normMag = VectorOperations<double>::norm(magFieldEst, 3), factor = 0;
|
double normMag = VectorOperations<double>::norm(magFieldEst, 3), factor = 0;
|
||||||
@ -137,7 +137,7 @@ void PtgCtrl::ptgNullspace(AcsParameters::PointingLawParameters *pointingLawPara
|
|||||||
double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3};
|
double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3};
|
||||||
double wheelMomentum[4] = {0, 0, 0, 0};
|
double wheelMomentum[4] = {0, 0, 0, 0};
|
||||||
double rpmOffset[4] = {1, 1, 1, -1}, factor = 350 * 2 * Math::PI / 60;
|
double rpmOffset[4] = {1, 1, 1, -1}, factor = 350 * 2 * Math::PI / 60;
|
||||||
// Conversion to [rad/s] for further calculations
|
// conversion to [rad/s] for further calculations
|
||||||
VectorOperations<double>::mulScalar(rpmOffset, factor, rpmOffset, 4);
|
VectorOperations<double>::mulScalar(rpmOffset, factor, rpmOffset, 4);
|
||||||
VectorOperations<double>::mulScalar(speedRws, 2 * Math::PI / 60, speedRws, 4);
|
VectorOperations<double>::mulScalar(speedRws, 2 * Math::PI / 60, speedRws, 4);
|
||||||
double diffRwSpeed[4] = {0, 0, 0, 0};
|
double diffRwSpeed[4] = {0, 0, 0, 0};
|
||||||
|
Loading…
Reference in New Issue
Block a user