Today I've conducted a 3rd test of the gimbal, and the 2nd test using the stationary COM harness. I've tweaked the code a bit by increasing the refresh rate of the gyro readings and decreasing the activation angle. I've redesigned the engine mount/gimbal a bit, so that the spring that provides the restorative force pulls the engine mount into the rest of the mechanism rather than pushing it into a flat. This mechanism is more reliable because it keeps the engine much more square with the rest of the rocket. It also means that the spring does not compress when the engine burns, which means that the geometry of the gimbal is the same whether the engine is burning or not, or if an engine with different thrust is being used. Looking back, the fact that the geometry changed at all was a poor design choice. I'm glad I noticed this because I think it made a big difference. I've also lubricated the ball joint that the engine mount sits in.
In making these improvements, I had to deal with some technical setbacks with repairing the 3D printer. I was having some issues getting reliable prints, and I ended up killing a whole day cleaning and calibrating. I also printed an improved fan duct, which helped a lot. I've decided to print everything with a brim now, as I've noticed that slight curling of edges was screwing with alignment of some crucial parts, including the engine mount.
Here's a clip of the test today:
Definitely the best test so far. I think that the initial rotation was caused by the initial spike of thrust of the engine. It did a pretty good job correcting, but I'm not sure why it took so long for the gimbal to pivot the engine. As it spun back to being neutral it did a beautiful job of angling the engine in the opposite direction to negate the spin. The maneuver was so quick that I only noticed it by watching the frame-by-frame.
Overall, I was really happy with this test. Not perfect, but good progress. I'm still having some issues where each solenoid is angling the engine different amounts. I believe this is due to tolerances on the solenoids and on the 3D printed parts. I will try to incorporate some way to calibrate the height of each solenoid.
I'm not too concerned about the initial rotation, because a launch rod could be used to keep the rocket straight for the initial thrust spike. I think the next test should be from a launch rod with longer, mobile tethers, but with the same COM harness.