Initial state: I recently bought a S40 II. The left headlight was very very high, while the right one was just a bit too high. I took it to the dealer (in Europe you have some sort of warranty when buying from a dealer), but the situation did not improve.
Diagnostics: I read the telemetry from the Headlight Control Module, HCM, and I saw that the front axle sensor output was 0.48V. When going for a ride, it eventually jumped to 4.5V every now and then, without intermediate values. When trying to perform the calibration process it failed, with a warning, and from that point on I was getting the text message on the dashboard everytime I would start the car, plus the “!” sign continuously on. Lights were not moving when starting the car, bending lights would not work, and the small led above the ABL switch was blinking.
Repair attempt: I bought an aftermarket sensor (it came with the connecting rods to the body and the suspension) and installed it with the sensor arm pointing forwards (seen that from a youtuber), even though the assembled part came pointing backwards. A similar S40 parked on the street had the arm pointing forwards. The output I got was 0.45V, out of range again! This is the time of my previous post in this discussion.
Improvement: I unscrewed the bolt from the sensor arm and rotated the arm progresively by a few degrees to either side, reading the telemetry. I realised that the sensor has angle intervals where it works perfectly, while in other intervals it outputs about 0.5V or 4.5V. So, this time I connected it pointing backwards, output was now within range, just a bit less than 2V. Also, in this position the lower connecting rod sits better (the other way seems a forced position). The calibration process went through, and the warning on the dash disappeared. Headlights started to work up-down and left-right as they should. The only remaining problem was that the elevation was too high.
Final: Elevation adjustment. The left-right adjustment screw is well visible, but the up-down adjustment is really hidden down towards the car center line. Plus, in my case, the left one seemed to have been forced out of place, and it was not doing anything. Luckily, there is an alternative point for elevation adjustment, which is accessible only by taking out the headlight. It needs an Allen wrench, plus you have to install and take out the complete headlamp several times until the correct elevation is found.
Advice: check if there are angle intervals where the sensor output is within range. If there are, but don’t coincide with your geometry, try another position. If that is not possible, or it does not work either, maybe the sensor has been manufactured for the other axle or for another car. This is why our front/rear sensors look the same, but have different references, simply because the sensitive angle interval must match the installation geometry.
Many thanks to davidggly for this thread, and to the rest of the registered users. This is my small contribution that will hopefully help someone in the future.