Method for automatic autonomous control of a tamping machine (C) when tamping newly laid switches ballasted to the top of the rail, for compacting the ballast bedding of a track in switches (A, B) with a device for determining a GPS position of the track maintenance machine in the track , namely with a GPS or RTK-GPS system for the precise and unambiguous approach of switches or sleepers , and with a position detection of the actuators of the working units (L a , L i , R a , R i , 16, 18, 19, 20, 22, 23) of the tamping machine, whereby firstly switch data (a i,,j , β, WP, t, L, n) of the switch to be processed are read into a control computer of the tamping machine (C), whereby the GPS position of the tamping machine (C) in the track is used to identify a switch to be processed, after which positioning instructions (P i ) for working units (L a , L i , R a , R i , 16, 18, 19, 20, 22, 23) for this switch are retrieved from a database , wherein the control computer subsequently generates position-accurate data of the positioning instructions (P i ) for the working units (L a , L i , R a , R i , 16, 18, 19, 20, 22, 23) at each sleeper (a i,j ) to be tamped in the switch area (1-51), wherein the tamping machine (C), depending on its position in the switch (A, B) and on the created data of the positioning instructions (P i ), moves to these positions with working units (L a , L i , R a , R i , 16, 18, 19, 20, 22, 23) assigned to the respective position and carries out the tamping process fully automatically and autonomously at the location of the respective position, and wherein with the aid of the GPS or RTK-GPS system installed on the tamping machine (C), an exact assignment of the sleepers to the track kilometer is made via the GPS coordinates, and the tamping machine (C) moves automatically from sleeper (a i,j ) to sleeper (a i,j ) via an automatic advance mechanism until the intended working area has been processed. the GPS position of the tamping machine (C) in the track is used to identify a switch to be processed, after which positioning instructions (P i ) for working units (L a , L i , R a , R i , 16, 18, 19, 20, 22, 23) for this switch are retrieved from a database , wherein the control computer subsequently generates position-accurate data of the positioning instructions (P i ) for the working units (L a , L i , R a , R i , 16, 18, 19, 20, 22, 23) at each sleeper (a i,j ) to be tamped in the switch area (1-51), wherein the tamping machine (C), depending on its position in the switch (A, B) and on the created data of the positioning instructions (P i ), moves to these positions with working units (L a , L i , R a , R i , 16, 18, 19, 20, 22, 23) assigned to the respective position and carries out the tamping process fully automatically and autonomously at the location of the respective position, and wherein with the aid of the GPS or RTK-GPS system installed on the tamping machine (C), an exact assignment of the sleepers to the track kilometer is made via the GPS coordinates, and the tamping machine (C) moves automatically from sleeper (a i,j ) to sleeper (a i,j ) via an automatic advance mechanism until the intended working area has been processed. <EOS>