Mark Posted July 18, 2016 Share Posted July 18, 2016 Hi all. Sorry if this is in the wrong place. I am new to this and have some basic questions. I am wanting to convert my engine dyno from mecanical read out to a display on the laptop. I have a U3 labjack and need to measure the load cell and RPM then display it on screen via a calculation to create a graph to show bhp of the engine. I was going to use DAQfactory and my U3. What is the best way of measuring the rpm, a hall sensor,proximity switch or somthing else? I was thinking of 2 counts per rpm. Can the load cell be connected straight to the U3 or will the signal need boosting? if so how? thank for any help Mark Link to comment Share on other sites More sharing options...
LabJackSupport Posted July 20, 2016 Share Posted July 20, 2016 The choice of rotation speed sensor is going to be impacted by your physical constraints, but any sort of encoder or sensor that gives you one or more pulses per revolution should be pretty easy to deal with. If you find some of interest post links to technical details and we can take a look. As for the load cell, to use one with the U3 you need an instrumentation amp such as the LJTick-InAmp: http://forums.labjack.com/index.php?showtopic=4376 https://labjack.com/support/datasheets/accessories/ljtick-inamp/appendix-d Link to comment Share on other sites More sharing options...
Mark Posted July 26, 2016 Author Share Posted July 26, 2016 I have read many of the threads on shaft rpm and are none the wiser as to what I realy need. I am wanting to start with the shaft RPM (one thing at a time) get it working then move to the load cell. What is the best / easyest way of measuring the rpm, Inductive or hall efect sensor? I have found a inductive sensor on ebay and RScomponents (http://www.ebay.co.uk/itm/DC-5-35V-3P-Aviation-Connector-2mm-PNP-NO-Inductive-Proximity-Sensor-Switch-/191655561377?_trksid=p2141725.m3641.l6368) or http://uk.rs-online.com/web/p/inductive-proximity-sensors/8193163/ Is one sutable for use with the U3 if so which one is best? Bit more info. The engines will run from aprox 900 to 10000 rpm. the tooth disk will have 1 or 2 teeth per 1 rev. I dont have many restrictions on space or size. thanks Mark Link to comment Share on other sites More sharing options...
LabJackSupport Posted August 1, 2016 Share Posted August 1, 2016 The Ebay sensor you linked looks interesting because it runs off of 5 volts which you can get from the U3. It does not tell us how much supply current it needs, but I would think a sensor like this draws less than 50mA which is no problem for the U3 to provide from its VS terminals. (Note: The 200mA spec is likely the maximum current the PNP output switch can source.) The output is PNP, rather than the preferred NPN, so you will need to add a 4.7k pull-down resistor: https://labjack.com/support/app-notes/open-collector-signals At 900 RPM you are only getting 15-30 pulses per second. That might be enough to use a counter, but using a timer to measure the period of each pulse is a more likely solution: http://forums.labjack.com/index.php?showtopic=1105 Link to comment Share on other sites More sharing options...
Mark Posted September 1, 2016 Author Share Posted September 1, 2016 Hi. I have read the info you sujested and havve come up with the attached program. My problem is I can get a signal from the proximity sencor on/off but cannot convert it to shaft RPM. What am I not doing? I dont realy understand the setup sheets or the programing. I am using this proximity sencor, http://www.ebay.co.uk/itm/281951674994?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT it will not work just from the labjack so it is powerd from a 9 volt battary, + terminal is connected to Vs on labjack. Neg to battery only and signal to FIO4 Many thanks Mark RPM-f.ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted September 1, 2016 Share Posted September 1, 2016 You have some typos. 1) there is no "counter" channel, so line 7 of the Read sequence won't work. Just delete that line. You aren't reading a counter 2) rename the Read sequence to something else. "Read" is a reserved word and might cause problems. 3) in startup you call config(), but you renamed the sequence Config_sequence so that never gets called. 4) your periodRaw and RPM channels, the ones you are stuffing values into using AddValue() should have a timing of 0, otherwise they will go and query the driver. So, periodraw will end up with extra values that correspond to A to D channel 4 on the LabJack, while RPM will fill with somewhat random numbers between -1 and 1. Link to comment Share on other sites More sharing options...
Mark Posted September 1, 2016 Author Share Posted September 1, 2016 Hi. I have done the changes, I renamed the sequence to Config. but now with timing set to 0 i dont get any input from the proximity sencor and on the chanel graph the time base dose not scroll. why? I have attached the file hope it helps. Thanks Mark Engine Dyno I.ctl Link to comment Share on other sites More sharing options...
Mark Posted September 1, 2016 Author Share Posted September 1, 2016 I have changed line 20 in startup from read to Data, Just noticed that but it made things no better. Link to comment Share on other sites More sharing options...
AzeoTech Posted September 6, 2016 Share Posted September 6, 2016 line 8 of Data is wrong. "your delay(1)" is invalid. You just want "delay(1)" LabJack will have to address whether you are sending the right commands to the device. Link to comment Share on other sites More sharing options...
LabJackSupport Posted September 6, 2016 Share Posted September 6, 2016 I don't see any obvious in your CTL (but it might have extra stuff you don't need). It looks like it is configuring a 32-bit period timer on FIO5. If you don't need the PWM, perhaps get rid of that and just use the default clock configuration and just go with your 1 period measurement timer on FIO4. If you have not already, you want to test your timer first using the test panel in LJControlPanel. https://labjack.com/support/datasheets/u3/hardware-description/timers-counters/timer-mode-descriptions/period-measurement-32 In the test panel, I suggest just the following 2 changes to the defaults to enable your 1 input timer on FIO4: # of Timers Enabled = 1 Timer 0 Mode = RISINGEDGES32 If that works with your signal, you can then go to "config defaults" in LJControlPanel and do these same settings and save them as the power-up default for your device. Then power cycle the U3 so they take effect. Now you don't need to do any configuration in DAQFactory ... just read the timer value. Link to comment Share on other sites More sharing options...
Mark Posted September 10, 2017 Author Share Posted September 10, 2017 HI. I have come back to this project and give it another go. I got fedup with not understanding it or getting anywhere with it. This time i would like to start a fresh and do one step at a time. Setting up the RPM input. I am using the equipment as before. I have configerd my U3-HV to have 1 timer enabled. with RISINGEDGES32. 48Mhz diviser of 48. is this correct or should it just be the 48Mhz? The graph on the RPM chanel page has a line on it that changes with pulses. I have a page with a variable value display that gives me a large value that gets lower with more pulses. How do i convert that value to a acurate RPM reading? thanks Mark Link to comment Share on other sites More sharing options...
AzeoTech Posted September 11, 2017 Share Posted September 11, 2017 Start simple. Try using one of the LJ Guide samples, in particular, try the counter. I'm not sure why you are using a Timer instead of a Counter. A counter is easier to setup. The samples are in the LJGuideSamples folder under DAQFactory. Link to comment Share on other sites More sharing options...
Mark Posted September 11, 2017 Author Share Posted September 11, 2017 I wil look at the counter. Would the counter work ok with 10 teeth or more per rev. and reving at 10000 rpm? I was only using 1 tooth per rev to get things working. Link to comment Share on other sites More sharing options...
AzeoTech Posted September 11, 2017 Share Posted September 11, 2017 The counter is much faster than the timer. Its chip based, where the timer is software based on a chip. I believe the LabJack counter is 1 mhz, so can handle like 6000 teeth at 10,000 rpm. Just make sure you wire the sensor correctly. Its NPN, so not just a contact closure. The LabJack folks can address how to properly wire an NPN input. Link to comment Share on other sites More sharing options...
LabJackSupport Posted September 11, 2017 Share Posted September 11, 2017 10 ppr and 10000 rpm gives you about 1667 pulses per second, so you can use a counter or a timer. See the following for an overview: https://forums.labjack.com/index.php?showtopic=1105 First try them in the test panel in LJControlPanel. I suggest you try out a simple hardware counter, and also try the 32-bit period input timer: https://labjack.com/support/datasheets/u3/hardware-description/timers-counters For an NPN signal you should be able to just connect to a DIO and GND as shown in Figure 2 here: https://labjack.com/support/app-notes/open-collector-signals Link to comment Share on other sites More sharing options...
Mark Posted September 11, 2017 Author Share Posted September 11, 2017 Hi. I have tried the timer and got a counting up value in my variable value box. But how do I convert that to a rpm and then to get it to change was the engine rpm increases with an update about every 0.25 sec. Link to comment Share on other sites More sharing options...
AzeoTech Posted September 12, 2017 Share Posted September 12, 2017 To get it to update every 0.25 seconds you need to read the input every 0.25 seconds. If you are using the pulse counter timer instead of the period input counter, then you need to put this in the expression for the display: (myChannel[0] - myChannel[1]) / (myChannel.time[0] - myChannel.time[1]) * 60 Make sure you use a 32 bit timer or use the counter. If just a 16 bit, then you are going to have to deal with roll over every 40 seconds or so at 1667 pulses per second. At 32 bit its more like every 30 days so as long as you reset the counter between runs you'll be fine. Link to comment Share on other sites More sharing options...
Mark Posted September 13, 2017 Author Share Posted September 13, 2017 I have gone back to using a timer and i now have to convertion to rpm worked out as well by 60*1000000/timer_raw[0]. this is done in the properties of the veriable box. Would it be better done by adding a convertion. As later I will need to use the rpm value in a calculation for the graph. Link to comment Share on other sites More sharing options...
AzeoTech Posted September 13, 2017 Share Posted September 13, 2017 Yes, you'd be better off as a conversion: 60*1000000/Value that you then apply to the channel. Then the channel will only read in rpm. Link to comment Share on other sites More sharing options...
Mark Posted September 14, 2017 Author Share Posted September 14, 2017 thats working lovley now. Thank you. next can I make it change to zero when no signal or it stops rotating? Also whaen i was doing this last time i was writing sequences. I have had another lok at them but still cannot get it to work. Will i need to write sequences for the project to work (produce a 2 line graph with bhp and rpm) or can i do it the way i am going at the moment? Link to comment Share on other sites More sharing options...
AzeoTech Posted September 15, 2017 Share Posted September 15, 2017 Are you trying to plot BHp vs RPM? Try and read the two channels at the same interval, then the XY graph is easy to setup. You can set it to 0 when Value goes to 0 by using an inline if: iif(Value == 0, 0, 60*1000000/Value) Link to comment Share on other sites More sharing options...
Mark Posted September 16, 2017 Author Share Posted September 16, 2017 I have tried if(Value == 0, 0, 60*1000000/Value) in the conversions and it seems to stop it from working at all. My rpm out put is reading the time period again I think ( very large No.) If I remove the if(value==0,0, and the last ) then it works ok again. Have I put it in the right place ? Link to comment Share on other sites More sharing options...
AzeoTech Posted September 16, 2017 Share Posted September 16, 2017 Its not if(), its iif(). Two i's. It stands for "inline-if" if() is a scripting statement and can't be used in an expression. iif() is a function and so can be used in an expression. Link to comment Share on other sites More sharing options...
Mark Posted September 17, 2017 Author Share Posted September 17, 2017 I have changed it to iif(Value==0,0, with the bracket on the end but no diffrence it is giving me the raw pulse time. I have attached the cot file if it is any help. Link to comment Share on other sites More sharing options...
Mark Posted September 18, 2017 Author Share Posted September 18, 2017 That should be CTL file. And this timei have remsmbedx to add thd file. Dyno 11-9-17b.ctl Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.