<s>[INST] position_velocity_controller.py from vpython

The code I will reference is from the 3D physics engine and simulator, vpython, as found here: https://github.com/vpython/vpython-jupyter/blob/master/examples/position_velocity_controller.py

Here is the code:
```
"""
Example usage of the position-velocity control system

This example demonstrates how to use the position-velocity control system in VPython.

The system transfers between two states:
    State 1: The cart will attempt to move to a position at x=2 m.
    State 2: The cart will attempt to move to a position at x=4 m.
"""

from vpython import *

# constants
g = 9.81  # m/s^2
m = 0.5   # kg
L = 0.25  # m
v_max = 2  # m/s
a_max = 2  # m/s^2

# setup scene
scene = canvas(title='Position-Velocity Controller', width=600, height=400)
box(pos=vector(-5, 0, 0))
box(pos=vector(5, 0, 0))
cart = box(pos=vector(0, 0, 0), size=vector(0.5, 0.1, 0.1), color=color.red)
pivot = sphere(pos=vector(0, 0, 0), radius=0.02)

# initial position, velocity and controller parameters
pos = vector(0, 0, 0)
vel = vector(0, 0, 0)
state = 1
target_pos = vector(2, 0, 0)
target_vel = vector(0, 0, 0)
target_acc = vector(0, 0, 0)

# time step
dt = 0.01

# controller parameters
k_p = 10  # proportional gain
k_v = 1   # velocity gain

# simulation loop
while True:
    rate(100)

    # Update the state
    if state == 1:
        target_pos = vector(2, 0, 0)
        if abs(cart.pos.x - target_pos.x) < 0.1:
            state = 2
    elif state == 2:
        target_pos = vector(4, 0, 0)
        if abs(cart.pos.x - target_pos.x) < 0.1:
            state = 1

    # controller
    pos_error = target_pos - cart.pos
    vel_error = target_vel - vel
    acc = k_p * pos_error + k_v * vel_error
    acc = acc / m

    # clamp acceleration
    acc = vector(max(min(acc.x, a_max), -a_max), 0, 0)

    # Integrate the acceleration
    vel += acc * dt
    vel = vector(max(min(vel.x, v_max), -v_max), 0, 0)
    cart.pos += vel * dt
```
I want the cart to move to the target position and stop, without any oscillations. 

I have tried changing the k_p and k_v values to 5.0 and 5.0 respectively and also tried putting the cart's velocity to zero once it reaches the target position. 

While these changes improved the cart's performance, the cart still oscillates slightly before it completely stops at the target position. 

How can I modify the controller to prevent oscillations?[/INST]