Hello,
I am just looking for some help regarding the final part of my project at college. Using a IR sensor (IR LED, Phototransistor) I am feeding the pulses picked up from reflective markers on the motor disc into the 18M2 Project Board using the COUNT command;
count irsensor, 1000, w1; ;count pulses from motor over second
Depending on the amount of pulses picked up from the markers with varying speed, I am looking to display an RPM value on my LCD screen, with a varying speed condition (Standstill, Underspeed, Normal, Overspeed).
Currently I am seeing a smooth transition through the conditions when I adjust the speed the motor, however the value that is being displayed on the motor is pulses per second rather than RPM. On my motor there are 9 reflective markers per revolution, I have attempted to write a formula based on the variable: (w1=w1/9*60) However the LCD doesn't appear to respond correctly. My program is relatively short:
initiate:
pause 500
serout LCD, N2400, (254,1) ; clear display for startup
serout LCD, N2400, (254, 128) ; move to start of first line
serout LCD, N2400, (" Shaft RPM ") ; Print message Shaft RPM
pause 5000
main:
serout LCD, N2400, (254, 192) ; move to start of second line
serout LCD, N2400, (" RPM:",#w1) ; display pulse values
count irsensor, 1000, w1; ;count pulses from motor over second
OVERSPEED:
if w1 < 24 then NORMAL ; less than 25 pulses = normal
serout LCD, N2400,(254,128) ; first row of the first line
serout LCD, N2400,(" Overspeed ") ; print message
goto main ; return to start
NORMAL:
if w1 < 14 then UNDERSPEED ; less than 14 pulses = underspeed
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Normal ") ; print message
goto main ; return to start
UNDERSPEED:
if w1 = 0 then STANDSTILL
serout LCD, N2400, (254, 128)
serout LCD, N2400, (" Underspeed ")
goto main
STANDSTILL:
serout LCD, N2400, (254, 128)
serout LCD, N2400, (" Standstill ")
goto main
Is there any way to display RPM rather than pulses per second? The model of motor I'm using is very old, I have emailed the company with regards to specs but they couldn't help. Its a DC permanent magnet servo motor, I am adjusting the speed with a varying power supply (0-15V).
Thanks a lot in advance
Steven
I am just looking for some help regarding the final part of my project at college. Using a IR sensor (IR LED, Phototransistor) I am feeding the pulses picked up from reflective markers on the motor disc into the 18M2 Project Board using the COUNT command;
count irsensor, 1000, w1; ;count pulses from motor over second
Depending on the amount of pulses picked up from the markers with varying speed, I am looking to display an RPM value on my LCD screen, with a varying speed condition (Standstill, Underspeed, Normal, Overspeed).
Currently I am seeing a smooth transition through the conditions when I adjust the speed the motor, however the value that is being displayed on the motor is pulses per second rather than RPM. On my motor there are 9 reflective markers per revolution, I have attempted to write a formula based on the variable: (w1=w1/9*60) However the LCD doesn't appear to respond correctly. My program is relatively short:
initiate:
pause 500
serout LCD, N2400, (254,1) ; clear display for startup
serout LCD, N2400, (254, 128) ; move to start of first line
serout LCD, N2400, (" Shaft RPM ") ; Print message Shaft RPM
pause 5000
main:
serout LCD, N2400, (254, 192) ; move to start of second line
serout LCD, N2400, (" RPM:",#w1) ; display pulse values
count irsensor, 1000, w1; ;count pulses from motor over second
OVERSPEED:
if w1 < 24 then NORMAL ; less than 25 pulses = normal
serout LCD, N2400,(254,128) ; first row of the first line
serout LCD, N2400,(" Overspeed ") ; print message
goto main ; return to start
NORMAL:
if w1 < 14 then UNDERSPEED ; less than 14 pulses = underspeed
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Normal ") ; print message
goto main ; return to start
UNDERSPEED:
if w1 = 0 then STANDSTILL
serout LCD, N2400, (254, 128)
serout LCD, N2400, (" Underspeed ")
goto main
STANDSTILL:
serout LCD, N2400, (254, 128)
serout LCD, N2400, (" Standstill ")
goto main
Is there any way to display RPM rather than pulses per second? The model of motor I'm using is very old, I have emailed the company with regards to specs but they couldn't help. Its a DC permanent magnet servo motor, I am adjusting the speed with a varying power supply (0-15V).
Thanks a lot in advance
Steven