Axis control problem

When you first start my game, the axis control gets confused. You have to move the joystick to all ranges to get it to go back to center. If you were to move the joystick to the left it reads fine until you let go. Then the center point goes all the way to the right until you move it to the right. After that it finds center. Same with up and down.

Is there some kind of automatic calibration I need to perform at the beginning of my game?

Here is a joystick calibration script. It saves the value to a text file (calibration scene) and load it in the game scene. After the first calibration you can start direct in the game scene. So you only need to calibrate your joystick one time.
analogJoystick2_53.blend (384 KB)
analogJoystick.blend (255 KB)