Sign in to follow this  
Followers 0
Myles Sheehy

Making a sine wave output in rslogix 5000

36 posts in this topic

Hey, ok, so I didn't phrase my problem correctly about running a three phase motor off of a plc the last time. All i need to do is to get an output on the plc of a sine wave and then phase shift (120 deg) the other two. This will demonstrate getting an analog output from the plc. The aim of the project is to become familar with programing an analog output on the allen bradley plc. Im using a 6 channel analog output ( 10v) and the Rslogix5000. Any help with the program would be great. im not asking anyone to do my homework, just some suggestions on the program. Thank alot! myles Edited by Myles Sheehy

Share this post


Link to post
Share on other sites
Is this a project you came up with or was it assigned by your instructor. If I am understanding your correctly it is not a common practice. Let me make sure I understand. You want to take 3 analog outputs and simulate a SINE wave with them then phase shift them like three phase power would be?

Share this post


Link to post
Share on other sites
Have to agree with TW, industrial motors are usually started/stopped with a contactor, a drive of some sort, or a soft start. The control system connects to these devices, and the device actually does the work. If this is an assignment from class, I question the value of it.

Share this post


Link to post
Share on other sites
Count me in also, never heard of direct 3 phase control of a motor. The only common way I can see to do this is to use the analogue output to pull in a 5V relay, then use the relay to pull a contactor in.

Share this post


Link to post
Share on other sites
Guys, I think that there is something very fundamental that our student is simply not getting. Lets see if we can clear this up before he flunks his course, or worse, passes, graduates, and gets a job where he accidentally kills someone. At the very least his current course of action has a very high risk of ruining the PLC and other lab hardware. Myles, I have some questions for you: 1) What is the KW and voltage of this motor? 2) Usually when controlling a 3 phase motor with an analog output you use a single analog output to a motor drive which changes the frequency of all three phases for you. Double check your assignemnt. Does such a drive already exist on the motor or in the lab? 3) Your knowledge of PLCs seems pretty limited at this point (and thats OK, it takes time to learn). Is this an introductory PLC class? If so then I'll wager that your actual assignment is to control an external device connected to the motor, such as a contactor, using a single discrete output. Help us out, clarify the problem, and I think we can help you out. Edited by Alaric

Share this post


Link to post
Share on other sites
The idea is to set up the program to give 3 analog outputs to simulate a sine wave then to phase shift them just like a three phase power would be. i am using a very small rotor and the idea is to see if the rotor experiences a force which would be the motor running off the PLC. i dont want to drive the motor, just to get the three phases working on time to simulate a three phases of the motor being driven off the plc. The motor is reasonably small and is mounted on a table. I am also using three op-amps because i dont want to damage the plc which has a very small current output (21ma) the software which im trying to program is Rslogix 5000. any suggestions on the program would help. thanks alot, myles

Share this post


Link to post
Share on other sites
Ok it won't be the most efficient thing but why not. Need a few more details first. What is your analog module? Which processor? Does the program have to do anything else?

Share this post


Link to post
Share on other sites
The motor is about .75 KW and runs off a 240v power supply. i only want the plc to give it +/- 10v at most. my aim is not to drive the motor, just to simulate a plc running the three phases of the motor in the program. i have a small rotor going through the motor and all i want to do is to see, when the program is running that the rotor is experiencing a force (the three phases) the idea is to set up the program to give 3 analog outputs to simulate a sine wave then to phase shift them just like a three phase power would be. The motor is reasonably small and is mounted on a table. I am also using three op-amps because i dont want to damage the plc which has a very small current output (21ma) the software which im trying to program is Rslogix 5000. my knowledge of PLC's is very limited. i have only ever programmed omron and siemens. any suggestions would help, thanks alot, myles

Share this post


Link to post
Share on other sites
For a real world application this will never work but... First we must write code to simulate the SINE wave. Does it have to be a variable peak? Does the Hz have to be variable? If not I am going to guess 50 Hz in Ireland Then we must apply the phase offset. It will be 1/3-1/3-1/3?

Share this post


Link to post
Share on other sites
its only to simulate a plc driving the motor. the peak has to be +/-10 v. the frequency in ireland is 50hz.

Share this post


Link to post
Share on other sites
I think this comes again and againg - instructors in schools have no real application experience and base their lessons on some virtual applications like traffic light, washing machine etc... Surprising creativity here ... but this have no practical meaning. But from hardware stanpoint this is a not possible with PLCs: Here is why: - let say that we need single phase 50 HZ square wave - it means we need to update signal 100 times per second or every 10msec - if we need 3 phases, then we need to update output 3 times faster or 3.33ms Next we need to convert squarewave to sine wave - let say we will do 20 steps in each period (really need much more) - so 3.3 ms / 20 = 165 microseconds This is too fast for any PLC and anlog Output...

Share this post


Link to post
Share on other sites
why would we need a single phase of 50hz? could the plc not be programmed to give out the sine wave(s)? the program is only to simulate the motor running. the motor wont actually run. the only thing it will do is that the rotor will expierence a force (the three phases ) being run off the plc. i am using three seperate circuits (op-amps) to runs the phases as i dont want to damage the plc. these will be connected to the outputs on the plc (analog output)

Share this post


