Perpendicular to a Line at a Point on the Line 

When the given point is on the given line, you need only mark off a segment that contains the point as its midpoint and then construct the perpendicular bisector of that segment:

Set the compass at any convenient length and mark arcs of the circle with the given point as its center and intersecting the line at points A and B

 

Then open the compass a little more and construct the perpendicular bisector of segment AB:

  

Here is an animation of this construction.