I fail to identify replies on this forum and for some reason I do not get a mail notification. Is there some kind of mailing list I can be a member of instead of this forum?
And now for the real thing.
The command I do to start the motor is in a function called 53-MotorStart. it is performed only once and has this code in it:
stepspeed 1, 1, 1
stepmove 1, 2147483647, 10
In function called 51-Operate and in function 52-Calibrate I recalculate the speed according to changes in fluid level measured from analog input 1. (code further below).
The motor rotates all the time only the speed is changed and that is also very gradually. (would the motor reach end of track I restart it using relay 10 as a trigger).
Code snip:
call FluidLevel
' calculate the new exit motor speed
' fluid level Motor spec Definition of 100% fluid level
' 400 3000
if (dm[52] > 0 and dm[53] > 0)
e = dm[53] * dm[51] / dm[52]
else
x$ = "Fluid level 0 !! "
call ShowErr
endif
' set the motor speed
if (e > 0)
stepspeed 1, e, 1
stepmove 1, 2147483647, 10
else
stepstop 1
endif