Analog Graph - Scalling question

Avatar
  • updated

Hello,


I have a silly question:

In analog graphs, it is possible to scale data.
Since I have never needed to do this, I haven't looked into the details until now, but while trying to improve my setup, I discovered that it could be useful. However, I don't understand and (despite my research) haven't been able to figure out what the two options “K” and “N” mean and how to use them...

Image 5440


Anyone to bring me some light ?


Thanks,

Avatar
Arno Padar

IMHO It would be important to note here that these K and N factors are used before recording data, and the graph is only related in the sense that it displays the same recorded data. However, would it be possible to include the same K and N factors when plotting the graph, which would, for example, modify the raw data during the graph drawing?

Alternatively, if recalculating the data during graph plotting would create an unnecessary load on the system and also require solving the issue of storing newly calculated data, perhaps it could be possible to add the ability to perform recalculations on already recorded data via the configurator. For instance, a certain 0/1 value might have been logged for some time and stored as such, but later there arises a need to display it on the graph as 0/10. Currently, this can only be done using third-party software, where the data must first be exported from the bOS, then modified in another program, and finally imported back into bOS.

Avatar
Fabien Fuster
Quote from Jürgen Jürgenson

I haven't needed it either yet. And the manual is somewhat unclear what these K and N values actually do or how to calculate them. Here is a little explanation.

In the equation Y = KX + N, K is the slope or rate of change (how much Y changes for each unit increase in X), and N is the Y-intercept or the vertical shift (the value of Y when X is zero). Together, K and N determine the specific linear relationship between the variables X and Y, with K dictating the steepness of the line and N controlling its vertical position on a graph. Understanding K (Slope/Rate of Change)

  • Definition: K is the constant of variation or the slope.
  • Meaning: It tells you how much the dependent variable (Y) changes in response to a one-unit change in the independent variable (X).
  • On a Graph: K represents the slope of the line. A positive K indicates the line rises from left to right, while a negative K means it falls.
  • Calculating K: If you know a point (X, Y) on the line (and N=0), you can calculate K by dividing Y by X (Y/X = K).

Understanding N (Y-intercept/Vertical Shift)

  • Definition: N is the y-intercept.
  • Meaning: It's the value of Y when X equals zero, meaning it's the point where the line crosses the y-axis.
  • On a Graph: N determines the starting point or the vertical positioning of the line.
  • Direct vs. Linear Proportion: In a strictly proportional relationship (Y=KX), the line must pass through the origin (0,0), meaning N would be 0. The presence of N in Y=KX+N makes the relationship a linear one, not a directly proportional one.

Example

Temperature probe: Analog Log-scale.bos
Raw: 0 – 1023 counts ↔ scale to: 0 – 100 °C

K = (100 – 0) / (1023 – 0) = 0.0977 (°C per raw count)
N = 0 – 0.0977 × 0 = 0
So if your sensor is sending out values temperature values as0-1023 then the analog log will scale its value to 0-100 range.

If instead the sensor is 0.1 V → 0 °C, 0.4 V → 100 °C, and the PLC turns 0.1 V into 512 counts, 0.4 V into 2048 counts:
K = (100 – 0) / (2048 – 512) = 0.0769
N = 0 – 0.0769 × 512 = –39.4 (≈ –39)

Thanks a lot Jürgen, very useful !

Not obvious at all I must say... It would have been really helpful to find something in the doc. At least there is something really understandable here now.

Avatar
Norajohnson

I have a silly question: In analog graphs, it is possible to scale data.Since I have never needed to do this, I haven't looked into To answer a scaling question for an analog  monkey type  graph, you need to identify the minimum and maximum values of the data you want to plot and choose a suitable scale for each axis that fits the graph paper's dimensions, ensures clear visibility, and clearly labels the units. The chosen scale should make the most relevant parts of the data visible and allow for easy comparison by using consistent increments My values seem to be a little off. My Fluke meters are usually showing around 35A on L2 and L3 while my controller is showing 39A.

Avatar
Jürgen Jürgenson

I haven't needed it either yet. And the manual is somewhat unclear what these K and N values actually do or how to calculate them. Here is a little explanation.

In the equation Y = KX + N, K is the slope or rate of change (how much Y changes for each unit increase in X), and N is the Y-intercept or the vertical shift (the value of Y when X is zero). Together, K and N determine the specific linear relationship between the variables X and Y, with K dictating the steepness of the line and N controlling its vertical position on a graph. Understanding K (Slope/Rate of Change)

  • Definition: K is the constant of variation or the slope.
  • Meaning: It tells you how much the dependent variable (Y) changes in response to a one-unit change in the independent variable (X).
  • On a Graph: K represents the slope of the line. A positive K indicates the line rises from left to right, while a negative K means it falls.
  • Calculating K: If you know a point (X, Y) on the line (and N=0), you can calculate K by dividing Y by X (Y/X = K).

Understanding N (Y-intercept/Vertical Shift)

  • Definition: N is the y-intercept.
  • Meaning: It's the value of Y when X equals zero, meaning it's the point where the line crosses the y-axis.
  • On a Graph: N determines the starting point or the vertical positioning of the line.
  • Direct vs. Linear Proportion: In a strictly proportional relationship (Y=KX), the line must pass through the origin (0,0), meaning N would be 0. The presence of N in Y=KX+N makes the relationship a linear one, not a directly proportional one.

Example

Temperature probe: Analog Log-scale.bos
Raw: 0 – 1023 counts ↔ scale to: 0 – 100 °C

K = (100 – 0) / (1023 – 0) = 0.0977 (°C per raw count)
N = 0 – 0.0977 × 0 = 0
So if your sensor is sending out values temperature values as0-1023 then the analog log will scale its value to 0-100 range.

If instead the sensor is 0.1 V → 0 °C, 0.4 V → 100 °C, and the PLC turns 0.1 V into 512 counts, 0.4 V into 2048 counts:
K = (100 – 0) / (2048 – 512) = 0.0769
N = 0 – 0.0769 × 512 = –39.4 (≈ –39)