I am building a submarine with two thrusters each of which is connected to two servos allowing 360 degrees of motion. I have used the fsolve function in octave to solve the nonlinear system of equations to get the servo angles and thrust needed to create my desired motion. I want the Arduino to take a string input <(x,y,z,roll,pitch,yaw> and run those inputs through fsolve and output the angles and thrusts to be sent to the respective servos and motor controllers. Unfortunately fsolve does not exist in Arduino so I will be trying to program it in based on the source code provided by octave. I am very new to programming in Arduino so any help will be very appreciated. Is this goal achievable?
Paul the inputs will be given as a string. Attached is the current code I have commented where I want to add the fsolve to get the correct outputs to send to the motors and servos.
Just a guess here. But, I’m thinking on a low-end microcontroller you’re going to have to come up with a different method than a brute force numerical equation solver.
I want the Arduino to take a string input <(x,y,z,roll,pitch,yaw> and run those inputs through fsolve and output the angles and thrusts to be sent to the respective servos and motor controllers.
Here is a novel idea: the computer that is supposed to send the strings to the Arduino could run Octave, and
output the angles and thrusts to be sent to the respective servos and motor controllers.