Design of Attitude Control Systems for CubeSat-Class Nanosatellite

We present a satellite attitude control system design using low-cost hardware and software for a 1U CubeSat. The attitude control systemarchitectureisacrucialsubsystemforanysatellitemissionsinceprecisepointingisoftenrequiredtomeetmissionobjectives. Theaccuracyandprecisionrequirementsareevenmorechallengingforsmallsatelliteswherelimitedvolume,mass,andpowerare availablefortheattitudecontrolsystemhardware.Inthisproposedembeddedattitudecontrolsystemdesignfora1UCubeSat, pointingisobtainedthroughatwo-stageapproachinvolvingcoarseandfinecontrolmodes.Finecontrolisachievedthroughthe useofthreereactionwheelsorthreemagnetorquersandonereactionwheelalongthepitchaxis.Significantdesignworkhasbeen conductedtorealizetheproposedarchitecture.Inthispaper,wepresentanoverviewoftheembeddedattitudecontrolsystem design;theverificationresultsfromnumericalsimulationstudiestodemonstratetheperformanceofaCubeSat-classnanosatellite; andaseriesofair-bearingverificationtestsonnanosatelliteattitudecontrolsystemhardwarethatcomparestheperformanceofthe proposednonlinearcontrollerwithaproportional-integral-derivativecontroller.


Introduction
The development of nanosatellites (with a mass of 1-10 kg) is currently a significant trend in the area of space science and engineering research. The development of CubeSat-class nanosatellites started in 1999 as a collaborative effort between California Polytechnic State University and Stanford University and has achieved great success as a way to efficiently construct and orbit small, inexpensive satellites using commercial technology. CubeSat, in general, is described as a class of nanosatellites ranging from 1 kg, 10 × 10 × 10 cm 3 , and upwards in 10 cm increments of length. Currently more than 50 research groups around the world are developing CubeSatclass nanosatellites for technology demonstration and scientific and student training missions. A solid model of a typical 1U CubeSat with attitude control systems (ACS) is shown in Figure 1.
Full-scale satellite attitude control systems are generally too large or too expensive to be installed in CubeSat-class nanosatellites [1], so passive attitude control systems have usually been used for nanosatellites in the past [2,3]. More active attitude control subsystems [4] in CubeSat-class nanosatellites have been implemented with the development of suitable actuators like magnetorquers (torque coils or torque rods) and small-sized reaction wheels [5,6]. An overview of the proposed ACS design adopted for this study is shown in Figure 2. Currently, commercial nanosatellite torque rods and reaction wheels are too expensive for use in many research nanosatellite projects. The contributions of this research are the development of ACS hardware from off-the-shelf components, complete simulation of the ACS system, and validation testing of the ACS system for attitude control in the lab environment.
In this paper, we first briefly describe the ACS hardware proposed for CubeSat-class nanosatellite missions. We outline the hardware development of the ACS actuators in Section 2. In particular, we describe the sizing and design of the magnetorquers. More discussions on the ACS hardware selection, design, and characterization for CubeSat-class nanosatellite missions, currently under development at York University, can be also found in [7][8][9][10][11]. In Sections 3 and 4, we describe the satellite system models and the results from the simulation study based on this design. In Section 5, we show the ground testing results of the hardware and software system. Section 6 includes future work that is planned. Section 7 concludes the paper.

Attitude Sensors.
Attitude magnetic sensor hardware in the current study consists of a Honeywell HMC5883L threeaxis MEMS magnetometer for magnetic field measurements. Angular rate information is obtained in three axes from three orthogonally mounted Analog Devices ADXRS614 MEMS gyroscopes. The attitude control system is managed by an AT91SAM9260 32-bit ARM9 microcontroller that runs embedded Linux, with 32 MB SRAM, and 256 MB NAND Flash attached for volatile and nonvolatile storage. All programming of control algorithms is accomplished in the C language using the GNU C compiler for the ARM processor. The system is designed for power-efficient operation because there is typically less than 3 W generated from the photovoltaics on a typical 1U CubeSat in low-earth orbit, and a battery must be used during eclipse periods.

