3/19/2022 11:38 AM  
Joined: 9/8/2021 Last visit: 6/7/2022 Posts: 6 Rating: (0) 
Hello everyone! My name is Bill. I am building LOGO! based automation and monitoring for a 1kW AM transmitter. Logicwise all is clear and working fine, but I want to be able to monitor transmission power. There is a ForwardReflected power measurement system in the TX (transmitter from now on). It outputs from around 2.5VDC at 100W, trough 8.6VDC at 1000W, and I suppose (because as of this moment I don't have a powerful enough dummy load for 4kW, the peak output level of an AM 1kW transmitter), it will output up to 20VDC@4.55kW peak power. I will divide this voltage externally (scalable) to 010V, but the detector characteristic is not linear. I would like to be able at least to get a decent idea, I'm not looking for accuracy on this one. The transmitter receives (all signals 24VDC) a TX EN (enable), returns a contact closure on TX FAIL (for example something happens to the antenna system, and the reflected power rises above 20W  it shuts down and retries in a while). I have also built in 3 relays, that would allow me to set output power levels  when all are off, the TX pumps 100W carrier (default foldback level after fail, to be able to check if all is OK at low powers safely), then sequentially, I have 500W, 750W and 1000W carrier. All these are fine. As I have a dummyload/attenuator for up to 1000W, I have created an excel sheet with the detector output voltage at different levels, it's in the ZIP file, together with my program. I found an example from Siemens, (https://support.industry.siemens.com/cs/attachments/109783503/different_scale_analog_value.zip), added it to try to emulate a lookup table, but this bite is a bit too much for me  after all I am an RF engineer with very little experience in PLC's. Can someone help me to, at least, set the power reading coefficients properly at 12 low power levels, as soon I get the point I will deal with the rest? I need better accuracy up to 1kW, so I suppose using 45 of the available amplification branches there would make sense. I will use the rest up to the required 5kW max level. As soon as I get my hands on a powerful enough dummy load, I will build the detector characteristic up to this power level, but for now  let's focus on 01000W, where the biggest "bend" is and the accuracy suffers most. Thank you in advance! Bill 73 de LZ1SWE AttachmentLOGO PLC.zip (445 Downloads) 
3/19/2022 12:36 PM  
Joined: 6/11/2019 Last visit: 5/13/2024 Posts: 2199 Rating: (98) 
Wow, that's a very special project ! Unfortunately, I can't read any xlsx tables, but with nonlinear characteristics, a factor breakdown into individual linear subcurves comes to mind. In the German part of the forum, the user "Betel" has already written and published quite a bit. Ask him directly if he has anything to say about it. As far as this discipline is concerned, "Betel" is simply brilliant !!! Ella_68 
3/19/2022 2:53 PM  
Joined: 12/18/2014 Last visit: 5/29/2024 Posts: 33120 Rating: (0)

Hello aetherlab, at first welcome to the forum. In attachment a solution. I hope this is what you need. AttachmentPAN TX_V2.zip (423 Downloads) 
3/20/2022 8:10 AM  
Joined: 9/8/2021 Last visit: 6/7/2022 Posts: 6 Rating: (0) 
Thank you so much, both of you! ixo65: Your help is very appreciated! First to answer your question  no, this is not what I need, and I will try to be more clear this time. Also, I thank you again for the ready solution, but I really want to UNDERSTAND . 1) If you look at the table again So for, say 500W, I will get 6.01V input from the sensor, which I will divide externally to app. 3.01V. So I need to descale again in the LOGO, by multiplying somewhere by 2. I cannot do it at B013, because I cause overflow, when I go up to 5V input voltage. Where do I need to multiply by 2 again then? In B033? 2) As I tried to explain, I have to be able to display output power up to 5000W, which I fixed by changing the range on the bar, but... 3) I wanted to get 5 of the available scales (B18, 21,29,31,33) in the 01000W range, where the detector curve is slanted and error is biggest, and get the rest (B35,37,39,41,43) to work from 1000W to 5000W. So, something like this B18: 0200W (0  3.7V) B21: 200400W (3.7  5.36) B29: 400600W (5.36  6.62V) B31: 600800W (6.62  7.759V) B33: 8001000W (7.659  8.58V) I still have no voltage table for 10005000W range, I cannot test the transmitter and measure right now. I will add those later. I would gladly fix those myself and I know how to set the analog threshold triggers, but the math function is not understandable for me, so we get to the next point: 4) Please explain to me what exactly happens in, say B21? We have ((B20*8197)/10000)+ (104). Ok, 8197 gives you the scale, right? Then you divide by 10000, because you used a large number for accuracy? And why the offset of 104? Forgive my inexperience! Please explain. Best regards, Bill LZ1SWE 
3/20/2022 8:40 AM  
Joined: 12/18/2014 Last visit: 5/29/2024 Posts: 33120 Rating: (0)

