Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Encoder as PIDSource (http://www.chiefdelphi.com/forums/showthread.php?t=89800)

sircedric4 05-02-2011 08:41

Re: Encoder as PIDSource
 
So I added this in my constructor:

elevatorEncoder->SetPIDSourceParameter(Encoder::kDistance);

Is that correct? We want to test our robot today and see how it performs and I can't afford to introduce code problems outside of my experience level and lose a day of tweaking on our new hardware. (Today is hopefully first test day of our finalish robot)

I am not going to update the robot's image until I know this will work. We have a working set of code with the previous posts and I'll be using an un-updated computer to tweak our code while testing our robot today.

I am somewhat worried because when I was calling Encoder->, the SetPIDSourceParameter did not show up under the little menu of methods I could select. Also none of the colors changed when I entered the above line. Do I have to do a fresh build or something for the built in Windriver "IntelliSense" to catch up?

jhersh 07-02-2011 05:24

Re: Encoder as PIDSource
 
Quote:

Originally Posted by sircedric4 (Post 1016024)
So I added this in my constructor:

elevatorEncoder->SetPIDSourceParameter(Encoder::kDistance);

Is that correct? We want to test our robot today and see how it performs and I can't afford to introduce code problems outside of my experience level and lose a day of tweaking on our new hardware. (Today is hopefully first test day of our finalish robot)

I am not going to update the robot's image until I know this will work. We have a working set of code with the previous posts and I'll be using an un-updated computer to tweak our code while testing our robot today.

I am somewhat worried because when I was calling Encoder->, the SetPIDSourceParameter did not show up under the little menu of methods I could select. Also none of the colors changed when I entered the above line. Do I have to do a fresh build or something for the built in Windriver "IntelliSense" to catch up?

Looks OK to me. I'm not sure exactly what it takes to update the intellisense. Perhaps you have to refresh the project or reopen workbench or something.

-Joe

sircedric4 07-02-2011 20:13

Re: Encoder as PIDSource
 
All right, just to post our results, we got the new update on our robot, and the new Encoder class works a champ now. The code I posted earlier does work as posted if anyone else is looking for examples.

The "Intellisense" will update if you close and re-open Windriver. Good day today.

jwakeman 08-02-2011 10:21

Re: Encoder as PIDSource
 
It is nice that the Encoder class can be used as a PIDSource now but it ends up that it still doesn't help me. I am using one encoder for both position AND speed feedback. Not a problem tho i just create two classes, RatePIDSource and PositionPIDSource. I pass a reference to a single Encoder into the constructor of these two objects and in their PIDGet() return distance or rate accordingly.


All times are GMT -5. The time now is 14:27.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi