Instead of returning the actuator to zero at the end of the routine, could you use an "if else" condition to determine the position of the actuator? For instance, something like:
int inPin = 7;
int val = 0;
void setup(){
pinMode (inPIn, INPUT);
void loop(){
val == digitalRead(inPin);
if (val == 1) {
setPwmDuty(0); //Change this value 0-100 to adjust duty cycle = mm of actuator travel.
delay(10000); //Time in mS (60,000mS = 1 minute)
setPwmDuty(25);
delay(10000);
setPwmDuty(75);
delay(10000);
val = 0;
}
else if (val == 0) {
setPwmduty(0);
}
I'm still learning Arduino coding myself so my syntax may be off or things may need to be altered but that's how I'd write it using ladder logic. Read the state of an integer and that value would dictate work flow and nothing else will happen until integer is reset back to 0. All the other stuff about commanding the actuator I don't quite know but I thought I'd help in the limited way I can with the sequencing.
Hope this helps you and best of luck on your work.