Input processing troubles

I have an input proccesing list on my emoncms instance that does this:

Then, I use this feed on this dashboard (the watts in yellow):
dash

My question is, how come with input value of -5, I get -5 on the dash?

The whole point of my process list is to fix the errors around the zero, as the current transformer is not very accurate near zero.

And, given my processing instructions, I think I should get 0.2 for all input values between -12 to 12, or am I wrong?

I will greatly appreciate for someone else to look at this, and share their thoughts…

And if you have questions - ask away!

Hello @mrpetrov I tried replicating your process list here and can confirm that I get the same result. The issue seems to be with the GOTO process.

@nchaveiro are we using this process correctly?

Logic is wrong. Negate the ifs.

Thanks @nchaveiro Not sure that I follow, without the ifs it wont check for the right conditions?

If not >= 12 skip next so that 12 and above do go direct to log2feed. Currently if less than 12 goto line 7 is the opposite of what you want.

1 Like

Let try to explain, for the 1 process use !>= and for the 3 process use !<=.

1 Like

@TrystanLea Thanks, Trystan, for confirming my find.

@nchaveiro And I am afraid it does not work either way, Chaveiro.

As a matter of fact, now that I think about it, the problem should be in the GOTO statement, as it explains what I saw while I was experimenting with it…

Or if you could think of a way to get some assignment to execute but only for values -12 to +12 ?

Anyway, thanks for replying to all!

@pb66 Yes, Paul.

  1. If +12 and above - go to log feed;
  2. If -12 and less - go to log feed;
  3. All else (which leaves values around zero) - apply correction (assign 0.2), and then log to feed;

Or ar least that is what I want it to do…

1 Like

You are right, now that i think about it, try this:

1 - if > 12, skip
2 - if >= -12, skip
3 - goto 6
4 - zero
5 - + 0.2
6 - Log to feed

If you apply the correction highlighted by @nchaveiro that is what will happen, currently you have the inverse of that.

Can you expand on that? Is it the same output? Did you replace both ifs with if nots before retesting?

I suspect that for a input of 5 (or even -5) you should now get an output of 5.2, ie the result will always be abs(input) + 0.2. (abs only inverts negative values, it doesn’t set a specific value)

In which case you do not want the abs process you want reset to zero instead and then add 0.2. That way all values 0 +/-12 will be ignored, and instead a fixed 0.2 will be added to a fixed 0.

@nchaveiro
I will test that when I have the chance, and will keep you posted.

But what is the exact logic in what you are proposing?
How do 2 consecutive ifs work out?
Please, help me understand it better…

Each if will skip the next line when the condition is true.
When the value is 12, the processlist will pass on this lines: 1-3-6
When the value is -5 : 1-2-4-5-6
When the value is -13 : 1-2-3-6

1 Like

OK, this works:

1 Like