Jump to content

Recommended Posts

Posted
Hi, i am An Electrical Engineering Apprentice for a Food Manufacturer with minimal PLC experince and i have be given a project to create a new system for contorlling the temperature of a Cream Fat Tank. I have been given a CP1L PLC, a NQ3 HMI, a TS102 Temp Module. The fat tank already has 2x Pt100s installed and 2 Analogue Motorized Valves. I have made a screen and attempted to exchange information between the HMI and PLC with no luck. For example i have attempted to move the Temp Probes values at Channel 2 to D1 on the PLC. I wanted to display this value on the HMI so i made a Register Value Display Data and assigned it as DM00001 as to my understanding these are both Data Memory Registers. However the information is not shared. I know they appear to different as the "prefixes" are not the same, that is to sat D and DM. Could anybody please help me in this matter as i am seriously struggling with this project. Thank you in advance. Prog.bmp Screen.bmp

Posted
Hello Which model CP1L are you using? Are there any other expansion units? Is there any data in the address '2'? (the temperature) Do you have communication between the NQ3 and the CP1L? If you post your projects, we can have a look... Pp
Posted (edited)
At the moment in term of CP1l model im unsure. I have a analogue unit on order which my mentor has sorted out for me but to what it is i dont know at the moment. In terms of comms between the HMI and PLC the answer would be yes. I have pictures of my test rig at present. I havent actually began to write the program yet because i wanted to try and understand the data exchange between the PLC and HMI first. Possible a bad move? And in 2 (as in Channel 2) i do have data and it does vary when the pt100 is heated and cooled. What would you like to be posted when you mean project? The NQ3 programme and the CX programme? I hope these images help for now. Edited by JHattonLacey
Posted
Hi JHL Yes - post the CX-P and NQ-D projects. We can establish comms between these first. We can move onto temperature control later... It's a CP1LM40 you have there. I wanted to know to confirm that channel 2 is correct (it is) Cheers, Pp
Posted
Right, update. I checked my comms and they were wrong. I made up a new lead and comms is up and running :) I had a play and ive been able to get the PLC and HMI to display the value from the Pt100. After a few more hours i managed to get a value from the HMI to the PLC. From what i can tell my main error selecting the wrong Data Type/Format. I have been told to add a screen that display how much fat is in the tank. The screen has been made but no method of detecting the amount of fat in the tank is avaliable yet. Im not sure what i should be doing now. I guess im going to try and write the program but i havent got a clue what do to do. Any ideas? Thanks for your help again guys :) MrPLC.zip
Posted
Hello again, JHL First, well done for establishing comms! I've had a quick look at your plc program. 1. There's no need to do a CMP followed by interrogation of the comparison flags. You should now be using the in-line comparison instructions. 2. IIRC, the temperature 'arrives' from the TS card as a decimal number, therefore you shouldn't compare it to a hex number (#300). I'm guessing you need 30 deg C, which would be &300 (check in CP1L manual...) 3. You're writing to inputs (addresses 0.01 and 0.02). This can't be done. With the CP1L, output addresses start at 100.0, if indeed that's what you want to do. 4. No comments/symbols at all! Regards, Pp
Posted (edited)
1. Thank you PP. It sounds daft but im really proud of myself :) The task ive been given specically to make a system to control tempurature. It needs to be done by setting a the Target Temp on the PLC and then the actual temp match it. One of the main difficultes is that the valves that control the are analog motorized valves ranging from 1 - 10V. Ive included the changes ive made so far if youd like to take a look. I have now hit a dead end and unsure of what action to take now. Ive been looking into scaling but im struggling with the concept and the application. 2. the temperature needs to be able to be adjusted but i believe it needs to be around 35 degrees C. 3. I noticed that my outputs wer never going to work. I looked at the front and noticed that it said Channel 100 nd 101. I changed it and problem solved. 4. Ive added a few comments and symbols. Helps everyone out. What do you guys reckon? MrPLC2.zip Edited by JHattonLacey
Posted (edited)
Believe you me, I still get a buzz when things 'work'! When I don't, I'll give this up... Now, I don't want to sound patronising, but we don't want run before we can walk. Temperature control by way of a 0-10V motorised valve is (probably) going to need a PID loop. This is fairly advanced stuff; not that it isn't all documented (very well, as it goes) in the manual, but it takes a good understanding of both PIDs and PLCs. If indeed you're controlling via a PID, then you need to have two pieces of data - a setpoint, and a process variable. These are entered into the PID and an analog output is generated (for your motorised valve via the analog output card). You already have the temperature coming in -the process variable- (is it tenths of a degree resolution?) ie is 35 degC shown as 350? Make your setpoint of the same 'range' too. Forget BCD (the # prefix), make it all decimal...(& prefix) If you read the PID instruction help (available with CX-P), one of the parameters is the input and output ranges (10 bit, 11 bit etc). I prefer to scale the SP and PV to full scale of one of these ranges to give the PID maximum range to 'go at'. Scaling FBs exist if you need help with this. The PID will produce the output; again this needs to be scaled from the 13 bit (say) output from the PID to the limit of your analog output card (0-6000 IIRC?) Read the PID instruction help. This will undoubtedly prompt further questions, and come back with them. I'm using the CP1L's PIDs on a job myself at the minute, and once you've got all the right numbers in there, it just works. The key is getting the right numbers... Good luck, Pp Edited by ParaffinPower
Posted (edited)
I was hoping to crawl first.... *gulp*. Its no way patronising. Right, erm... the use of a PID was never mentioned to me to be honest. I had always been curious about how the analogue valve would be controlled. But i always presumed that this would be done via scaling (which i know minimal about also). Ive been playing with scaling and i cant seem to get it to work. If i understand you correctly the process variable is the input from the Temp Card or in my case CH2. If thats so then in answer to your questions then yes it is in tenths to the resolution. Just to clarify i mean that a value of 350 is 35.0 degrees C. Edited by JHattonLacey
Posted
Hello Jhl I suggest you read the PID Instruction help (in CX-P). It explains how the PID works, and has some good generic info on PIDs in general. 1. Re-scale your temperature from tenths of a degree into one of the preferred PID input ranges. Use the next range up from the max value of the temperature. Use the APR instruction, or my FB (attached) 2. You need to write some code, run on the first scan, to populate your PID parameter area. I'd create an array to make this easier. This dictates that you need to work through each PID parameter in the help. 3. Scale the PID output to the analog output card's max scale (0-6000 maybe) 4. The analog ouput card will need its range setting. Details of how to do this are in the CP1L operation manual. I'd guess that it's been posted to this forum's download section before... Write something, and we can critique. Best, Pp ScaleINTinINTout.zip
Posted
One note of caution from the manual: "PID(190) is executed as if the execution condition was a STOP-RUN signal. PID calculations are executed when the execution condition remains ON for the next cycle after C+9 to C+38 are initialized. Therefore, when using the Always ON Flag (ON) as an execution condition for PID(190), provide a separate process where C+9 to C+38 are initialized when operation is started." In summary, make sure to zero out the "scratch pad" area of the PID function in words C+9 to C+38 (Use BSET instruction) on the first PLC scan as well. Then if the PID function operates all the time, use a NC First Scan contact to turn on the PID. The PID function will operate erratically if you do not initialize this area.
Posted
Hey everyone, sorry ive havent been on in a while to give an update. To be honest my advancement has been minimal. I just cant seem to grasp the PID function. I have finally got a CP1W DA041 which to my understaning is need to control the motorized value i plan to control. However for now ive connected my multi meter to it so i can what output im getting... which is always zero. My first issue im guessing is set up. Its embarrasing to say but i dont understand the C+1 aspects of the instruction. Ive made several versions of my program and reorganised it abit. Would somebody mind having a look? Thanks again. CreamFat v5.00.cxp
Posted
Hello all, Me neither, Michael, although I think we have other issues. 1. What are you trying to do with the scale FB? The intention was to scale actual temperature and demand temperature to PID-friendly numbers. (10 bit, 11 bit...). My personal preference. 2. Too much BCD and binary. Choose one, and stick with it. Tip: choose binary. Although #1 and &1 are the same bit pattern, #10 and &10 aren't. Using # in a binary maths instruction will not give desired results. It would appear that the temperature written from the NQ is declared BCD. Change it to INTeger, and do away with the BIN instruction. 3. As mentioned previously, don't use P_GT flags and the like; inline comparisons are better. 4. Not sure I understand adding/subtracting 1 from temperatures. Can you elaborate? 5. What ranges are you trying to achieve on the DA041 and we can confim your range setting words. I'll hold my hands up here - this bit is outdated and, frankly, a ball-ache. Best, Pp

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
×
×
  • Create New...