Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Would this be practical, how would you go about it? (Data-aq + func-gen project)

Status
Not open for further replies.

Triode

Well-Known Member
As some of you might know, I'm a Mechanical Engineering student and I make my tuition by contracting custom equipment, mainly for professors, at first it was purely mechanical stuff, but as I've learned electronics it has become more robotic/mechatronic, and as that trend is increasing my job offers and the amount of pay offered, I'd like for it to continue.

I have been approached about making a force oscillating tester. Meaning based off of a function it is to apply a force, not a position. Desired features are that it can accept programmed functions, shut off after a desired time or number of cycles, and record the displacement and forces experienced at the end of the part being tested, in this case a bike fork.

specs:
applicable force: +200 to -200 lb
cycle speed: .25 to 3 cycles per second
max displacement: +/- 2 inches,
20 position and force samples per cycle
accurate to +/- .05" and +/- 2lb
Due Date September, 2010

Now here's the thing I would like to discuss. Just doing this project is no problem, I have already designed and built one major component, a pneumatic cylinder with position and force feedback and attached it to a PID device and microcontroller so that a 0-10v signal gives you -300 to 300 lbf, now I'm on to the control and data logging aspect. I have access to a full electronics lab and temporarily using equipment there I have been able to connect a function generator, a data logger and a USB daq device with digital output to make a setup that does what the professor has requested, and if I were lazy I could just get a catalog, order each of those components and be done with it. But the problem is that would be a bit wastefull, it would cost around $3000, most of the equipment would be using only a little of the capabilities that make it so expensive, and it wouldn't even be that user friendly; the user would need to set the timer in one place, set the function on another device, set up the DAQ device, and covert the data when they were done.

Now looking at how basic those specs are, am I the only one who thinks a microcontroller connected to a windows application in VB or C# could handle all of this? Were talking about +/-2lbs in a 400lb span, that's only 200 divisions, a 10bit ad gives you 1028, the same goes for the 4 inches divided into 40 positions. So the data logging is nothing big, and when I asked about the function generation he said it didn't need to be highly accurate and that "a sine wave approximated by 5 or 6 force levels would be suitable" (I think I can do better than that, the pneumatic servo I built does about 2000 different force levels). The function generation could be quite simple it seems to me, and I've worked with VBA, C#, C++ and VB plenty.

But still this seems awfully ambitious, so I'm not sure if I would be getting in over my head to try this. The upshot is, if I try and fail I wont have lost much, I can still default to just buying equipment, which is what I would have done anyway. And just think how wowed he would be if instead of a $3000 pile of equipment, I give him a box with a usb cable and a neat little windows app that sets your function, cycle count/run time and handles data logging, and sends it all to excel or access. It would be cheap too, $8 for a usb PIC, $12 for a DAC chip, $6 for some amps, round up for casing, power adapter, and all the little components and this thing should be under $100.

By the way, since some might question why I would spend my time on this, I'm getting payed well, my rep at the university gets me jobs, and I'm getting class credit for an independent research. He has set the budget high enough that I could just buy all that equipment, but that would not be an efficient, or elegant solution. This way seems really cool though, I'm just not sure though, it seems easy and hard, so give me your input, how would you do it? Why is it practical? Why is it impractical?
 
Last edited:
A few questions as I recall this discussion in another thread.

First, you are measuring the force in LbFt as I see it. Generally I would associate that with torque? Unless LbF as you wrote it is pounds or force? Really matters not just curious. :)

Next, I read this as you will apply a force to the part (bicycle fork?) and as force is applied you will measure the travel. Do I have that right? Now I saw this:

"force osc freq 0.25 to 3 Hz"

I am wondering what the time is per cycle? Would it be a function of the frequency?

I'll tell you how I would go about it and make a few suggestions later.

Ron
 
Sorry, by that I meant that the force would go through a complete cycle between 3 times per second and 1 time per 3 seconds.

I made a different thread because the other one was about positional measurement equipment, and I have that done now. But this is about a different part of the same overall project, though a different stage.

