{"push_id":547550194,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"3a5ebd9de8f0c770bb58b0bd0af2da0df7778acc","before":"d00cd0f8c7a27a1d5b43bd189caae15f9dabbb9c","commits":[{"sha":"3a5ebd9de8f0c770bb58b0bd0af2da0df7778acc","author":{"email":"a4a49fecfd2ca73683135815c319652a63080c92@gmail.com","name":"Anders Petersen"},"message":"API change in elev.h: Replaced `elev_set_speed` with `elev_set_motor_direction`\n\nRationale:\nThe utility for being able to set the speed was already low, and `elev_set_speed` had a peculiar implementation with several subtleties: The `speed` parameter did not scale linearly with the actual speed of the elevator, setting the speed to 0 did not set the analog output to 0, and the rationale for toggling of the direction was unfounded.\n\nThe new implementation correctly sets the analog value to 0, such that the elevator stops sharply.\nThe constant value 2800 is an arbitrary choice, and should give a travel time between floors of about 2.5 seconds.\n\nNotes:\nThe old implementation may have historical reasons. My conjecture: The intention of setting the analog value to 2048 was the elevator should gracefully glide to a halt, but as the elevators were worn down from use, some of them started gliding past the magnetic sensor. To counteract this, someone implemented the toggling of the direction bit.\n\nThe function describing the relation between travel time (between two floors) and motor input (analog value) is of the form `a * exp(b/t) + c`, with approximate values `a = 1.3, b = 15, c = 2200`. Note that these values are likely to have a large variation between the elevators.","distinct":true,"url":"https://api.github.com/repos/TTK4145/Project/commits/3a5ebd9de8f0c770bb58b0bd0af2da0df7778acc"}]}