Magnetorquer Design.
Magnetic torque coils, also referred to as magnetorquers, in CubeSat-class nanosatellites provide baseline control in many small satellites. They are commercially available in two typical configurations: in loose coils of flat-wound wire and in tightly wound coils around a permalloy rod. The rod configuration is often preferred because of its compactness and rigidity and the use of highpermeability, , materials for the core. To meet the mass and power requirements of a nanosatellite, a maximum mass, , of 30 g and a conservative maximum power draw, , of 0.2 W were set, and a typical maximum supply voltage, , between 3.7 V and 4.2 V was assumed to avoid having to step up voltage on power components. After combining the power and mass equations (1), where is resistance, is the resistivity of the wire, and is the density, and solving for the core radius, , and length, , The power and mass constraints were applied using (1), and a power value was estimated as the lesser of 0.2 W and the power dissipation was achieved at the maximum current for the wire ] . (2) Using (2) from the well-known solenoid equation and the relations derived in [12], where is the demagnetizing factor, a parametric analysis of the effect of core length and core radius on magnetic dipole moment, , was used to determine the optimal length and radius of the core material, given the wire thickness and corresponding length to satisfy the power and dipole moment requirements. Figure 3 illustrates the effect of core sizing on generated magnetic moment. The number of turns is implicitly determined, as the dipole moment of the torque rod is independent of the number of turns of wire, and the core radius is also constrained to sizes that are commercially available.
To maximize the field generated with the dimensions while satisfying the design constraints, a prototype magnetorquer was designed with 70 mm long permalloy core and 36 AWG wire to provide a maximum load power of 200 mW at 4.2 V. The design parameters of the constructed torque rods are shown in Table 1.
In order to precisely wind 36 AWG wires around a core, a coil winding machine was designed and assembled using stepper motors and L298 H-bridge drivers controlled by an ATMega644P microcontroller. A permalloy core is rotated by one motor, while another positions a plastic feeder guide from the wire spool. The winder, shown with a completed torque rod in Figure 4, allows a torque rod to be automatically wound by setting the number of turns required, length of the core, and thickness of the wire, which determines the ratio of winding speed to feeder speed.

Reaction Wheel Design.
Pointing and slew maneuvering of satellites are often accomplished by a motorized rotating mass such as a reaction wheel and momentum wheel, which provide maneuvering torque and momentum storage [8]. Reaction wheels can provide a high degree of attitude control accuracy with the limitation that the wheel may reach saturation after continued use, requiring an additional momentum control method such as magnetorquers to desaturate the wheel in a process known as momentum dumping.
Each of the reaction wheels in the proposed ACS system consists of a steel cylinder that is press-fitted to the shaft of a Faulhaber brushless flat micromotor. Design choices for the motor were limited to inexpensive commercial motors with low-power consumption, and the reaction wheels were sized to provide maximum momentum storage given the mass and volume constraints of a 1U CubeSat. Three reaction wheels     can be used in the ACS if maximum control authority is required. Table 2 shows the design parameters of the reaction wheels used on the proposed ACS [13]. A completed reaction wheel assembly is shown in Figure 5.

Electronic Integration of ACS Components.
To control the reaction wheel and magnetorquers hardware and house the attitude sensors and actuator drivers, a printed circuit board (PCB) was fabricated, shown in Figure 6. The board stacks with existing PC/104 sized on-board computer (OBC) hardware and provides both I/O breakout and power supplies for the ACS hardware. It contains 3.3 V and 5 V switching supplies for the ACS sensors, as well as external interfaces for a battery and radio to be used specifically for air-bearing ACS testing. The board makes a HMC5883 three-axis magnetometer, an ADXL345 3-axis accelerometer, and an ITG-3200 3-axis MEMS rate gyroscope available on the OBC I 2 C bus. Primary rate sensing for attitude control is accomplished by three independent ADXRS614 rate gyro units oriented on orthogonal axes by means of right-angle IC sockets and connected to the first three ADC channels on the OBC. This allows accurate high-speed sampling of rotation rates for use by the attitude controller. To drive the magnetorquers, three BD6212 integrated H-bridges are used, controlled by three PWM channels from the OBC and three general purpose IO pins for current direction control. To allow one PWM signal and one direction pin to control each H-bridge, the inputs are demultiplexed by a SN74LVC1G8 tristate output demultiplexer and pull-up resistors. In full operation, the board draws up to 100 mW of power on average, though components can be shut down as needed to conserve power if not in use.

