This document is the thesis of Dmitriy Rivkin submitted in partial fulfillment of the requirements for a Master of Science degree in Computer Engineering from the University of California, Santa Cruz. The thesis investigates optimal control techniques for minimum energy attitude maneuvers of CubeSats using reaction wheels. It formulates the optimal control problem, develops algorithms to solve for optimal trajectories, and analyzes the performance of the optimal trajectories through simulations and hardware experiments on a CubeSat testbed. The thesis contributes to advancing optimal control methods for efficient attitude control of small satellites.