P.I.D
Dileep
Posts: 4
Hiii all,
Iam a beginner in control systems and recently started working in Basic stamps....I need to control ball and beam experiment with BS2 using P.I.D technique...Could any one please help me out with source code in BS2 for PID implementation of controlling DC motor or stepper motor. My objective is to control the beam (coupled with DC motor) angle so that ball should always maintains in centre position on the beam. Waiting in anticipation...
Thanks,
Dilip Kumar
Masters Student,
Mechanical Engineering
University of Kansas.
Iam a beginner in control systems and recently started working in Basic stamps....I need to control ball and beam experiment with BS2 using P.I.D technique...Could any one please help me out with source code in BS2 for PID implementation of controlling DC motor or stepper motor. My objective is to control the beam (coupled with DC motor) angle so that ball should always maintains in centre position on the beam. Waiting in anticipation...
Thanks,
Dilip Kumar
Masters Student,
Mechanical Engineering
University of Kansas.
Comments
Jeff T.
I have read it as it is very informative. Thanks for it. but my query is how to interface stepper motor with this PID control method. what kind of sensors have to be used....like IR sensors?? I request you to please give me any code for runnning stepper motor( along with feedback sesnors) with basic stamp using PID control method.
with Thanks,
Dileep,
Research Assistant
University of Kansas
http:///g.1asphost.com/dilk05
I have had my students do similar, using as a framework code from my "Process Control" text from Parallax.
What works out better than stepper motors or DC motors is using a servo. What we did was a leveling program to try and keep the ball on a slightly curved rail. The memsic accelerometer was used to detect the degree of tilt and the servo was positioned using PID to try to keep it level and the ball on there.
The servo is nice because the pulsout variable is 500 to 1000 and give a nice span for control action over 180 degrees. A stepper you'd be dealing with how many steps and how fast to clock it.
As mentioned, we simply measured the tilt and adjusted based on that. It was interesting to watch the response as we rocked it.
For detecting the actual ball position, it becomes a little more complex. One possible way to to use conductive rails for a metalic ball, so the further the ball is, the higher the resistance. Or you could use an ultasonic sensor (PING) on one end to measure the distance to the ball, though system response will be limited by how fast you can ping.
Hope this helps some?
-Martin Hebel
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
Personal Links with plenty of BASIC Stamp info
StampPlot - Graphical Data Acquisition and Control
AppBee - XBee ZigBee / IEEE 802.15.4 Adapters & Devices