Hover Vehicle, bouncing out of control and falling into the infinite abyss

Greetings everybody!

I am not very good at maths and I managed to salvage some math from other hover vehicles to create this, however there is a very huge problem. What I hope to achieve here is to create a smooth hover vehicle which doesn’t bounce out of control once I change network ownership or enter a lower or high point of terrain.

Forward and steering movement is quite smooth currently however the only issue being that the Y axis which is supposed to keep it stable and hover goes insane when network ownership is switched to a player, or you go to a lower point of terrain.

This might sound confusing but i’ll put it simply: ’ The hover vehicle does not keep still on the Y axis and fails to keep stable when going to a lower point of terrain ’

Here is a video of them going insane: https://streamable.com/nceqd

Here is a video of them going insane when moving down: https://streamable.com/vcpnm

I have no clue why it’s so bouncy here is the hover vehicle model:

Any help would be much appreciated! (I’m quite new to the devforums apologies)

EDIT: I have now fixed the vehicle, by using a different body mover.

2 Likes

The control law you are using to stabilize the body doesn’t really make sense. I see you have a feedfoward term with GetMass, but then you have a bunch of of random stuff that is dependent on the distance from the floor.

If you are just beginning to learn how to program, I would recommend you start out with just a PID controller (without I or D terms…). This means that you get a control law u = FF + error *p where error is your setpoint distance - observed distance. FeedFoward (FF) is just the weight of your object.

As you improve your programming & mathematics skills, you can then apply more advanced control system techniques to have better performance. LQR control and even MPC could be applied if you wish.

2 Likes

The distance to the floor provides the amount of force required to reach a certain level above from the ground which is static and cannot be dynamicaly changed the rays provide the distance the hover vehicle is from the floor.

1 Like

Using a different body mover helped an extreme amount, I can now mark this as my solution.
I basically was using a vectorforce to move up and down but it was being too reactive because of the amount of times force was changing.

1 Like