How to prevent a ridgedbody from tipping over

I’m working on a controller for a hover tank. How can I prevent it from tipping over more than 1/2 a degree? I want it to rock a little while it hovers, but don’t want it to climb up steep slopes.

void FixedUpdate () {
	if (!isServer) {
		return;
	}

	CheckGrounded ();
	Hoover ();

	Quaternion startRotation = _rigidbody.rotation;

	if (_moveForward) {
		float moveAmount = moveSpeed * Time.deltaTime;
		_rigidbody.MovePosition(_rigidbody.position + _rigidbody.transform.forward * moveAmount);
	}
	if (_moveBackward) {
		float moveAmount = (-moveSpeed * 0.6f) * Time.deltaTime;
		_rigidbody.MovePosition(_rigidbody.position + _rigidbody.transform.forward * moveAmount);
	}

	if (_turnLeft) {
		Quaternion rotateAmount = Quaternion.Euler(new Vector3(0f, -angularSpeed, 0f) * Time.deltaTime);
		_rigidbody.MoveRotation(_rigidbody.rotation * rotateAmount);
	}
	if (_turnRight) {
		Quaternion rotateAmount = Quaternion.Euler(new Vector3(0f, angularSpeed, 0f) * Time.deltaTime);
		_rigidbody.MoveRotation(_rigidbody.rotation * rotateAmount);
	}

	if (_jump && _isGrounded) {
		_isJumping = true;
	}

	if (_isJumping && _jumpTimeLeft > 0) {
		float moveAmount = jumpSpeed * Time.deltaTime;
		_rigidbody.MovePosition(_rigidbody.position + _rigidbody.transform.up * moveAmount);

		_jumpTimeLeft -= Time.deltaTime;
	} else if (_isJumping) {
		_isJumping = false;
		_jumpTimeLeft = jumpTime;

	}
}

void CheckGrounded() {
	Ray ray = new Ray(centerPoint.position, -centerPoint.up);
	RaycastHit hitInfo;

	if (Physics.Raycast(ray, out hitInfo, groundedThreshold, _groundLayer)) {
		_isGrounded = true;
	} else {
		_isGrounded = false;
	}
}

void Hoover() {
	foreach (Transform hoverPoint in hooverPoints) {
		Ray ray = new Ray(hoverPoint.position, -hoverPoint.up);
		RaycastHit hitInfo;

		if(Physics.Raycast(ray, out hitInfo, hooverHeight)) {
			float distance = Vector3.Distance(hoverPoint.position, hitInfo.point);

			if(distance < hooverHeight) {
				_rigidbody.AddForceAtPosition(hoverPoint.up * hooverForce * (1f - distance / hooverHeight), hoverPoint.position, ForceMode.Force);
			}
		}
	}
}

doesn’t just locking the x and z rotate constraints on the rigidBody component in the inspector window do it?

Sorry this is untested so i dont know if i got it all right but this would be the idea:

Quaternion q;
	float maxtip;
		

void Start() {
	q = transform.rotation;	
        maxtip = 5f;
	}  

void Update () {
		if (q.x - transform.rotation.x > maxtip) {
		transform.rotation = new Quaternion (q.x + maxtip, transform.rotation.y, transform.rotation.z, transform.rotation.w);
				}


		if (q.x - transform.rotation.x < -maxtip) {
		transform.rotation = new Quaternion (q.x - maxtip, transform.rotation.y, transform.rotation.z, transform.rotation.w);
		}

		if (q.z - transform.rotation.z > maxtip) {
		transform.rotation = new Quaternion (transform.rotation.x, transform.rotation.y, q.z + maxtip, transform.rotation.w);
		}


		if (q.z - transform.rotation.z < -maxtip) {
		transform.rotation = new Quaternion (transform.rotation.x, transform.rotation.y, q.z - maxtip, transform.rotation.w);
		}
}