hi everyone. i have a problem for pid controller. i want to make a heading controller with geographic map. i can control heading. but when i choose desired heading 0 degree its not working efficiently. for example sensor is 40 and desired is 0. its decreasing first. and after a while it catches 0 degree and pass 359 ( at geographical map 360 degree one turn and north is 0 degree) when it pass 359 or 359.9999 ( that is actually an over shoot) error is going big. the real error is 1 degree when sensor is 359 degree but mathematical the error is 359. how can i solve this problem?