![]() |
Re: Potentiometer PID
Any 100K Pot will work for most arms a single turn will work. Digikey.com and Mouser.com have parts for 100K 10 turn but you loose some resolution using a 10 turn. I haven't found any 2 turn 100K pots.
|
Re: Potentiometer PID
We had some awful results 2 years ago with 100k pots on the robot. Last year we used 5k pots on the robot and had great success. I attibute the difference to noise and a close match to the input impedance of the ADC circuit.
Am I crazy? Don |
Re: Potentiometer PID
instead of
Code:
if ( Button1 == 1 )Code:
if ( (Button1 * Button2) + (Button2 * Button3) + (Button3 * Button1) + ( Button1 + Button2 + Button3 ) == 1 ) //prevents crazy values if more than one button is pressed and keeps the same value if no button is pressed |
Re: Potentiometer PID
Quote:
Bourns makes the "good stuff." Avoid radioshack's potentiometers :). |
Re: Potentiometer PID
Quote:
And it takes a lot more time to do it your way. A few comparisons and branches are faster than many multiplications and additions. Note that the original code never does more than three comparisons and one assignment. Yours always does six multiplications, thirteen additions, and one comparison. It would be instructive to compile both alternatives and compare the generated assembly language code in the listing file. As an aside, wouldn't it work just as well to simplify the condition to this? Code:
if ( ( Button1 + Button2 + Button3 ) == 1 ) |
Re: Potentiometer PID
Quote:
wow. this is what no sleep does to you. thanks for that. maybe I just think weird or something |
Re: Potentiometer PID
how do u get pot sensors to work on easy c?
|
Re: Potentiometer PID
1 Attachment(s)
The Analog Input block,
The Analog Input function block allows the user to define behavior based on signals from any analog sensor. Analog sensors provide a range of feedback with the range depending on the actual sensor being used. This generic input can be used with any Analog device of your choosing. |
Re: Potentiometer PID
Quote:
|
Re: Potentiometer PID
Quote:
i would advise against using a pot for PID control, because the pot will always be returning to the same position, and the brush inside the pot will wear down on the resistive material, which would sacrifice the signal's validity. Im not saying that something like a joystick wouldnt do this, but a joystick is a lot more replaceable than a robot. |
Re: Potentiometer PID
I guess I am comfused and I have been trying to get an idea on all this. I wish to be able to move the joystick to say a value of 200, then I want on the robot a motor to turn an arm until it also reads another pot at the same angle.
Example: Joystick tilted slightly forward, thus arm tilted slightly down. I cant figure out do I use a PID loop or do I just get creative with some other code or use a table? In the past I would just use limit switched but II want better control this year and a more varied location. -Mike |
Re: Potentiometer PID
Quote:
|
Re: Potentiometer PID
Do I have to use Kevin's ADC code added somewhere within my code or could I just copy the code from Dustinb_3?
Any help is greatly appreciated the robot is about done but we've been busy on that and waited til the last minute to work on completing the code. -Mike |
Re: Potentiometer PID
Quote:
Code:
arm_motor = (arm_pot - p1_y) * 50; |
| All times are GMT -5. The time now is 20:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi