Hello everyone,
This is my first post, I have thoroughly searched for a similar topic but haven't found one. Please redirect me to a forum topic if one exists.
As part of a project I am developing a reaction wheel (RW) which is used to change the attitude of a satellite in one axis (a meccano test bed at this stage). The point is to create a PID controller that will attempt to maintain the attitude at 0 degree yaw angle. I am using an MPU6050 to detect the yaw angle and using this angle (converted to degrees) as an input for my PID controller. The MPU displays the yaw as an angle from 0 to 180 degrees and 0 to -180 degrees and my RW needs to spin either CW or CCW depending on the sign of yaw. Because the RW spins at high angular velocities I need to use regenerative braking when I have to reverse the direction of rotation.
So basically I need the braking to activate only when the satellite overshoots the 0 Setpoint and the yaw angle changes from positive to negative and vice a versa. Therefore I need the Arduino to detect when there is a change in sign.
Thank you XD
p.s I can post the code I currently have although I am still at the "drawing board" stage for this braking sequence upon yaw sign change and thought it wouldn't be that relevant.