Link to post
Share on other sites
I gave 50Hz single phase as step in my calculations If we ignore the fact that this app is unusable and too fast for PLC and leave a question how generate sine wave, then is is very simple: Use Excell and create array of 20 elements, 3 values in each - one per each phase - change every 18 degrees Paste these values into 2 dimentional array - Output[20,3] - increment pointer - take 3 values from array and move them to 3 analog outputs, repeat... Edited by Contr_Conn

Share this post


Link to post
Share on other sites
And don't forget to tell your instructor that table is your idea.. The problem is that you will not see smooth lines like excell does... You will see steps... You will need more than 20 steps... Analog modules are not fast, so they may smooth it a little. Now back to real hardware... Real world... This sine wave will be about 1-2 Hz, not faster... Motor will not spin at this speed...

Share this post


Link to post
Share on other sites
Seems like it could at least be ATTEMPTED.. Although I whole-heartedly agree that this experiment has no value outside the classroom. He'll need a stable line-frequency timebase to synchronize to. Suppose he coupled the AC line to an analog input through a transformer (stepping it down to 10V p-p or less)? His three outputs would then just be a mathematical function of the input. One of them could mirror the input signal, the other two would be phase-shifted as necessary. Hopefully the instructor would let him do it this way, I suppose you could find some other way to produce the sine wave but it would be a LOT more difficult! Now, I can't see why the instructor would want the students amplifying the output signals and messing with line voltages to actually drive a motor. If nothing else, there's going to be a lot of expensive hardware destroyed. I think it would make a lot more sense to hook the outputs to a scope and show the waveform traces. If you've got three sine waves suitably phase-shifted, who cares about the voltage?

Share this post


Link to post
Share on other sites
Unfortunately schools are disconnected from reality. about 5 years ago my former company got order from a major technical school (US). They got some kind of resarch grant and decided to spend money for some miracle metal cutting idea that had no ground at all. Machine was built, but could not cut even aluminum or plastic... But school was so happy that they have half million $ toy they can play with, modify and do research with no practical meaning or results.... What students can learn? Myles, Honestly, did you learn anything from this topic? At least for sure I can say you did not get a real world experience... Edited by Contr_Conn

Share this post


Link to post
Share on other sites
Now Contr_Conn, correct me if I am wrong, but an earlier PCB experiment may show another method. If in addition to the 3 analog outputs that went to the motor you had 3 analog inputs, each off of the legs of the 3phase power, then wouldn't it be a simple scaling of the legs input to vary the output? This would only work if the Input Hz equaled the Output Hz. The resolution that could be attained would depend on which analog module he is using and since he would not specify what analog module he is planning on using we can't theorize on that. The response time of an 1756-IF4FXOF2F will be much faster than a 1756-OF4 in theory. That would still be scan time dependent. As I begin writing this I realize Gravitar has already hit on this point so I will just post what I have and see where it goes. Real world I don't think it will work but I am curious how close we could get. Don't ask me why, guess I'm just bored this evening Actually does it have to be a PLC? I bet some of the guys here could make a PCB to do this in their sleep

Share this post


Link to post
Share on other sites
I see no practical use for exercise unless it is to find out how not to control a 3 phase motor. This should be done using a DSP, not a PLC. Next you need to find a app note that gives the basics. Since control motors is a common DSP function, you can find lots of app notes at the DSP manufacturers web sites. http://focus.ti.com/lit/an/spra550/spra550.pdf

Share this post


Link to post
Share on other sites
Hey, ok, so I didn't phrase my problem correctly about running a three phase motor off of a plc the last time. All i need to do is to get an output on the plc of a sine wave and then phase shift (120 deg) the other two. This will demonstrate getting an analog output from the plc. The aim of the project is to become familar with programing an analog output on the allen bradley plc. Im using a 6 channel analog output ( 10v) and the Rslogix5000. Any help with the program would be great. im not asking anyone to do my homework, just some suggestions on the program. Thank alot! myles Edited by Myles Sheehy

Share this post


Link to post
Share on other sites
What is wrong with previous answers you got? Did you try it? Don't expect someone to make your homework. We gave you ideas, you have to make a next step and show what you did. Edited by Contr_Conn

Share this post


Link to post
Share on other sites
In the post 13 and 14 above I gave you steps to compete the task. So what did you do so far? Another hint: whole program will be in 2 rungs: - Increment pointer (with limits check) - Move values from array to analog outputs using indirect addressing Instead of table you can calculate values using PLC math, but it will be task for extra credit Edited by Contr_Conn

Share this post


Link to post
Share on other sites
Ok, so far i've been reading about the FFL and FFU. from what i've read they seem to be the ones i need to use as they will copy the values from the array to the FIFO and then unload them. ive also been looking at the COP and FSC functions. one problem... i cant find where to add values to the array?

Share this post


Link to post
Share on other sites
The values are added to the array with tag monitor and enterd by hand by you. But let's revisit Contr_Conn's suggestion and be sure you understand it. 1. Create a Two Dimensional Array called output of size [20,3]. 2. Use a free running timer called Update_Interval and each time it is done move a new value to the output. 3. Create an Index_Pointer which runs from zero to 19 with limits check. Increment it each Update Interval. 4. The move instructions would be like MOV Output[indexPointer,0] Output_1 ; MOV Output[indexPointer,1] Output_2 ;MOV Output[indexPointer,2] Output_3 ; The FFL, FFU and FSC are unnecessary at this point in the process. Now try implementing this in a trial program and post what you can.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0