Mick Posted February 6, 2018 Report Share Posted February 6, 2018 Hello, I use the PID with autonune of the Samba PLC. It doesn't work well and i don't understand why. That is my hardware set up for PID : => analog input is 4-20mA (voltage measure 4-20mA : from a 0-100V / 4-20mA converter), => analog output is 4-20mA. ( control voltage 4-20mA : to a 4-20mA / 0-5V converter) At first the PID status stayed at -11. I've read on the help file that it's could be the noise at the input, so i follow the advice by increase the high limit and decrease the low limit on the PV input. After tying a lot of different setting the autotune then PID finally works. Now, i try an auto-tune and it doesn't work anymore, two situation : - I set a wide range in the PV input : the control value go on the max value or the min value, the PID status stay at 2 - I set a smaller range in the PV input : The PID status stay at -11. For information i use on the Samba the 4 analog input, and the 2 analog output. Could the problem come from the speed between the input and the output? I need help. I try for several day to fix the problem, but i still no understand and I'need PID function on my project. My program file is to big for attach. Mick Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 7, 2018 MVP 2023 Report Share Posted February 7, 2018 On 2/6/2018 at 10:37 AM, Mick said: - I set a wide range in the PV input : the control value go on the max value or the min value, the PID status stay at 2 - I set a smaller range in the PV input : The PID status stay at -11. Wide range? Smaller range? We really have no idea what you've tried. If you can't attach project, at least list all the values in your PID config block . You may have to tune the loop yourself manually. Have you tried putting some initial values into the PID block and running it without running the AutoTune? Joe T. Link to comment Share on other sites More sharing options...
Mick Posted February 9, 2018 Author Report Share Posted February 9, 2018 OK, i did not know the PID could work without auto-tune. I'm a beginner in programming... I will try manually. On the attach : - The first : i recorded the image when it worked a few day ago. Now the PID status stay at -11 - The second : The PID status stay at -2 (Control value go and stay to high or low limit) Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 9, 2018 MVP 2023 Report Share Posted February 9, 2018 Now we need to know more about the rest of your program to determine what the Input and Output range should be. Are you sure it's too big to attach? As I've said many times, it is very hard to troubleshoot programming questions without seeing the code, and as a beginner you may not understand the questions I'm asking. Please answer ALL of these: 1. What is the model number of the Samba? 2. Which physical input is this PID loop connected to? 3. Which physical output is this loop connected to? 4. You said the input is 0-100V. Is this being scaled somewhere else? 5. You have the output range limited to 1700-2400. Is there a good reason why? This is way too tight. 6. Is the analog output being scaled somewhere else? Joe T. Link to comment Share on other sites More sharing options...
Mick Posted February 16, 2018 Author Report Share Posted February 16, 2018 Sorry for the response time, I was working on another project. Yes my file is to big (0.56MB), : "Drag files here to attach, or choose files... Max total size 0.01MB " I understand that it would be easier with the code. I would have preferred also to send it to you . For explain the context, i use a PID loop to regulate the voltage of a battery charger according to the battery voltage. There are different components between the charger and the battery (cable, diode etc ..), so a voltage difference according the current, temperature etc.. . Using a PID loop would ensure a accurate voltage setpoint on the battery terminal whatever the conditions. For the answer : 1. What is the model number of the Samba? => SM35-J-RA22 2. Which physical input is this PID loop connected to? => The physical input is a battery voltage. The nominal voltage could be 24V or 48V ( Wherever possible I would like to make a single program for both configuration 24V and 48V) => for the 24V : the min voltage is about 20V (at the end of the battery autonomy) the max voltage is about 30V (During a boost charge) => For the 48V : the min voltage is about 40V (at the end of the battery autonomy) the max voltage is about 60V (During a boost charge) => So i use a 0-100V / 4-20mA signal converter for the input measure. The linearization is : X1=3273 / Y1=0/ X2=16380/ Y2 = 10000/ X=MI1 / Y=MI247 3. Which physical output is this loop connected to? => The physical output is a 0-5V signal for controlling output voltage of a 24VDC or 48VDC power converter ( Use for power supply and battery charger). The response of the power converter is for 24VDC power converter 1V = 9.6VDC / 5V=30V, and for the 48VDC power converter 1V=19.2V /5V = 60V => I also use a signal converter for the output because i need a isolated signal. it's a 4-20mA / 0-10V converter 4. You said the input is 0-100V. Is this being scaled somewhere else? => Response at §2 5. You have the output range limited to 1700-2400. Is there a good reason why? This is way too tight. => F or the operation i would prefer stay between 20V to 30V for the 24V system and between 40V to 60V for the 48V system => So i use a 4-20mA / 0-10V signal converter then the output range is about 1700-2400 , corresponding about (if i don't make a mistake) at 20V-30V (24V converter) or 40V-60V (48V converter. 6. Is the analog output being scaled somewhere else? => Response at §3 Michaël Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 18, 2018 MVP 2023 Report Share Posted February 18, 2018 I asked the Creators about changing the upload limit. Thank you for the details. I will address the 24V converter. Change MI 207 to 3000. You need to add another Linearization block between the PID output and the real output. On the -RA22, the outputs are 12 bit (0-4095 or 819-4095 for 4/20 mA). So you want to fully scale the Linear block: X1=960, X2=3000, Y1=819, Y2=4095. X = MI 10 Y= assign a new value in the hardware config to the output. Now you're feeding the Linearization block with your real voltage desired and it drives the output. Joe T. Link to comment Share on other sites More sharing options...
Mick Posted April 19, 2018 Author Report Share Posted April 19, 2018 Thanks Joe for the advice, The PID work well now. I think the problem was that I was not using the full range on the PID input, and moreover there was noise on the measurement due to the proximity of the power converter. I use the full range with a little numeric filter on the 4-20mA converter. It works well with good accuracy. Mick Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now