Pulsin not consistent

Boondocker

New Member
I really enjoy playing the vsm. However I've encountered some trouble using the PULSIN command. The pulse time is not matching input consistently from a square wave generator.

Freq , Expected pulse time , Display of pulse time

5 , 10000, 9933
7.5 , 6660 , 2045
8.0, 6250, 387
10, 5000, 4967
11, 4500, 2660
15, 3330, 2054
30, 1660, 1657

Any suggestion? I’ve tried averaging the pulse and pausing between reads with out any luck.


Thanks
 

Attachments

BCJKiwi

Senior Member
I'm a bit confused.

rpm.bas is not relevant to how you are measuring the pulse length of the square wave in the table above as the program only has the math for rpm.
So what is the program being used for displaying the pulse length?
I don't have VSM so can't see what you have in the DSN.
 

Boondocker

New Member
Hi BJCKiwi,

The main concern is pulse time displayed is not consistent with the pulse that is being inputted. I would expect to get a pulse width of 4500us with an input of frequency of 11hz, not 2660us. On some frequencies the pulse with is right on, i.e. at 5hz, 10hz, and 30 hz.

I need to explain the rpm part, the associated program name. The pulse width is used to determine frequency of 12 pole 3 phase alternator to monitor rpm. A quick cross check for alternator speed; rpm = 120 * freq / no. poles. So in this case a 10hz input indicates 100 rpm, 15hz:150rpm, 30hz:300rpm…………

Didn’t mean to be confusing, hope this helps.

Regards,

Boondocker.
 

BCJKiwi

Senior Member
As I don't have VSM it is not cleat to me where the pulsin count shown on the LCD is coming from.

If it is an internal monitor function within VSM then it is obviously a VSM issue.
If it comes from code then it could be a code issue but I could not see any code in rpm.bas for this output - hence the question.
 

Technical

Technical Support
Staff member
Thanks for pointing this out, it was a minor bug in VSM.

v1.0.3 fixes this, patch now available from the PICAXE VSM Software page. We have tested with your file and this now appears to operate correctly.
 

Boondocker

New Member
Works as expected with the patch installed. Also getting an excellent responds between changing the frequency and the time it takes to display on the LCD. So far I'm impressed with VSM, what a great learning tool.
 
Top