MagneticControl:

Path: CubeSat/AttitudeControl

% Implement instantaneous magnetic control with torquers.
 Magnetic torquers only produce 2-axis torque. This function generates
 a least squares fit that matches the torque the torquers can produce
 to the torque demand. The output is the dipole demand in ATM^2 
 (amp-turn-meter-squared). The scalar cost is any number >= 0. It 
 assumes that the cost of using any dipole is the same. The output will
 need to be pulsewidth modulated if the torquers do not have linear
 actuation.

 For example, the torque is T = [m1 m2 m3] x b, or
 
  T = -b x [m1 m2 m3]

 m1, m2 and m3 are dipoles.  [b x] cannot be inverted hence the least 
 squares. Has a built-in demo.
--------------------------------------------------------------------------
   Form:
   [m, tErr] = MagneticControl( b, tDemand, u, c )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   b          (3,1)  Magnetic Field (T)
   tDemand    (3,1)  Torque Demand (Nm)
   u          (3,n)  Unit dipole vectors for n dipoles
   c          (1,1)  Scalar cost of using a dipole

   -------
   Outputs
   -------
   m          (n,1)  Dipole values (ATM^2)
   tErr       (3,1)  Torque error (Nm)

--------------------------------------------------------------------------

Children:

AerospaceUtils: Coord/ECIToEF
AerospaceUtils: Coord/QLVLH
SC: BasicOrbit/CP2I
SC: BasicOrbit/E2Nu
SC: BasicOrbit/El2RV
SC: BasicOrbit/M2E
SC: BasicOrbit/M2EApp
SC: BasicOrbit/M2EEl
SC: BasicOrbit/M2EHy
SC: BasicOrbit/M2Nu
SC: BasicOrbit/M2NuPb
SC: BasicOrbit/Period
SC: BasicOrbit/RVFromKepler
SC: Environs/BDipole
SC: Ephem/EarthRte
SC: Ephem/MSidDay
Common: CommonData/SwooshWatermark
Common: General/CellToMat
Common: General/DeBlankLT
Common: General/DispWithTitle
Common: General/MatToCell
Common: General/Watermark
Common: Graphics/NewFig
Common: Graphics/Plot2D
Common: Graphics/Plot3D
Common: Graphics/PltStyle
Common: Graphics/TimeLabl
Common: Graphics/XLabelS
Common: Graphics/YLabelS
Common: Graphics/ZLabelS
Common: Quaternion/Mat2Q
Common: Quaternion/QForm
Common: Time/DTSToDTA
Common: Time/Date2JD
Common: Time/JD2000
Common: Time/JD2T
Common: Time/T2JD
Math: Linear/Cross
Math: Linear/DupVect
Math: Linear/Mag
Math: Linear/Skew
Math: Linear/Unit
Math: MathUtils/R2P5

Back to the CubeSat Module page