Attitude Equations of Motions.
In this section, the satellite is modelled as a rigid body with actuators that provide torques about three mutually perpendicular axes that defines a body-fixed frame. The equations of motion [14,15] are given bŷ̇=  wheels whose columns represent the influence of each wheel on the angular acceleration of the satellite. Ω is the velocity of a reaction wheel, is the torque control provided by the reaction wheel, is the torque control provided by the magnetorquers, and is the bounded external disturbance, which is a sum of the gravity gradient gravity , aerodynamic aero , and solar radiation pressure solar disturbances.
The gravity gradient disturbance is gravity = where is the gravitational parameter of the Earth, is the semimajor axis of the orbit, and is the direction cosine matrix in terms of quaternions.
The aerodynamic disturbance is aero = /2 V 2 , where is the coefficient of drag for a flat plate, is the cross-sectional area causing aerodynamic drag, V is the satellite velocity, is the distance between the centre of pressure and the centre of gravity, and is the atmospheric density related to the altitude.
The solar radiation pressure disturbance is solar = / (1 + ) , where is the solar constant at the Earth's orbital distance from the Sun, is the speed of light, is the illuminated surface area, and is the surface reflectance.

Attitude Kinematics.
The satellite attitude kinematics is represented using quaternionṡ .  In terms of Euler angles, we can also express the satellite attitude as where is the roll angle about the -axis, is the pitch angle about the -axis, and is the yaw about the -axis.

Sensor Models.
Magnetic field vectors are obtained in the orbit reference frame Journal of Control Science and Engineering 5 where 0 is the angular velocity of the orbit with respect to the inertial frame, 0 is the distance from the center of the satellite to the center of the Earth, is the orbit inclination, is the magnetic dipole tilt, is the spin rate of the Earth, and is the magnetic dipole moment of the Earth. The magnetometer model is where is the direction cosine matrix in terms of quaternions, is the zero mean Gaussian white noise of the magnetometer, is the vector formed with the components of the Earth's magnetic field in the body frame of the reference, and = [ ]. is the magnetometer bias.
The angular velocity is measured from three rate gyroscopes. The model is given by where is the output of a gyroscope and is the real angular rate of the gyro. and are Gaussian white noise. is the random drift of the gyro and is the drift constant.

Actuator Models.
Reaction wheels are widely used to perform precise satellite attitude maneuvers because they allow continuous and smooth control of internal torques. Torques are produced on the satellite by accelerating or decelerating the reaction wheels. Let the torque demanded by the satellite be denoted as , where = (Ω +̇). The input voltage required to control the actuator dynamics of the reaction wheel can be written as where is the motor torque constant, is the back-EMF constant, is the armature resistance, and friction in the reaction wheels is ignored. The maximum voltage of the reaction wheel is 4.2 V, and a dead zone for the reaction wheel is estimated to be below 1 V. is 0.0082, is 0.007, is 0.5, and the moment of inertia of the reaction wheel is 0.0001 kg m 2 .

Satellite Attitude Control Laws.
Magnetic control has been used over many years [16,17] for small spacecraft attitude control. The main drawback of magnetic control is that magnetic torque is two-dimensional and it is only present in the plane perpendicular to the magnetic field vector [18]. The accuracy of satellite attitude control systems (ACS) using only magnetic actuators is known to be accurate on the order of 0.4-0.5 degree [18]. The satellite cannot be controlled precisely in three-dimensional space using only magnetorquers [18], but the combination of magnetorquers with one reaction wheel expands the two-dimensional control torque possibilities to be three-dimensional. The attitude accuracy of the combined actuators has been compared with three reaction wheels-based attitude control in the references [18,19]. Classical sliding mode control has also been used for magnetic actuated spacecraft [20,21]. However, the proposed nonlinear adaptive fuzzy sliding mode control law has never been used in magnetic attitude control.
To address the attitude tracking problem, the attitude tracking error = ( , 4 ) is defined as the relative orientation between the body frame and the desired frame with orientation = ( , 4 ) . In order to apply the proposed nonlinear controller, the equations of motion are rewritten as = ( ,̇) +̂+̂+̂.
The adaptive fuzzy sliding mode magnetic control law is given by Here,̂= × are the torques generated by the magnetorquers, is the vector of magnetic dipoles for the three magnetorquers, and is the vector formed with the components of the Earth's magnetic field in the body frame of the reference. =̇+ is the sliding surface. and are the adaptive parameters and fuzzy weight functions generated by the fuzzy logic systems [22], and , 1 , 2 , , , are positive constants used for tuning the control response. Remark 1. AFSMC controller design details can be found in the author's previous papers [11]. The design includes: (1) Sliding surface design [22] and (2) fuzzy logic system design [22].

