Today I tried to make my first program that stabilize 2 motors putted on a stick. I took the corresponding axis (y axis), normalized it and then used 2 if statements for each motor. The statements were then adding to the motor the initial velocity (which is a constant, and is defined in the top), and the current y axis value multiplied with a factor made of the y axis value divided by 200. I've used only the accelerometer's values.
motorThrust=initial_velocity+threshold*threshold/200 The value 200 was obtained during the experiments.
Now, you would ask, why the hack didn't I try something already made? Well, I want to develop on my own the algorithm. The results weren't so promising. The motors tend to stabilize, but unfortunately, they were too far from what I have expected.
This is a sample from my processing sketch: http://www.4shared.com/photo/JM_XVQik/graph_capture-0765.html -in the left there are the accelerometer values (green representing the z axis, white the y axis and red the x axis) -in the right there are the gyroscope values(red the x axis, and white the y axis). You can also see how the testing board oscillates more and more as the time flows.
I tend to think that the problem is with the vibrations. I've just putted me in the Arduino's situation. What would you do? The same, clearly. Except using an algorithm, do you know how can I reduce the vibrations to the sensing board? What materials could I use?
Thank you, RobertEagle