I need have a cloth of 7m long and 1.5m wide. I need to move this at 4m per hour. The mechanisme I am making. the motir has a reduction of 1:25 and there is an other reduction in the belts of 1:2. This means that i have to send 850HZ to the motorcontroller. That works. But for cleaning and maintenance purposes I want this wall to move faster to the speed that the worker find convenient. Until now the stepper worked at 10Khz. That would be the max speed.
I am loocking for a solution.
I tried allso the folowing, but did not played alot with it. It is not working, I can not regulate the speed. I gues that I am not doing the if comand right. I made it first without the pause 50 and now ith the pause 50. I ma using an picaxe 08m2 with a 5k om pot on c4. Output is c2
I started of wth logicar for the sintaxes.
What I am trying to do is the following:
Reard the analog port and if the reading is between 2 limits, then execute a preset pwmout. if the reading of the naalog port is not bteween the limits, then go and look furter to the next lower and higher limit. if it is correct, the do the appropriate pwmout, othewise go further etc.
symbol varA = b0
symbol varB = b1
symbol varC = b2
symbol varD = b3
symbol varE = b4
symbol varF = b5
symbol varG = b6
symbol varH = b7
symbol varI = b8
symbol varJ = b9
symbol varK = b10
symbol varL = b11
symbol varM = b12
symbol varN = b13
symbol varO = b14
symbol varP = b15
symbol varQ = b16
symbol varR = b17
symbol varS = b18
symbol varT = b19
symbol varU = b20
symbol varV = b21
symbol varTEMPBYTE1 = b22
symbol varTEMPBYTE2 = b23
symbol varTEMPBYTE3 = b24
symbol varTEMPBYTE4 = b25
symbol varTEMPBYTE5 = b26
symbol varTEMPBYTE6 = b27
symbol varTEMPWORD1 = w11
symbol varTEMPWORD2 = w12
symbol varTEMPWORD3 = w13
}
main:
let dirsC = 5
startreading:
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 0 and varTEMPBYTE1 <= 25 then
pwmout pwmdiv16, C.2, 124, 249 ; 500Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 25 and varTEMPBYTE1 <= 50 then
pwmout pwmdiv4, C.2, 249, 499 ; 1000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 50 and varTEMPBYTE1 <= 75 then
pwmout pwmdiv4, C.2, 124, 249 ; 2000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 75 and varTEMPBYTE1 <= 100 then
pwmout pwmdiv4, C.2, 82, 165 ; 3000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 100 and varTEMPBYTE1 <= 125 then
pwmout C.2, 249, 499 ; 4000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 0 and varTEMPBYTE1 <= 150 then
pwmout C.2, 199, 399 ; 5000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 0 and varTEMPBYTE1 <= 175 then
pwmout C.2, 166, 333 ; 6000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 0 and varTEMPBYTE1 <= 200 then
pwmout C.2, 142, 285 ; 7000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 0 and varTEMPBYTE1 <= 225 then
pwmout C.2, 124, 249 ; 8000Hz at 50% @ 4MHz
end if
pause 50
readadc C.4, varTEMPBYTE1
if varTEMPBYTE1 >= 0 and varTEMPBYTE1 <= 255 then
pwmout C.2, 110, 221 ; 9000Hz at 50% @ 4MHz
pause 50
end if
goto startreading