|
Re: Camera for turning
Making the motor speed proportional to the error will stop the oscillations if the proportional constant is low enough. But then you'll probably find the robot won't quite get to the desired angle, and you'll want to add some error integration to force it to move after it's been off-angle long enough. At that point, you might have some overshoot, and to fix that requires some negative feedback based on the rate of change of the error.
In short, it's time to implement a PID control system for your robot direction. Search the forums to find plenty of information, and even some code, that will do what you need.
|