E320 sunroof stops in strange places

My sunroof has the wrong stops registered. It's so bad that I can't shut it with the combination switch but by pushing it up, as though I were tilting the
rear part of the sunroof. It thinks it is in a different position than it is, it seems. Are these registers done electronically, like on window motors, or are they physically embedded in the track? If done electonically, what is the procedure to reset them properly?
THANKS!
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
had a similar problem on my 99 E320. I *believe* that the solution was to open the sunroof all the way and keep holding the button in the open position for several seconds (similar to re-synch the auto close feature on the windows.
HTH.

it
the
is,
or
the
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
The memory has been lost. Open the sunroof (up, not sliding back) and keep pushing the switch until you hear the click. Then it will work as normal in the sliding direction.
MC

it
the
is,
or
the
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Motorsforum.com is a website by car enthusiasts for car enthusiasts. It is not affiliated with any of the car or spare part manufacturers or car dealers discussed here. All logos and trade names are the property of their respective owners.