when you pull your hands from joystick it doesnt move to middle position like joystick.
That's one hell of a sentence to understand,

I think what you want to achieve - there is a high likelihood that I am wrong on this - is what people call incremental PID.
A simpler way to achieve that is to calculate the pwm on the delta of two variables: joystick's current position, and joystick's decayed position.
Something like this may work:
js_cur = joystick_read(); //read joystick's current position
js_dcy+= (js_cur - js_dcy) * alpha; //revise js_decay to approach js_cur, alpha determines the speed of decay
js_pwm = f(js_cur - js_dcy); //generate pwm based on the difference between js_cur and js_dcy
Right after you have moved the joystick, js_pwm takes the highest value. After that, js_dcy starts to approaching js_cur and the pwm value starts to decline until the js_cur/js_dcy are sufficiently close.
Essentially it is an auto-centering algorithm.
You will need to figure out how to handle the negative values when generating pwm.