Looks good to me except I would make the first line this
if w1 < calibra-hyst then high mosfet