Page 1 of 1

learning wiper and washer

Posted: Wed Feb 28, 2018 6:02 am
by FIS
Hello
I learn to configure as follows
wiper1.pmu
(25.03KiB)Downloaded 49 times
One switch of the keyboard switches to activate wiper slow and fast (2stages) and using switchboard ID0x435 SW1 to connect simple push on steering switch to activate washer pump

Q:
1. is this correct to set k_wiper: s1.setChannel as w_wipers.slowOut and s2.setChannel as w_wipers.fastOut
wiper2.pmu
(26.61KiB)Downloaded 48 times
2. In wiper2.pmu when I activate SW1 (washer) I want to activate wiper slow too. I put this on formula in o_wipers_slow. Is this correct?

3. I notice if I use formula in o_wipers_slow or o_wipers_fast the respective output pin setting in w_wipers goes to blank. Is this normal?

Thank you

Re: learning wiper and washer

Posted: Wed Feb 28, 2018 2:30 pm
by jgm
Hi,

1. Setting keypad button k_wiper by setChannel is not required. I've removed these setting from your project.

2. The easiest way to activate the slow mode of the wiper is to use "Single swipe" option. There is Input channel for the Single swipe. I've used it with your washer button.

Please find attached a modified project that uses Single swipe.
(more in the next post)
Single_swipe.png

Re: learning wiper and washer

Posted: Wed Feb 28, 2018 2:41 pm
by jgm
3. Changing the formula of the slow/fast output is not recommended, as it will be changed every time you use Wipers Module.

It's better to modify input signal.
Please find an attached example that activates the slow mode for 3 seconds when the washer is clicked.

Instead of using k_wiper directly I route it by math channel. And then use this math channel as the input for Wipers Module.

a. First we need to generate 3s second pulse: f_washerPulse = pulse c_washNwipe.rising 3s
b. Then we need to mix the k_wipers and the pulse: n_wiperMaster = max(f_washerPulse, k_wiper)
c. Finally use the n_wiperMaster in Wiper Module

(Also, the f_washerPulse can be used for washer output. (Or not, as you prefer.)
Using_wiperMaster.png

Re: learning wiper and washer

Posted: Thu Mar 01, 2018 2:18 pm
by FIS
jgm wrote:
Wed Feb 28, 2018 2:41 pm
3. Changing the formula of the slow/fast output is not recommended, as it will be changed every time you use Wipers Module.

It's better to modify input signal.
Please find an attached example that activates the slow mode for 3 seconds when the washer is clicked.

Instead of using k_wiper directly I route it by math channel. And then use this math channel as the input for Wipers Module.

a. First we need to generate 3s second pulse: f_washerPulse = pulse c_washNwipe.rising 3s
b. Then we need to mix the k_wipers and the pulse: n_wiperMaster = max(f_washerPulse, k_wiper)
c. Finally use the n_wiperMaster in Wiper Module

(Also, the f_washerPulse can be used for washer output. (Or not, as you prefer.)

Using_wiperMaster.png

I have to do online practices :roll:
Could you please explain the 'number' operations? how you decide to create wiperMaster, I read the manual but has limited information I can understand
Thank you very much

Re: learning wiper and washer

Posted: Thu Mar 01, 2018 3:55 pm
by jgm
You need to "mix" two channels.
One (k_wiper) has values 0, 1 or 2.
The second (f_washerPulse) has values 0 or 1.
You want to select the greater of these two channels.
Max (the maximum value of two values) gives you what you need.

max(0, 0) = 0
max(0, 1) = 1
max(1, 0) = 1
max(1, 1) = 1
max(2, 0) = 2
max(2, 1) = 2

This only one solution to your problem. There are other solutions that solve your problem in the same or similar way.

Re: learning wiper and washer

Posted: Thu Mar 01, 2018 5:55 pm
by FIS
Got it! Thanks agin :D