Simulation
Results. The attitude detumbling and attitude stabilization phases are considered in the ACS simulation. The B-dot algorithm, PD magnetic control law, and adaptive fuzzy sliding mode magnetic control law are used for the two phases, respectively. We note that the orbit used for the present simulation study is a 500 km circular orbit with 45 ∘ inclination. At this altitude, the total disturbance torque for 1U CubeSats is estimated to be on the order of 5 × 10 −7 Nm. This is intended to be a slight overestimation to include a safety margin. control [1], as it makes use of the derivative of the magnetic field " ". For a CubeSat with moment of inertia = diag(0.002, 0.002, 0.002) kg m 2 , we include the external disturbances (aerodynamic, gravity gradient, and solar pressure), set the desired quaternion to be (0, 0, 0, 1), set the initial quaternion to be (0.1, −0.1, 0.1, 0.9849), and assume the magnetic dipole maximum of the rods to be 0.1 Am 2 . The Euler angle tracking errors, angular velocity tracking errors, and magnetic torquers, magnetic dipoles results are shown in Figure 7. The satellite starts at the selected tip-off rate, and, after 1 orbit, the angular velocities are reduced to the required rates before continuing with other ACS tasks.

Detumbling Mode and Stabilization Mode
Scenario 2. Now, we consider a CubeSat with the same moment of inertia and orbit and assume the magnetic dipole maximum of the magnetorquer to be 0.4 Am 2 with a magnetometer sensor bias calculated by 20 * 10 −4 * rand(1). Proportional-derivative (PD) magnetic control [23] laws (shown in (15)) are used in this simulation and the results over 6 orbits are shown in Figure 8. During the first three orbits, three Journal of Control Science and Engineering magnetorquers are used for the detumbling mode. In the second three orbits, three magnetorquers and one reaction wheel are used for the stable mode. The attitude control accuracy is less than 0.02 degree while using the PD magnetic control lawŝ= × , = 1 × , = 1 × + 2 × .

Attitude Stabilization Mode: Nadir and Limb Pointing with Three Magnetorquers and One Pitch Reaction Wheel.
Next, we consider the second stage of nanosatellite control with a low initial angular velocity after detumbling and large slew angle target for limb and nadir pointing. The configuration with three magnetorquers and one flywheel [24] has been used for many years. In a real nanosatellite mission, hardware failures of the reaction wheels are very common [19]. When there are two wheel failures, the ACS can be switched from using three reaction wheels to three magnetorquers and one reaction wheel, and attitude control accuracy maintained using this method. The adaptive fuzzy sliding mode magnetic control laws are shown in (11)- (14). The attitude control accuracy using the nonlinear adaptive fuzzy sliding mode control law will be more robust to the external disturbances than using the PD magnetic control law in (15). quaternion set to (0, 0.5736, 0, 0.8192) is examined using AFSMC over 10 orbits. The wheel dead zone is not considered here. The initial quaternion is (0.1, −0.1, 0.1, 0.9849) and initial angular velocity is (0.0169, 0.0169, 0.0169) rad/s. Considering only the pitch reaction wheel is available, the numerical simulations demonstrate that the proposed technique achieves a high pointing accuracy (<0.09 degree) for small satellites. The magnetic dipoles from the three magnetorquers, attitude tracking errors, wheel speed, and wheel voltage are shown in Figure 9.
Scenario 4. An ACS using one reaction wheel and three magnetorquers as actuators for nadir pointing with the desired quaternion that is set to (0, 0, 0, 1) is examined using AFSMC over 10 orbits. The wheel dead zone is assumed to be ±1.0 V. The initial quaternion is angular velocity is (0.0169, 0.0169, 0.0169) rad/s. The pitch reaction wheel and three magnetorquers are used. These simulations demonstrate that the proposed technique can also achieve high accuracy (<0.09 degree with all disturbances) pointing control for small satellites. The magnetic dipoles of the three magnetorquers, attitude tracking errors, wheel speed, and wheel voltage are shown in Figure 10. It takes about 40 orbits for the wheel speed to increase from 0 to 2000 rpm (209 rad/s).