By lbf I meant pounds of force, this is just a habit from my mechanical engineering classes, it is part of dealing with the inconvenient definition of the units in the imperial system of measurement as it relates to physics, I can see how it would be confused with lbft.

And yes, it will record travel, and also force, the force is controlled, but by recording them it will be easier to show how the phases line up on a graph, and it will make it easier to debug and maintain. The actuator/PID setup I have built so far has 2 outputs: Position as a resistance, Force as a voltage, and 1 input which is the signal for desired amount of force. The sensors and force control loop are working, as well as the pneumatics, I made that as a separate module so that the project would be more manageable since I haven't done one this complex before.
 
OK Paul so here is what you have. You are looking at 10 bit A to D resolution at 10 volts so the 10 bits give you actually 1024 quantization levels. Therefore you have 10 / 1024 = .009766 or about 9.8 mV per step.

Next you have -200 Lbs to 200 Lbs so we have a span of 400 pounds. Therefore 10 / 400 gives us about 25 mV per pound of force. Not bad since we can resolve about 10 mV. Now you have the 0 to 4" of travel is 0 to 10 volts. That works out to about .001" = about 2.5 mV but no big deal as your least unit of measurement of concern is .050" which is about .125 volt. We can't easily resolve .001" but we can resolve .010" without a problem.

Now there are some quirks with this as we have not considered the errors inherent to A/D conversion but won't worry about them for now.

So what would I do in your case? Personally I wouldn't screw with a uC (micro-controller) I would use as was originally mentioned. I would use a DATAQ Starter kit module and use the DI-158U for my data acquisition. Why? Because it is quick, versatile and above all easy to do. Additionally I can watch things in real time as well as record the entire test. Additionally I can dump the entire test into Excel and do whatever I please with the numbers.

After work today I set things up using 0 to 10 volts into a DI-158U using a few channels. I ran a recording and incremented the voltage up from 0 to 10 volts. I took screen shots and tomorrow I'll post what I have. I need to work up the images I took. I can even use the recorded file and DATAQ XL to create an Excel sheet. This took about an hour at best.

Tomorrow! :)
Ron
 
Thanks, I was considering DATAQ equipment. I have a DI-148U unit already. I saw that the DATAQ site also sold a activeX development package. It looks like it has output. I thought the activeX control package cost money, but it seems that it might be free, I'll try that out. I wonder if it allows you to output and capture at the same time.

Edit: I read a bit more on it and the 158U looks promising, 4 12 bit analog inputs, 2 12 bit analog outputs. If it is possible to write an application that uses them at the same time and converts the data this would be perfect.
 
Last edited:
Hi Paul

Nice thing about the DI-158 is that it is 12 bit but a real nice feature is that it has independent channels. This easily allows for bi polar inputs on any channel. Additionally a higher end version of it allows for programmable gain so the user isn't limited to +/- 10 volts. All in a simple USB package.

Originally I think the WINDAQ-XL software was free but it looks like they charge for that now. The SDK (Software Developers Kit) and their active X controls are free. I have used a third party active X called UltimaSerial with their stuff in VB (actually Visual Basic 6.0) with very good success.

Although the starter kit home page reflects Windos XP they do have drivers etc. for Windows Vista and Windows 7.

Since you have a little 8 channel DI-148 I would suggest you download the latest Windaq Lite software and drivers and set it up and mess with it a little.

I have used the modules with stuff I have written and used the modules with their software. I do not believe you can do both at the same time. This evening I'll work on the images I did and get them posted.

Ron
 
I have used the windaq lite software a little, it doesnt seem to allow you to do much with the outputs though. From what I've found it looks like it would be probably be worth the money to buy a higher end model. I downloaded the activex controls and they seem to be easy enough to bring up in VB, though I haven't found any options for controlling the analog outputs that come on the 158U and other higher end models, do you know if they have modules for that?

It occurs to me that even if they don't let you program for the analog outputs, though it seems like there must be a way, I could use the six digital outputs with an DAC to get 64 levels of output. Which though I need closer force monitoring than that, is decent enough for force control because the fact is that no matter how fine a signal I feed this pneumatic cylinder it isn't going to get very precise.

Thanks for the help.
 
