1
Technical support / Re:Fine tuning some timing
« on: April 06, 2015, 06:55:47 PM »
Sorry about the 3 RPM confusion (see my second post). That was how much I saw my RPM's vary in situation 'A' before I rewrote the code as per Gary's suggestion. It is better now, but still not rock solid.
In fact I am only interested in speeds of 80 to 95 RPM's as we are using the number generated by the FMD to set a throttle on an engine, and anything below 30 RPM's means the machine is disengaged and coasting towards 0 RPM's.
"To confirm that the PULSEPERIOD can return a steady value, you can use a PWM output from the same PLC or from another PLC and feed the output to the FMD's PMON or HSC input and you can then read the period and you should be able to see a very stable PULSEPERIOD reading when you observe online." -- This line is interesting because at this time of year we are unable to actually test the machine in the field and so I built a simulator of sorts using a couple of spare Nano's. My (limited) understanding of the PWM output is that it won't go as slow as .5Hz to 2.5Hz. Am I correct? If not please show me an example.
I hesitate to post this but the function below is what I use to generate the Nano output using a potentiometer to vary the voltage to ADC(1). (I wrote this a number of years ago and am not sure I understand it now) It seems to work except for the variation described above as seen by the FMD.
REM set throttle - this runs every Clk:.01s
S=ADC(1)/18
IF S<50 S=50 ENDIF
IF S>200 S=200 ENDIF
T=6000/S
SETLCD 1,1,"Speed = "+STR$(T)
C=C+1
IF C=1 SETIO crank
ELSE CLRIO crank
ENDIF
IF C>S C=0 ENDIF
Thank you again for all the help!
John
In fact I am only interested in speeds of 80 to 95 RPM's as we are using the number generated by the FMD to set a throttle on an engine, and anything below 30 RPM's means the machine is disengaged and coasting towards 0 RPM's.
"To confirm that the PULSEPERIOD can return a steady value, you can use a PWM output from the same PLC or from another PLC and feed the output to the FMD's PMON or HSC input and you can then read the period and you should be able to see a very stable PULSEPERIOD reading when you observe online." -- This line is interesting because at this time of year we are unable to actually test the machine in the field and so I built a simulator of sorts using a couple of spare Nano's. My (limited) understanding of the PWM output is that it won't go as slow as .5Hz to 2.5Hz. Am I correct? If not please show me an example.
I hesitate to post this but the function below is what I use to generate the Nano output using a potentiometer to vary the voltage to ADC(1). (I wrote this a number of years ago and am not sure I understand it now) It seems to work except for the variation described above as seen by the FMD.
REM set throttle - this runs every Clk:.01s
S=ADC(1)/18
IF S<50 S=50 ENDIF
IF S>200 S=200 ENDIF
T=6000/S
SETLCD 1,1,"Speed = "+STR$(T)
C=C+1
IF C=1 SETIO crank
ELSE CLRIO crank
ENDIF
IF C>S C=0 ENDIF
Thank you again for all the help!
John