LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder data into a PD closed control loop

Hey, basically for our current project, we have to create a program that will run through a cRio for a buggy, the buggy has 2 motors of maximum 12V supply. The bugggy must travel a certain distance, 8m, over an uneven distance and end up at a particular end point.

 

we are currently trying to create a a closed loop control system with a ramp input, then a Proportional Derivative system to alter the error from the encoders, which record the actual speed of the wheels.

 

However we are unsure about how to go about creating this in labview or simulate this as we do not have access to the actual practical equipment at the moment, any help or links to guides about how to go about this or general help would be greatly appreciate, feel free to ask any questions if i have I can be clear about anything anymore, but we are really struggling atm.

0 Kudos
Message 1 of 5
(2,375 Views)

First question: what, if any, toolkits and addons are available to you? Do you have access to the Control Design and Simulation VIs?

0 Kudos
Message 2 of 5
(2,346 Views)

Thanks for replying,

 Basically we arent using a control and simulation loop anymore as it was proving to be too advanced for what we need to do. We arent using any toolkit in particular, however our vi is within a case structure, the attached folder is the vi that we have created so far.

 

The simulated signals are to represent the encoder velocity values that we will obtain. If you can help us with any of the following it would be of great help:

 

1. We currently a ramp input to simulate the acceleration at the start but are unsure on how to keep a constant velocity after the maximum velocity is reached and to have a deceleration at the end.

2. We are unsure if what we have as P controller will actually minimise the error between desired velocity and actual velocity

3. We dont have a stop condition, it has to travel a known distance, can this be worked out from the data gathered from the encoders and a stop condition created?

 

We have access to the majority of applicable toolkits, shown in the attached photo.

 

Any guidance would be greatly appreciated.

Download All
0 Kudos
Message 3 of 5
(2,337 Views)

Here is what I would suggest:

  1. First, use a timed loop (in place of the case statement) where the loop rate is equal to your desired control loop rate.
  2. Integrate your speed signal during each time period and calculate total distance travelled.
  3. Terminate your loop when distance travelled is equal to the desired.
  4. Substitute the AWG VI (arbitrary waveform) for the ramp and create a wave table (array) that represents one cycle of your trapezoidal speed profile. For example, 0, 0.2, 0.4, 0.6, 0.8, 1, 1, 1, 1, 1, 1, 1......0.8, 0.6, 0.4...0. You want one output waveform over the time it takes to travel the desired distance. I will leave the frequency, amplitude and sample calculations up to you.
  5. Consider a PI controller rather than just proportional. The Integral term will help prevent instability particularly during load changes, e.g., on startup when you first break friction.
Message 4 of 5
(2,329 Views)

Okay, thank you very much for your help, it is much apprecaited.

0 Kudos
Message 5 of 5
(2,303 Views)