Just want to shine some light on the Proportional hydraulic valve control. The spool, the moving part inside the valve, have a tendency to stick to the valve body when left stationary. This is mainly due to seals applying a pressure to the sealing surface and press the oil away. The result is the seals stick to the spool. The best comparison I can come up with is when walking on ice. As long as the shoes do have a grip you have fairly good control but when the shoes start sliding the heat generated under the feet lubricate the ice and you have no control. When applying a frequency we make the spool shiver slightly, hence we maintain the oil film in the sealing.
For ordinary projects the PWM used to control the amperage is a easy way to maintain the lubrication, providing the frequency is suitable for the job. The frequency needed will be between 50 and 400Hz but most commonly used valves is in the range between 100 to 200Hz. There are many factors impacting the selection of frequency but the easiest way, and maybe most important factor is the inertia of the spool. A large, heavy spool need lower frequency than a lighter spool. Again, this is simplified.
Form advanced control of proportional valves much higher frequencies may be used. The software is then programmed to give a "burst", a fairly hard command to change the position of the spool. This should theoretically ensure the spool is moved when we change the command but leave the spool stationary when the command is frozen. The idea behind this is that is should reduce wear tot eh seals. Frankly, I have never seen a valve worn out due to the 200Hz frequency, on the other hand I find the simple 200Hz more responsive.
A proportional valve also need to move the spool a given distance before start to open up and the oil flows. This is called I-min. In the other end of the scale is the current needed to fully open a valve, regardless of how much current you apply the valve is fully open at the I-max value. Compared with a car, the wire from the accelerator pedal have some slack. With lot of slack you have little control as you need to press down and wait to see if anything happens. With no response, you give some more command and see if anything happens. Finally, you get annoyed and give too much command. You need to calibrate your I-min value.
When overtaking you need the wire set in a way enable the engine to reach 100% power. If too tight, you reach 100% power long before the petal have traveled to the end. You then need to set your I-max.
All this might seems like details but when the hydraulic system is a part of a closed loop using a PID controller this is the difference between success and failure.
As I am new to Arduino/Genuino I would be very happy if anyone here could guide me to a example that enable me to set the Frequency in the range 50 to 400Hz using a constant where the value is in Hz. At the same time, we need a constant for I-min and I-max. As we do not have the ability to measure the amperage this constant could be just a none intrinsic value.