bartboogmans / TurtleBoat

Compact vessel simulator on a single ROS node
3 stars 2 forks source link

Turning rate seems too little #7

Open bartboogmans opened 1 year ago

bartboogmans commented 1 year ago

During a waypoint following test in a circle it was found that the controller that works on the real ship does not yield enough turning rate on the nausbot TitoNeri model.

The below video shows the titon neri waypointfollowing matlab gui and matlab heading pid controller in the loop. Notice that the angles of the thrusters are at about ~rad ~60degrees but the ship is not turning fast at all, while the real ship would have almost turned at the spot at those angles. Screencast from 01-03-23 11:51:33.webm

@mvgijn ,As discussed through email, this thread to figure out the discrepancy between sim and real ship.

bartboogmans commented 1 year ago

Adjusted the sim to stream also internal forces on ros. A single test imposing actuator vector [1800,0,0,pi/2,0] yielded the following result on ros. image

image

using the implemented thruster relation yields correct result when these calculations are followed by hand with an input of v = 1800/60 = 30rps an a distance from thruster to CO of 0.42m

        self.thrustToForce = [lambda v: ((1.925e-5)*v*v*v+(1.061e-2)*v), # output: Newton, Input: RPS
                            lambda v: ((1.925e-5)*v*v*v+(1.061e-2)*v), # output: Newton, Input: RPS
                            lambda PWM_value: PWM_value*3.575] # output: Newton, Input is normalized pwm [-1:1]
bartboogmans commented 1 year ago
y forces: 1,925/100000*30*30*30 + 1,061/100*30 = 0.83805 Newton
torque z : (1,925/100000*30*30*30 + 1,061/100*30)*0,42 = 0.351981 Newton*meter

Comparing this to the measured values seems to make sense. image

Will look at the physics of the rigid body now, as this sample scenario behaves as expected.