LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ssr control without the use of pwm

i want to control the heater and a DC motor using the SSR. on checking for the solution i find that PWM with varing duty cycle is the best option but i don't know nothing about PWM and also how to program it on LabVIEW. i have a NI 9403 and NI 9478 DAQcard and other AI/AO cards. i am thinking of controlling the SSR using one of these cards. i am trying to use a simulated signal block (LabVIEW 2010) square wave, try to vary its duty using a PID. now the question is how to send this simulated signal to the SSR using the Available DAQ cards with me. i want to skip usage of PWM because i dont have the time. i want to start the experiments as fast as possible.

0 Kudos
Message 1 of 11
(4,533 Views)

mi007 wrote:

 

...

 i want to start the experiments as fast as possible.


 

Then you should consider National Instruments Professional Services.

Christian

0 Kudos
Message 2 of 11
(4,525 Views)

I think you have misunderstood Pulse Width Modulation.  PWM is just another way of saying a square wave with varying duty cycle - so by generating a square wave you are in fact using PWM, not avoiding it.

 

If you want to get your experiment running as quickly as possible, buy a card that has an internal timer and can generate the PWM signal itself.  Then you just write the frequency and duty cycle to the board, and you will get a reliable square wave output that can run at a higher frequency than you can generate in software.

0 Kudos
Message 3 of 11
(4,514 Views)

buying a card will take another year. i had tried to create the "look-alike" pwm by using a simulated signal and passing it to the DAQ output and controlling the duty cycle of the simulated signal using PID but the control it provide is not precise and as desired but it is working but now thw main problem is how to control the DC motor? because i think this shortcut method will not work there. what should i do now.

0 Kudos
Message 4 of 11
(4,496 Views)

Can you share your code?  Without that it's hard to know what you're doing and whether it's likely to work.  At what frequency do you need to run the PWM?  What do you mean by "shortcut method"?

 

Also, please try to use proper sentences.  It will make it easier to understand your questions.

 

If you need a consistent PWM and only have analog outputs available, there are devices that can convert an analog signal to PWM such as the Omega PCM4 (converts 4-20mA signal to PWM at AC line frequency).

0 Kudos
Message 5 of 11
(4,470 Views)

this is the vi that i am using to control the heater for temperature control. the DAQ assistant is measuring the temperature using NI 9211 and this temperature is matched with the set point and adjust the duty cycle of the simulated signal, (square wave just like PWM),

 

i am not actually using a PWM just creating something like PWM, the frequency that i have set is just a hit and trail (i dont know how much to set).

 

the DAQ assistant2 controls the SSR which in turn ON/OFF the heater according to duty cycle.it's working fine. the same concept i am trying to use in the case of controlling the RPM of a DC motor.

 

the rpm from the motor controller, that i have, will be fixed to 100 rpm. i will set the setpoint to 60 RPM in the PID, the PID will vary the duty cycle of the simulated signal and will controll the RPM but the question now arise is:

 

1) from the experience obtained from heater control that i had done, there will be no current flowing to the DC motor because the SSR get fully closed (duty cycle 0) as soon as the process variable goes above the setpoint (60 RPM) and again opens to full (duty cycle 100) as it falls below the set point. i want it to at 50% duty cycle at at set point(60 RPM)  and as the RPM decreases it should increase the Duty cycle to adjust the RPM back to 60.

 

2) now how to acheive this.

 

i am simultaneously measuring the current and voltage that is going to the DC motor. if the duty cycle goes to zero ( SSR gets closed), i will not be able to measure the current and voltage going to the DC motor. that's why i want the duty cycle to be at 50%.

 

 

0 Kudos
Message 6 of 11
(4,452 Views)

It's easy to set the output to 50% when the PID is at 0: set the PID output limits to -50 to +50, then add a constant 50.  If you never want to hit 0% duty cycle, set the lower limit to -48 instead.

 

The timing in your VI is a bit odd.  You read 3 samples every 1 second, discard the first two, use the last as input into the PID, then generate a waveform of 300 points and write that out.  I'm not sure what happens in the gap in time between when those 300 samples finish and when you send the next waveform; I guess that it holds the last value.  This is unlikely to produce consistent timing.

0 Kudos
Message 7 of 11
(4,438 Views)

hello again, i am controlling the DC motor RPM that drives a pulley through a  belt drive. iam using a PID to control, a simulated signal to act as a PWM whose duty cycle is controlled by output of PID. i am giving the setpoint (500 rpm) and changing the process variable to check the response of the DC motor but  many problems have come up.

1) the SSR remain continously ON even i stop the execution of VI.

2) if the process variable(in this case is RPM) is below the set point the motor starts..ok fine..but if i change the process variable above the set point it totally stops the motor and after this if i lower the process variable the motor does'nt start, i have to manually rotate the pulley then only it starts to rotate (as if the motor wants to starts but something is stoping it from rotating)

3) if the set point is reached the duty cycle goes to zero and if it is below the setpoint( even at 499) it is 100. i want that it should not totaly stop the motor there should be some control action that should happen to maintain a constant RPM

 

what can i do to solve this problems i am attaching my codes

0 Kudos
Message 8 of 11
(4,420 Views)

I do not have the PID VIs so I cannot see what is in your program.

 

1) When you stop the loop, the last value written to the output will remain until your turn off the power.  If you want to be sure the SSR is off, you need to turn it off. Write a zero to the output either on the last iteration of the loop or outside the loop after it stops.

2) This may be due to the tuning of the PID or the characteristics of the motor.  Some motors will not turn on if the applied voltage is low, even though they might continue running at that voltage if they were already running.  You may need to set the duty cycle to 100% until the RPM > 0 and then bring it down to the PID value.

3) This sounds like the PID settings are not what they should be. You want a nice proportional band around the setpoint.

 

Lynn

0 Kudos
Message 9 of 11
(4,409 Views)

Do you understand how PID works?  If not, you may want to spend some time reading about it.  Possibly the reason your motor does not restart is that when you set the process variable above the setpoint, you build up a large negative error.  When you drop the process variable, you then need to wait for the algorithm to integrate out that negative error with an equivalent positive error before you'll start to see a positive response from the PID algorithm.

 

There's no sense in having the lower output limit set to -100 because there's no such thing as a negative duty cycle.  The lower limit should be 0, or possibly just above that if you never want the output to go to 0.

 

You need to tune your PID gains.  Start with the I and D set to 0 and experiment just with the P gain.  Read the PID manual that's provided with LabVIEW.  I, and others, have posted many suggestions on PID tuning on this forum; search and you'll find them.

 

Consider implementing some kind of consistent timing in your VI instead of letting the loop run as fast as possible.

0 Kudos
Message 10 of 11
(4,403 Views)