Attitude Stabilization Mode: Nadir Pointing with
Three Reaction Wheels Scenario 5. An ACS using three reaction wheels as actuators for nadir pointing with the desired quaternion set to (0, 0, 0, 1) is examined using AFSMC over 0.1 orbits. The wheel dead zone is assumed to be ±1.0 V. The initial quaternion is achieve high attitude control accuracy (<0.008 degree with all disturbances). The reaction wheel attitude control laws use (11) and (12). The settling time is shorter and the pointing accuracy is higher than that achieved using only three magnetorquers and one reaction wheel as actuators. However, the power consumption is higher than using three magnetorquers and one reaction wheel. The Euler angle tracking errors, control inputs, wheel speeds, and wheel voltages are shown in Figures 11, 12, 13, and 14.

Spherical Air-Bearing Testbed for Satellite Attitude Control
Systems. The ground testing of the proposed CubeSat ACS design was performed at York University using a nanosatellite attitude control testbed. This facility consists of a spherical air-bearing platform [25,26] suspended upon a thin layer of air providing a full three degrees of freedom with negligible friction for ACS testing. The platform includes a manual balancing system and platform electronics that include an on-board computer (OBC), wireless transceiver for telemetry, reference inertial measurement unit (IMU), power distribution board, and batteries. The air-bearing system used for 1U CubeSat testing is shown in Figure 15.

Ground Test Results: ACS Testing Results with Three Reaction Wheel Actuators.
Nonlinear attitude control has been explored widely in theory [14,27,28]. In real satellite applications, nonlinear controllers are usually not selected due to their complexity of design. We have tested nonlinear control algorithms [11] with our spherical air-bearing system. We now test the proposed control method (from (11) and (12)) on this system using the sensors and ACS board described above and three-axis reaction wheel actuation. A PID control law is also used for comparison on the same hardware. The control laws are programmed in the C language, and the OBC runs the Linux operating system. More details of the implementation can be also found in [11]. Here, we will show air-bearing system test results with a 1U CubeSat. The design parameters of the control laws used are given in Tables 3 and 4.    Figures 16 and 17 show the attitude tracking errors, AFSMC/PID control output signals, reaction wheel voltages, and reaction wheel velocities for a 90 degree yaw slew of the system about the -axis while maintaining 0 degrees of roll  normal in size, is considered to be present about the and rotational axes. Compared to the PID controller, the AFSMC controller uses nearly the same gain and has much better tracking performance under these conditions.

Future Work
While the ground test demonstrates the effective and promising control accuracy of the proposed ACS design, it is difficult to predict the performance of pure and hybrid magnetic control as the Earth's magnetic field present in the test facility is constant and invariant with many sources of additional magnetic noise. The next step in the development of a complete ACS test facility is the addition of a Helmholtz cage for magnetic control tests. The magnetic cage and the airbearing system in the lab are shown in Figure 18 and are presently being prepared for air-bearing magnetic control testing. Future work will demonstrate the effectiveness of magnetic control in further ground testing.

Conclusion
In this paper, the proposed attitude control system design will allow inexpensive and capable satellites to be developed for academic use. The proposed attitude control system uses three reaction wheels as actuators or one wheel with three magnetorquers as actuators. The hardware designs of the actuators and embedded attitude control systems are also described for prototype development. Five different scenarios of numerical simulation results for a 1U CubeSat-class nanosatellite show the effectiveness of the proposed attitude control design for detumbling and attitude pointing purposes. The ground testing results in this paper provide a promising comparison of an adaptive fuzzy sliding mode controller with a conventional proportional-integral-derivative controller for a 1U CubeSat-class nanosatellite. The nanosatellite testing hardware can be also extended for use in 2U or 3U CubeSatclass nanosatellites in the future.