Investigation of Gain Tuning and Sensor Noise for CubeSat B-dot Detumbling and 3-axis PD Magnetic Attitude Control