math channel (ground-controlled duty cycle)

Ask any non-NVH related questions about using PicoDiagnostics software here.
Post Reply
josegumby
OneWave
OneWave
Posts: 31
Joined: Sun Aug 27, 2017 3:46 am

math channel (ground-controlled duty cycle)

Post by josegumby »

Hi,

I'm not sure if I'm doing something wrong, or running into a bug.

The default duty-cycle math channel, for example, duty(A), seems to measure high voltage as on-time, as opposed to low voltage as on-time.

No problem, I tell myself. I'll simply flip it myself by subtracting the duty cycle from 100, 100-duty(A)

Problem is, my custom formula always returns zero. I don't think my math is incorrect. Is there something I did wrong, does it expect spaces, around the minus(-) sign? Or is this some weird syntax-parsing bug that I've run into?

In the meantime, if anyone else is experiencing this problem, the following math formula appears to be working for me:

(duty(A)-100)*-1

I'm simply reversing the subtraction problem, which will yield a negative number, and the multiplying the result by -1, which will turn it back into a positive number. Seems a little silly to have to go this route, buy it seems to work.

Attached is my sample waveform. I was trying to determine the duty-cycle of an IAC valve. The black line is the Pico default duty-cycle math channel. The purple line is the 100-duty(A) which always seems to return 0. And the orange one is my "fix":(duty(A)-100)*-1



Thanks,
Curt
Attachments
Ford_Mustang_1998_Petrol_20200128-0001.psdata
(303.2 KiB) Downloaded 375 times

User avatar
Rfmotors1
TwoWaves
TwoWaves
Posts: 92
Joined: Fri Aug 31, 2012 8:14 am

Re: math channel (ground-controlled duty cycle)

Post by Rfmotors1 »

duty(-A) Ford_Mustang_1998.psdata

Anyway, that your solution also works.

Regards,
Roman
-->
I think I would try write it as (-A)

Hi Curt,
Small correction on my comment.
I had the same problem a time ago and simply tried few tings which did not work, finally got the solution like this.
I have added the minus on front of the channel letter.
So instead of default: "duty(A)" changed to this: "duty(-A)". I have also added the formula to the waveform and attached here.
duty(-A) Ford_Mustang_1998.psdata

Anyway, that your solution also works.

Regards,
Roman