Log in

View Full Version : PID line follower vex


ahwei
20-06-2011, 01:33
As im new in VEX...Can anybody tell me if i can implement PID control using easyc? Because it is the only software i got... If yes, can somebody send me the standard code for it...I need it for my project really much... I will appreciate some help expertsss....

svenw
20-06-2011, 08:03
I recently found this as I was looking for how to do PID loops with lego. It explains how to make a PID controller and gives the pseudo code.
Hopefully you find it as helpful as I did.

http://www.inpharmix.com/jps/PID_Controller_For_Lego_Mindstorms_Robots.html

gblake
20-06-2011, 10:58
You can implement just about any sort of feedback loop in EasyC (PID is not the only form of feedback-loop control algorithm).

As the algorithm gets more complex, you will want to switch to EasyC Pro because the icons and flowcharts of ordinary EasyC become to bulky and hard to read/maintain.

Up until you stumble over some way to confuse the EasyC compiler. the only limits are the speed of the computer you are using, and its storage capacity. You are far more likely to have trouble with either of those before EasyC will fail you.

Go to the www.VexForum.com web pages and do a search there. There are discussions and sample code for implementing feedback loops to follow lines.

Blake

Jacoblint228
13-01-2013, 17:26
Does anyone know where you can set a PID loop where the motor will not move unless the driver drives it?

Foster
13-01-2013, 17:48
Normally you have a motor that drives some device (like an arm). There is some sensor (like a potentiometer) that tells the position of the arm. The PID code drives the motor until the sensor says it's in position. Then it stops moving the arm.

Based on that, I'm not sure what you are looking for. Can you be more descriptive in what you want?

Anupam Goli
13-01-2013, 20:32
I think what Jacob is asking for is a method to have the PID not run if the joystick value is 0. If there is no tolerance, the PID loop will try to tune a value of 0 on the drivetrain, which does take unnecessary processor power. One thing I would do is set a limit, maybe + or - 0.1 on the joystick. Once this value is exceeded, then the PID loop could start running.