Hi all,
For my project at college I am doing a shaft "Overspeed/Underspeed RPM indicator" using an CHI030B project board, IR Sensor and displaying RPM and the respective speed condition on a LCD. I'm currently using 2 LED's, red for "Overspeed/Underspeed" and green for "NORMAL". I'm currently using 4 speed conditions.
At the moment, at start up due to being in the range of "Underspeed" the red LED will illuminate highlighting that there is an underspeed condition. Is there anyway I can delay this alarm until after rated speed is achieved of the motor? I'm looking to include a flashing amber LED indicating that the motor has just started and is approaching rated speed. This is my finalised coding for the project:
symbol LCD = B.2 ; change name of pin to LCD
symbol irsensor = C.7 ; change name of pin to irsensor
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:
count irsensor, 500, w1; ; count pulses from motor 0.5 sec
w2=w1*120/9 ; formula for RPM
serout LCD, N2400, (254, 192) ; move to start of second line
serout LCD, N2400, (" RPM:",#w2," ") ; display RPM values
serout LCD, N2400,(254,128) ; first row of the first line
OVERSPEED:
if w1 < 12 then NORMAL ; less than 12 pulses = normal
serout LCD, N2400,(254,128) ; first row of the first line
serout LCD, N2400,(" Overspeed ") ; print message
high B.7 ; Red LED on
low B.3 ; Green LED off
goto main ; return to start
NORMAL:
if w1 < 7 then UNDERSPEED ; less than 7 pulses = underspeed
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Normal ") ; print message
low B.7 ; Red LED off
high B.3 ; Green LED on
goto main ; return to start
UNDERSPEED:
if w1 = 0 then STANDSTILL ; 0 pulses = stationary
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Underspeed ") ; print message
high B.7 ; Red LED on
low B.3 ; Green LED off
goto main ; return to start
STANDSTILL:
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Standstill ") ; print message
low B.7 ; Red LED off
low B.3 ; Green LED off
goto main
Is there anyway I can include a delay, such as within the first few moments of start up to avoid illuminating the RED LED for Underspeed?
Thanks a lot in advance
Steven
For my project at college I am doing a shaft "Overspeed/Underspeed RPM indicator" using an CHI030B project board, IR Sensor and displaying RPM and the respective speed condition on a LCD. I'm currently using 2 LED's, red for "Overspeed/Underspeed" and green for "NORMAL". I'm currently using 4 speed conditions.
At the moment, at start up due to being in the range of "Underspeed" the red LED will illuminate highlighting that there is an underspeed condition. Is there anyway I can delay this alarm until after rated speed is achieved of the motor? I'm looking to include a flashing amber LED indicating that the motor has just started and is approaching rated speed. This is my finalised coding for the project:
symbol LCD = B.2 ; change name of pin to LCD
symbol irsensor = C.7 ; change name of pin to irsensor
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:
count irsensor, 500, w1; ; count pulses from motor 0.5 sec
w2=w1*120/9 ; formula for RPM
serout LCD, N2400, (254, 192) ; move to start of second line
serout LCD, N2400, (" RPM:",#w2," ") ; display RPM values
serout LCD, N2400,(254,128) ; first row of the first line
OVERSPEED:
if w1 < 12 then NORMAL ; less than 12 pulses = normal
serout LCD, N2400,(254,128) ; first row of the first line
serout LCD, N2400,(" Overspeed ") ; print message
high B.7 ; Red LED on
low B.3 ; Green LED off
goto main ; return to start
NORMAL:
if w1 < 7 then UNDERSPEED ; less than 7 pulses = underspeed
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Normal ") ; print message
low B.7 ; Red LED off
high B.3 ; Green LED on
goto main ; return to start
UNDERSPEED:
if w1 = 0 then STANDSTILL ; 0 pulses = stationary
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Underspeed ") ; print message
high B.7 ; Red LED on
low B.3 ; Green LED off
goto main ; return to start
STANDSTILL:
serout LCD, N2400, (254, 128) ; first row of first line
serout LCD, N2400, (" Standstill ") ; print message
low B.7 ; Red LED off
low B.3 ; Green LED off
goto main
Is there anyway I can include a delay, such as within the first few moments of start up to avoid illuminating the RED LED for Underspeed?
Thanks a lot in advance
Steven