Using the third party UltimaSerial opens a few doors. Something I keep forgetting to ask is what version of VB are you using? I am using VB 6.0, I do have VB.NET, actually have the full Visual Studio.NET 2008 but am not real great with it so I tend to still gravitate to VB 6.

I keep thinking there was maybe a way to use the DIO ports from within the Windaq software with a plugin. I just can't recall. Anyway, which version of VB are you working with?

I have some running to do tomorrow but later in the day I hope to mess around again with the 148 and 158 modules I have.

Ron
 
This project has come a long way. As before I have the cylinder set up for position feed back. Now I'm using a LabJack U3 and VB.NET because there was some good example code for it. I just started coding for the labjack and it seems pretty easy, I got it to capture the values from the analog inputs, and I don't think it will be too hard to make it output the control signal from the DAC ports. The main challenge I'm anticipating is that I need to scale the output, my PID requires 0 to 10 volts, and the manual for the U3 says "Each analog output can be set to a voltage between about 0.04 and 4.95 volts". I've never really made an op amp circuit, but from the sound of it a simple 2:1 op amp circuit would do the trick, right?
 
Hey, nice to see things are progressing well for you. Yes, my first shot would be using an operational amp and look for a gain of about two. That should work. You will have about 80 mV on the bottom but if that is OK you should be OK.

Ron
 
I have the amplifier working, and I'm on to writing the software. I'm working on the software still, no snags there. The load cell seems to have a hard time reading much compression. And since the force control depends on that, it limits the range. The load cell shows about 1.2v when unloaded, and it goes about 1 volt per 62 lbs of force. Stretched it can go up to 5 volts, or around 240 lbs, but in compression the lowest it goes is 0v which is about -66 lbs. I'm thinking I may need a different load cell, but I'm playing with different excitation voltages as well.
by the way, here's a picture of what I've built so far.
9944-fatigue testing machine.jpg
 
Hi Paul

I have the amplifier working, and I'm on to writing the software. I'm working on the software still, no snags there. The load cell seems to have a hard time reading much compression. And since the force control depends on that, it limits the range. The load cell shows about 1.2v when unloaded, and it goes about 1 volt per 62 lbs of force. Stretched it can go up to 5 volts, or around 240 lbs, but in compression the lowest it goes is 0v which is about -66 lbs. I'm thinking I may need a different load cell, but I'm playing with different excitation voltages as well.
by the way, here's a picture of what I've built so far.

Something is amiss here. I am guessing but is this the load cell you are using?

With 10 Volts of excitation that load cell has an output from the bridge of 3 mV/V so with a 100 pound load in compression or tension the output should range between -30 mV to +30 mV. If the link is in fact the load cell you have it should work fine for your application. The problems you are seeing could be a result of offset in your amplification of the mV signal output? Unloaded it should have right around 0 volts from the bridge. Measured between the white and green leads. Maybe I am missing something?

Very nice layout and build.

Ron
 
Yes, that's the one, interface SSM-100. I was just looking at the possibility that it is a problem with my power source or amplifier. For a starter I'm using a LJtick inamp with excitation (red and black) wired into Vref +,- and green and white wired into inA+ and inA-, which the lj tick amplifies and feeds into AIN0 and GND, which is just analog input 0 and ground of the labjack. I'm trying to locate a good stable 10 volt power supply since the labjack only outputs 5v. As for the amplification, I'll check the settings on the inamp and see if I made a mistake. For it to be stable would I need to connect the ground of the 10 v supply to the ground on the labjack? It seems like I will, but it never hurts to ask. So you said that at unloaded it should get 0 volts from the bridge, so is a load cell capable of going negative? I'll have to connect it to a different system and see how it behaves. Thanks!
 
OK at 5 Volt excitation as long as it is stable the bridge of your load cell will output -15 mV to +15 Mv which should be able to be amplified. This in turn gives you a single ended output from your load cell amplifier that you program for gain. With a gain of 201 you should get about 3.0 volts out for a 100 Lb load. I am not sure since -15 mV would be 0 volts out?

