Self Correcting Scissor Lift

Does anyone have the code for a self correcting scissor lift that uses potentiometers. By this I mean that if the scissor lift becomes unbalanced, the potentiometers measuring the angles will re balance the scissor lift. This is my code for the scissor lift…

	
		if(abs(Angle1 - Angle2) > 2)
                       {
				motor[ScissorLiftLeft] = 0;
				motor[ScissorLiftRight] = 0;
			}
 

All you need are separate P(ID) loops for the 2 sides. There are many threads on this forum outlining how to make P(ID) loops.

THX

This lesson from the Carnegie Mellon cortex training should help give you ideas. It shows how to program automatic straightening for drive systems. It isn’t much of a stretch to apply this to two sides of a scissor lift.

http://www.education.rec.ri.cmu.edu/products/cortex_video_trainer/lesson/3-5AutomatedStraightening1.html