Modified dq calculation to integrate and debugged sudden move problem(dq=0 initialze before emergency)