LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

development of test bench for speed sensor

Hello, I am allowing myself to create a topic because I have not found a similar topic allowing me to obtain some answers. I am a work-study student at BAC+2 and during my first year after the baccalaureate I saw the basics of Labview, but in a really not advanced way. This year in business my mission is to update a speed sensor test bench, coded in Labview. I have an acquisition card in the PC which is old but which has the right characteristics for what I need, the bench in question is composed of a toothed wheel which is driven by a motor. So I have a First DC 4Q 50/5 motor control that I am looking to replace with something more recent. The code that I recovered dates from 2013, the latter does not work and is coded in a way that I do not know. I share some pictures below

katramz_0-1726129614759.pngkatramz_1-1726129622702.png

 

 

 

 

For comparison I am more used to block code (this code has nothing to do with the bench in question)

katramz_2-1726129634486.jpeg

 

Sorry for the quality of the pictures but I only have that on hand. 

 

 

 

The main idea was to simplify the original code, to "make it reliable" and improve it. But since I don't understand it, I'm more on the idea of ​​resuming a code at 0 that would follow this logic:

 

- entering the operator and the type of sensor to be tested

 

- Launching and revving up the engine

 

- stabilizing at the maximum setpoint until reaching the maximum speed

 

- decelerating the engine and acquiring the amplitude and frequency of the output signal

 

- processing the values ​​obtained

 

- writing a report in pdf format that serves as a calibration certificate (result curve, operator, date, compliant or non-compliant sensor)

 

 

But that's on paper, in reality doing this seems so complicated to me that I don't know where to start. In my laboratory I have another bench that is up to date, I could then take inspiration from the code because it is done in the form that I know but the code is complex and adopted to other types of sensor so I think I'm probably going to get lost.

 

After this long introduction I need you to know what is the best approach. Maybe I should start by making the simplest possible program that just acquires the amplitude and voltage of the sensor and then stops the motor and then try to improve the program or directly try to make a program with all the logic that I mentioned above? In short I don't really know where to start and which first block to put:smiling_face_with_a_drop_of_sweat:

 

I specify that my apprenticeship master does not necessarily master LabView, so I am pretty much left to my own devices.. I am open to any idea that could help me achieve this project Thanks in advance for your reading!

0 Kudos
Message 1 of 5
(395 Views)

The bad news is that the code pic you posted looks like the original developer did not know LabVIEW.  Starting out with a bunch of unconnected controls and indicators and creating local variables for every one of them is what a text-based coder usually does when they're forced into using LabVIEW.  There may be decent code in the functional part of the program, but most likely it is a mess of race conditions.  I suggest you look into hiring a consultant to upgrade the program into a more modern version that's coded correctly.  Especially if you may need to upgrade it in the future.

 

The good news is that the sequence of events you describe is exactly what LabVIEW is built for and creating a simple state machine to run the steps should be relatively trivial for anyone with mid-range programming skills.  The abundance of controls and indicators is a concern, but my guess is that most of them would not be required with a proper architecture, and they don't really indicate the program's complexity.

 

Can't really say more based on a fuzzy pic of the first part of the code.  We don't even know what hardware you're using or what its function is.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 5
(357 Views)

Hi, I think these steps are suitable for using a state machine program. (You can find it in the labview sample program.)

But initialization needs to be added at the beginning. (To confirm the device status)

Additionally, you can increase standby. After each state is executed, it returns to the standby state and waits for manual instructions. (You can confirm the results before proceeding to the next step)

When each step is OK, turn the program to automatic.

Don't forget to add error states to record exceptions in each state.
And make sure you can stop the program process.

0 Kudos
Message 3 of 5
(329 Views)

Thanks for the feedback, indeed this code with a lot of variables is cumbersome and I don't understand it because at school they didn't teach me like that. That's why I'm going to have to start the code from 0... With a beginner level and not intermediate ahah

 

My bench which is composed of a motor with a gear wheel is controlled by an escon 50/5 command and I have a pci 6221 acquisition card with cb68lp connector Starting from scratch, it's better to start by running the bench, acquiring the data (I must be able to test 7 sensors at the same time) and gradually complicate the code

0 Kudos
Message 4 of 5
(316 Views)

Thanks I'll go see! When you say "initialize the variables" the problem is that by starting from 0 I don't know which ones I'm going to keep from the old program or not, I don't think many are needed. Even if my bench is manually controllable the goal is to leave it in automatic, launch the measurement then the bench makes all the acquisitions and presents the results by itself. Without user action

0 Kudos
Message 5 of 5
(310 Views)