Go to Post A team isn't who funds it. A team is the people who are on it -Kelli - KelliV [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-03-2011, 16:08
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Quick question about preset heights

Hello guys,

I was working on some code today to support some preset heights and I was wondering how I would be able to do it. I'm just learning PID and how I can use it. We have a potentiometer installed. I was wondering how I could select which case to run, because it wouldn't necessarily be a true/false type of statement (or would it). It would be if button1 = pressed = go here. Maybe i'm just fried from the series of tests I had today, but I really can't figure it out.

Last edited by Dustin Shadbolt : 11-03-2011 at 22:23.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-03-2011, 16:53
DiscoKittyPrime DiscoKittyPrime is offline
Registered User
AKA: Joshua Bryant
FRC #0057 (Leopards)
Team Role: Programmer
 
Join Date: Dec 2010
Rookie Year: 2003
Location: Houston, Tx
Posts: 26
DiscoKittyPrime will become famous soon enough
Re: Quick question about preset heights

We are doing a similar thing with our arm, including the use of PID loop controls for it.

The way we did it in simplest terms is that we found the range of readings back from the potentiometer and used positions based on that range. For example, if 0 from the potentiometer meant that the arm was at the floor and 180 meant it had rotated to a level for the top row, then our range would be 180. The arm would always be maintaining the current position and the joystick input axis would only increment or decrement the position that the arm would be maintaining. For example, if the arm was currently at a position of 10, just above the floor, and I pulled the joystick to the right to raise the arm, then the goal position would increase and this would change the setpoint of the PID loop causing the arm to change it's position. It would also be necessary for the setpoint to not change when the joystick was neutral in order for buttons to be added in.

With the input from the buttons for going to preset positions, it would be a simple addition into the program where the activation of a certain button changes the setpoint to a different value, say 90 for the trigger being pressed. This would then cause the PID loop to correct the arm to go to the new setpoint.

The reason why it is important for the motor output to be directly controlled by the joystick input is because this would possibly conflict with the PID loop control. If the trigger had been pressed and the setpoint was 90 and the arm was currently at 10 but the joystick was neutral giving an output of 0, then with the joystick feeding directly into the motor and bypassing the PID loop, you would get jerky behavior from the motor unless you had the PID loop shut out. The joystick input can still be fed directly to the motor output if you have a way of toggling between PID loop control of the arm and joystick control of the arm. However, this seemed complicated and not quite user-friendly enough for our team. We ended up making the joystick affect the setpoint of the PID loop control and let the PID loop take over movement of the arm motor. This allowed us to hit a button to change the setpoint and have the arm start moving to that setpoint while the driver still had joystick control to modify the setpoint value on the run.

I hope this helps. Also, if you think that it is just your code that is having problems, post it on here so we can look it over.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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