If you get this narrowed down to the load cell amplifier let me know. I have something I could send you that should get you through testing and provide a good visual indication of the actual loads. Then give you a nice analog output. No charge or anything. I am just curious. :)

Do you have any way to anchor the load cell and hang some known weights on it? Sort of dead weight testing and calibration. That would be a way to check tension anyway.

Ron
 
I currently have it set up based on this description from the manual for the amplifier im using, which I just noticed doesn't show negative in the range but "0-2.5"

"A common example would be a Wheatstone bridge made of 350 ohm strain gauges. If VREF/GND is used to provide the excitation voltage for the bridge, it will draw about 2.5/350 = 7 mA, and the common mode voltage (Vcm) of the differential signal will be about 1.25 volts. The outputs would be connected to IN+ and IN-. If Voffset is set to 1.25 volts and the gain is set to 201, the allowable input range for the LJTIA is –0.00616 to +0.00622 volts (with 0-2.5 volt output). "

I do have the gain set to 201. Apparently the LJtickInAmp only outputs positive:
Table of amplification ranges

Which is odd because the Labjack U3 HV site says: "4 HV Inputs have ±10 Volt or -10/+20 Volt Range."
At least it looks like I don't need to replace the labjack itself (over $100) I probably need to use something else to amplify the signal though. Thanks for the offer by the way, I'll let you know how the diagnosis progresses.

I do have some lab weights that I used to check the output, they're the kind with a rod and several discs that you can place on it, that's how I confirmed that it wont go negative with this setup and that the limit is about -66 lbs (compression). When the project is done I'm going to need it to go to +/- 200 pounds though, and I can't tell from the SSM100 loadcell datasheet if it is capable of that. It seems to be able to do it in tension, so it probably is just the electronics limiting it right now.
 
Before I forget I would venture a guess based on part number that you have a 100 Lb load cell. You may want to call the company. All my efforts tonight with their web page(s) I can't get into more data for the SSM series but, again, based on the part number I see it as a 100 Lb load cell. That is 100 Lb in tension or compression.

I did notice your amp should accept a differential bi polar input but only outputs a positive output.

That is really great that you have a slotted weight set. Just remember to consider the weight of the platen when using it.

I will venture 10:1 that your problem is in amplification.

Again, as I mentioned, if you feel you can use it I have a few meters I would be happy to loan you a unit. They also have an analog out 0 to 10 volts that is stable and take bridge inputs. Where I am if a unit fails I can't place a repaired unit (even though perfect) back in the production hardware environment. Thus I have a pile of good units I use for general testing as long as they never see the production environment again.

If you look back to my last post you will see what I believe for 5 volt excitation your bridge outputs should be.

Ron
 
It probably is a 100 lb load cell, because whatever I do with the amp the upper and lower limits are never more than 200lbs apart. For now I've solved the problem by switching load cells, I'm using a 500 lb load cell now because that's the only other one I had in the lab, it's rated 30mv at 500 lb with 10V excitation, or 3mv/V @ Full Load as some load cells note it. I have it working for the range I wanted now and I just need to make the adapters to fit the larger load cell into the machine. I may go back and change it to use a load cell that isn't so over-sized to make this cheaper, but for now the goal is to make it work soon.

It checks out with the calibrated weights. And yes, the plate hook is marked as 1 lb, since most of my weights are multiples of five except for a pair of 2lb ones and a 1lb, I just put both 2s on there and then add increments of 5. I'm not trained in electronics, but as an ME student I should know that hooks have mass :p

Thanks for the offer, but I actually have a few omega digital meters in my lab so it's not necessary.

Now to assemble with the new load cell then on to the next snag, whatever that may be. It should be mostly coding from here on out.
 
Keep me up on how this is going. This test system is really coming along nicely.

Ron
 
I appreciate your supportivness. The load cell is working well in the system, the last step (other than improving and fixing future errors) is to make the software in matlab, the professor who started this project wants it in matlab, I had the software partially figured out in VB, but you have to give the customer what they want. I haven't used matlab for a while, but labjack makes drivers for it, and it's pretty easy to use, so it should be fairly easy to get it making a drive signal for my machine and recording the displacement.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top