WARNING: This page is about a different car, the 2017 Genesis G80. However, it is still accessible from the selected car via links, so may be relevant.
The middle speed sensor measures the direction of rotation of the 6C outer drum inside the transmission and delivers the readings to the TCM.