As B020's block comment states: This means that the amplification of the linear partial curve and the offset must be included in the calculation. Parameter of B021: V4 = The offset of 104. I calculated the values of gain and offset outside because they are constants in the program. Of course, gain and offset are different values in each portion of the curve. 
Last edited by: ixo65 at: 03/20/2022 08:51:33 

3/20/2022 9:09 AM  
Joined: 12/18/2014 Last visit: 5/29/2024 Posts: 33120 Rating: (0)

Set the Gain in B013 from 1.00 to 2.00. That's the as you multiply with 2. 
3/20/2022 11:34 AM  
Joined: 9/8/2021 Last visit: 6/7/2022 Posts: 6 Rating: (0) 
"V4 = The offset of 104. I calculated the values of gain and offset outside because they are constants in the program." Well, gain is fine, but why the offset? How do you calculate it? And where does it come into play in the transformation of the numbers? "Set the Gain in B013 from 1.00 to 2.00. That's the as you multiply with 2." The moment I do this, when my input voltage gets to 5V, the LOGO! stops displaying a number at all  everything falls to zero  both the bar display and the number display on top. When I get below 5V all shows fine. At the input, 5V gets translated to 500. Then in gets to 1000 if I multiply it by 2 in B013. This gets the number OUTSIDE of the range of ALL analog threshold triggers and the output value falls to zero. So this multiplication should be done after the threshold triggers and not in B013. Am I wrong? Or this will go away, when I change finally the values of the triggers to accommodate the higher watts and all will be fine then? Bill 
Last edited by: aetherlab at: 03/20/2022 12:40:49 

3/20/2022 2:06 PM  
Joined: 12/18/2014 Last visit: 5/29/2024 Posts: 33120 Rating: (0)

I can't create a complete program for you if it had to contain values that I don't know. So far you have only provided values that go up to 1000 W. I followed your Excel diagram and took the respective values of 100 W, 200 W, .... 1000 W to calculate a curve made up of partial straight lines. Accordingly, your values end at 1000 W, which correspond to 8.58 V. 4.29 V are amplified in the analog amplifier B013 by the gain from 2.00 to 8.58 V. I don't let the last partial curve calculation end up to 8.58 V, but first up to 9.98 V.
Therefore, values are no longer displayed at boosted 10.00 V (5.00 V) or greater because no data was provided by you. 
3/20/2022 2:20 PM  
Joined: 9/8/2021 Last visit: 6/7/2022 Posts: 6 Rating: (0) 
Oh OK! I see now! Thank you for your patience with me. I wrote down all gains and offsets, and I now see, that the offsets correspond to the mathematical description of the "curve downward bend"! I hope I got this right. Well, I realize, that I can just add another 10 of those switched math functions and join their output with the one from B052, getting good accuracy even up to 5000W. I suppose I will manage to calculate those coefficients, when I get the other values for the input voltage. Thank you VERY MUCH for your great help! All the best! Bill 
This contribution was helpful to1 thankful Users 
3/20/2022 2:25 PM  
Joined: 12/18/2014 Last visit: 5/29/2024 Posts: 33120 Rating: (0)

You know how to use a linear equation to calculate a straight line segment? 
Follow us on