LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ball and Beam Conrtol Help

Solved!
Go to solution
Hey everyone, I am doing a project involving the control of the ball and beam system (if you don’t know what I am talking about then google it, websites will explain it much better than me) and I am at the labview stage. I have a plant model and a PID controller designed and working in matlab.  Now I have an actual physical system available that uses a potentiometer as the feedback sensor, where the rails that the ball rolls on are have a voltage across them and the ball position makes a voltage divider. The motor is a servo motor and with what I understand the transfer function that I have is output beam angle/input voltage. My questions are: How do I hook up the potentiometer? Should I put t straight into labview and then subtract the reading from the reference signal using a feedback loop? How to I use the servo motor with labview? Do I have to have an external PWM circuit? If so will this change my transfer function? Sorry if any of this is unclear. Many thanks in advance for any help. Adam

 

0 Kudos
Message 1 of 17
(5,390 Views)

Hi,

 

What kind of hardwares are availabe to you?  You are dealing with a control problem, so you can either go analog or digital.  If you go analog, you can do everything with circuit.  You can build your PID with op-amps and caps. 

 

If you want to go to the digital route, you still need some hardware for acquiring signal from pot and for driving servo motor, and the processing with be done digitally through LabVIEW.  The only digital part is the PID.  You still need to feed the pot output to an analog input through which the labview can receive the value for processing, and a analog output that would drive a driver circuit to drive your servo motor. 

 

Pot signal -> Analog input -> PID (LabVIEW) processing

PID (LabVIEW) output -> Analog output -> driver circuit -> servo motor

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 2 of 17
(5,358 Views)

Thanks for the reply.


I have a DAQPad-6015 available for acquiring the signals. I was planning on going digital as much as I can because I may have to change to a lead/lag controller later on.

 

So I will have to build a physical servo driver circuit that will move the servo based on the analogue output signal that labview will generate? Will I have to find these analogue values first, before I design the circuit or will I be able to somehow calibrate it when the circuit is built? Sorry if these are ridiculous questions, I am new to working with motors and have never used the control side of labview before.

 

Adam 

0 Kudos
Message 3 of 17
(5,349 Views)

Your LabVIEW PID control will generate a digital output through your hardware.  The digital output out be a PWM that has variable duty cycle.  That PWM will be fed into a driver, which is pretty much  a high gain transistor that give you the current needed. 

 

Think of it this way. 

 

digital output -> driver -> motor

 

The driver is like a switch and the digital output is turning that switch on and off as needed to achieve the reference.  Remember to put some transient protection in place, so that nothing blow up in your circuit.  If you go digital, all control and calculations should be done in LabVIEW.

 

yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 4 of 17
(5,342 Views)

Ah ok I think I see now.

 

Will I get the PWM output sinmply from the PID.vi in the PID control section or will I have to use the advnace one?

 

0 Kudos
Message 5 of 17
(5,331 Views)

Try the regular one.

 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 6 of 17
(5,321 Views)
I can only get a double output from the PID block. Should it not be some kind of digital waveform output?
0 Kudos
Message 7 of 17
(5,305 Views)
Solution
Accepted by topic author adamkse

There is a very good example in LabVIEW that you an look at.  To answer you question, you are going going to get a analog signal from the PID block.  You need to generate your own digital waveform.  For example, let say that the analog signal that you get from the PID block has value from 0-10.  When the value is 0, you generate a pulse with 0% duty cycle.  When the value is 10, you generate a pulse with 100% duty cycle.  5 -> 50%, 7 -> 70%.

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 8 of 17
(5,295 Views)

Can you please tell me the name of this example? I tried searching duty cycle in the examples but I really dont know what I am looking for.

Sorry if this should be obvious. 

0 Kudos
Message 9 of 17
(5,285 Views)

PWM-Counter Output.vi would be perfect for you.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 10 of 17
(5,282 Views)