Shop OBEX P1 Docs P2 Docs Learn Events
Precision current measurement - Page 2 — Parallax Forums

Precision current measurement

2

Comments

  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-10-13 08:23
    I've considered flexures, this type: http://www.flexpivots.com/ and bought a pair to play with. They are rather expensive and surprisingly stiff although for small angles (like my system should maintain) not too bad. I need 12 in total so a painful cost. Initially I was also put off by the fact you don't have an end to your shaft to mount something too however after looking at the Elektor article I am increasingly thinking I can go for a simpler feedback solution.

    I was using a 12bit absolute magnetic encoder which has a number of benefits but not really suited to use with the flexures. I'm thinking about two photodiodes side by side and a single led shining though a hole, movement of the hold would produce a differential signal I could use for feedback and would compensate for LED brightness variation etc.

    I also looked at tensioned cable designs for force balances but I wanted to avoid strain gauge type solutions as we have enough problems with our commercial balances that cost $$

    Noise from the robot may be an issue however I would hope it is much smaller than the aerodynamic forces or I am totally screwed. A flapping wing has all kinds of high frequency components but for things with small wings flapping fast (bees, hummingbirds etc) the body inertia is so high that it is not seen in movements of the body. In contrast to a large bird where you see significant body heave or a butterfly. My system should probably just respond to a low pass filtered version of the forces, but I kept thinking that if I blow on the thing it should move and started to worry about the minimum forces I could measure.

    I can play with the robot co-ordinates as I need to in the robot control software (define tool co-ordinates etc), otherwise the Linux box will do that.

    I'm increasingly thinking I have worried too much about resolution, when you stick a precision force measurement system on a writhing metal leviathan perhaps the ppm of a resistor are not the most significant issues :)

    Graham
  • LawsonLawson Posts: 870
    edited 2011-10-13 08:37
    I wouldn't buy flexures, they're simple enough you can just make them yourself. I'd also expect to have a hard time finding flexures small enough available commercially. Here and here have good down to earth info on flexures and how to design them. I'd also recommend the rest of the site as a good source of info on kinematic mounts.

    Lawson
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-10-13 10:19
    The flexures I showed go down to ~3mm in diameter. I've made flexures before and for some things it can be rather easy however I need rotary movement plus radial constraint and it needs to be accurate. The tube on the second video holding the magnets at each end was made by me to house the magnet of my rotary actuators, they are built rather like a slotless brushless motors and have an iron (mumetal actually) tube around them (also built like a galvo). This means that any slight lack of concentricity due to shoddy flexures will be punished :) Typical easy to make flexures for rotary also cause some slight translation and that would cause the mentioned problem I think.

    Looking at the smallest commercial flexure from above, the torque constant is 0.034Nm/degree. For my 12bit encoder I have 4096 levels so for a 5mm level on my actuator I would be talking 0.059g per level. It would just depend on how tightly my PID could hold the position. Of course a different angle measurement method might improve things. The LED method would give me X levels within a much smaller angle band.

    Decisions decisions

    Graham

    p.s. This is fun, thanks.
  • LawsonLawson Posts: 870
    edited 2011-10-13 15:49
    I'd go with the photo-diode position sensor too. (a double photo-diode, might be useful) 12-bits per revolution is rather course. I'd expect the quantization errors to add a ton of noise and with the large range of motion, inertia will kill your bandwidth. 12-bits in +-1 degree sounds like a much better target to me.

    How big of a bug will this flight simulator be for?

    Have you considered how to balance the force balance so that you only measure bug forces? (this can be done electronically if required. The precision will depend on the quality of the data/model used)

    Lawson
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-10-14 02:53
    One advantage of the encoder was that if I powered the coils the rotor would spin to a position at 90 degrees to it's operating point, it would then have been easy to set the servo to hold the position of the operating point. But I think the disadvantages of using normal ball bearings and the lack of resolution out weight that. Those dual diodes have different sized diodes in the package, I'll see if there is something else that is similar.

    If I ditch that I can go with either the flexures or the air bearings, either of which would offer a nice solution, the flexures are very simple and if they work should work forever, the air bearings don't need to be centred at the holding point of the servo and have almost no friction but could cause me problems in the future for maintenance, luckily the robot has air lines built in complete with valves so getting the air there is not too much of an issue.

    The "bug" will be 30g top end, the robot will allow us to fly things that would not normally fly so we can concentrate on issues like control and mechanism design. It can do this by having a different set point than zero force which is a function of the emulated mass and the current accelerations or it can emulate low gravity.

    As far as balancing, there are a few issues. The actuators are rotary for a reason, the long thin magnets have low inertia but also the coupling of inertial forces to them should be small as rotations will rarely occur around their centres. The structure that attaches to the actuators is extremely light weight and a small fraction of the mass of the MAV (micro air vehicle),

    We have not fully worked out the details but one way we are thinking about calibrating is to add an asymmetrical mass to the end of the sting before holding the force balance in various poses, this will allow us to fill the matrices that define how the measured forces are translated to force. We can also do some dynamic work where we shake a known mass using the robot.

    Graham
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-10-14 06:52
    I found that osram do some differential photo-diodes with equally sized diodes and one application I have found it measuring seismic activity so it looks like a winner. I'm going to set about designing a circuit consisting of a pair of transimpedance amps followed by a differential amp which can then be ADC'd ready for the propeller.

    Edit: Seems I can put the two photodiodes in parallel but with opposite bias and just look at the current through them needing only a single amp.

    Graham
  • LawsonLawson Posts: 870
    edited 2011-10-14 09:26
    Edit: Seems I can put the two photodiodes in parallel but with opposite bias and just look at the current through them needing only a single amp.

    Or you could run the photo-diodes in series with a single transpedance amp holding the mid-point at half the total bias voltage. This will give faster amplifier response because the reverse bias will reduce the photo-diode capacitance. In both cases, working directly with the difference in photo-current should reduce the noise.

    When you do get this force balance designed, I'd love to see some pictures of it.

    Lawson
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-10-14 11:09
    Don't worry, you will. One thing is for sure, it will look extremely cool (even if it doesn't work). I want to publish it because some aspects are quite novel so don't want to plaster the thread with images just yet.

    I realised a rather obvious thing, in the elecktor article his lever arm with the photo paddle on the end of it is extremely long. I think he can get away with much more than me. I will make mine as long as possible but will definitely be limited so will have to take more care.

    Graham
  • LawsonLawson Posts: 870
    edited 2011-10-15 13:36
    Another quick thought. Hard drive read-head arms are a light and fast galvo-motor system similar to what I think you're bug force balance will use. The hard-drive controller uses the track structure of the magnetic disk for head position feedback so you'd need a replacement position sensor. They use ball bearing pivots. I also suspect your local IT department has a fair stock of dead drives to experiment with.

    Lawson
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-10-15 14:30
    I did consider them but as moving coil actuators they are not great torque wise and the lack of heat sinking on the coils limits the power I can stick in them. But the real killer is the inertia as the robot will be moving the balance around it is important that the component of force the servo loop has to compensate due to the moving mass is as small as possible.

    For this reason I am using a long thin magnet rotor, long to get a decent amount of magnetic material and thin to try and reduce the moment of inertia. The result is a lot of torque for a low inertia. I basically ended up reinventing the mirror scanning galvo. I asked a galvo company about my idea and they said they sold the tech to do force measurement to another company, they use it to measure muscle twitches in research but $$$$ for one axis.

    Graham
  • LawsonLawson Posts: 870
    edited 2011-10-15 22:02
    I did consider them but as moving coil actuators they are not great torque wise and the lack of heat sinking on the coils limits the power I can stick in them. But the real killer is the inertia as the robot will be moving the balance around it is important that the component of force the servo loop has to compensate due to the moving mass is as small as possible.

    Hard drive head motors aren't as wimpy as you think. The pretty easily generate a newton level forces at the read heads on 5v DC. 5VDC also results in a safe continuous power level for 3.5 inch drives. The Lidar I work on has used a few as shutters and beam blocks where we need a spring return for safety. I'm pretty sure hard drive head motors are nearly as fast as optical galvos. Just consider the kind of moves they make, less than 10ms to cross half a platter (~15mm) and settle to sub um resolution. (napkin calcs put the precision for a 1TB 2 platter 3.5" drive better than 150nm!) They sound pretty good as speakers too.

    Lawson
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-10-16 07:04
    I've used them as well and from my recollections a Newton is a possibly a little hopeful for dc force output but perhaps my hands are not as well calibrated as I imagine and besides it does depend on the moment. The main reason for not persuing them was the inertial aspect, not in terms of their ability to overcome it but rather the effect on the measurement due to movement of the robot. I considered making a sort of bow tie configuration from the coils so they are at least balanced but still the moments are considerable. I got as far as asking our it department for any old laptop drives but it seems they destroy them for data protection reasons.

    However I think if my current actuator design doesn't work out and I get desperate I'll investigate seriously.

    The bearing modules are certainly nice, I have about 30 of them from the days when I wanted to use the spindle motors to make brushless motors for models.

    Graham
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-04-26 08:48
    Hi Guys,

    You probably thought I abandoned this project but in fact I have been working hard on it. I managed to make a working actuator and have completed all the mechanical design after some extensive Matlab simulation (and a personal tragedy last year) a lot of the parts are made but I am waiting for some parts to come back from being wire EDM cut.

    So I am returning to the electronic design, while looking at DACs for doing the current control (to recap the idea is for a DAC to drive a voltage controlled current source) I came across the AD5446 which is included in this app note covering precision current sources:

    http://www.analog.com/static/imported-files/circuit_notes/CN0151.pdf

    The op-amp used is an OP1177 and it is used with a +/-15v supply. My first question is, do I really need to use a dual rail supply and secondly does it need to be +/-15v and if so what is the usual way to produce such a supply? The current precision comes from the sense resistor which will be a 0.5ohm Vishay film job and also the voltage reference, the reference effects the range and I am looking at a ADR130 which can be set to give 0.5v. On that basis I assume the 15v can be somewhat rough and ready.

    Cheers,

    Graham
  • RinksCustomsRinksCustoms Posts: 531
    edited 2012-04-26 17:43
    .. Might seem like a lazy response, but why not current sense off the power supply to the actuator, somewhere between the power element and filtering caps? 1 or 0.5 ohm through hole type and sigma/Delta?

    I'm from the old school of thought where Keep It Simple Stupid applies whenever possible. Look @ Albert Einstein's best work; E=MC2. So simple and elegant it has to be true.
  • T ChapT Chap Posts: 4,223
    edited 2012-04-26 19:19
    I don't recall reading what the purpose of getting the current was in your case so this could be useless info. I use a BLDC motor and designed a driver for it that requires very sensitive current readings for purposes of faulting out the system if the current exceeds a threshold, the threshold is dynamic, as the motor ramps up and down, and requires the threshold to track the speed(PWM). I use an AD628 the sense the current, which is a programmable gain amp. I chose the device after speaking to AD to determine which of their devices would best suit this need of a high precision programmable gain output.

    http://www.analog.com/en/specialty-amplifiers/current-sense-amplifiers/ad628/products/product.html

    I put it on the 24VDC input to the driver, 1ohm 4w TH res. I never use SMT for sensing, wattage limitations, and ease of replacement if needed. There is also a .1ohm on the 3 low side mosfets which is used in the driver IC adjustable current limiting circuit. The problem use to be that temperature changes were affecting the thresholds. I needed the threshold to be consistent year round, so I added an I2C temp IC MAX6634

    http://www.maxim-ic.com/datasheet/index.mvp/id/3074

    I take the raw binary temperature and multiply it by a bias factor, then subtract that value from the threshold value that feeds a duty mode Prop DAC, which feeds one side of an LM393. The AD628 feeds the other side of the comp. It is fairly easy to set the room at a cold temperature, the turn on the heat and take some measurements. With a little spreadsheet work, it is easy to come up with a bias value to multiply times the raw binary temp output, and arrive at a tempbias factor that really stabilizes the threshold levels over a range of temps(25F range in my case). This method allows the temperature of the board to fluctuate with no substantial effect on the net effect of the current sensor output. The driver is rarely on, and is only used sporadically, so the 1ohm it typically not heating up enough to be of concern in the math.

    One very slow technique for determining current levels relative to the Prop DAC, is to ramp the frqa up feeding the comparator, detect the trip point relative to the frqa level. This would be slow detection. I also have never determined what resolution was inherent in the concept, but consider that 0 - 3.3V is frqa = 0 to $ffff_ffff. THe AD628output is scaled so that its working output range is 0 - 3V.
  • LawsonLawson Posts: 870
    edited 2012-04-26 21:08
    Hi Guys,

    You probably thought I abandoned this project but in fact I have been working hard on it. I managed to make a working actuator and have completed all the mechanical design after some extensive Matlab simulation (and a personal tragedy last year) a lot of the parts are made but I am waiting for some parts to come back from being wire EDM cut.

    So I am returning to the electronic design, while looking at DACs for doing the current control (to recap the idea is for a DAC to drive a voltage controlled current source) I came across the AD5446 which is included in this app note covering precision current sources:

    http://www.analog.com/static/imported-files/circuit_notes/CN0151.pdf

    The op-amp used is an OP1177 and it is used with a +/-15v supply. My first question is, do I really need to use a dual rail supply and secondly does it need to be +/-15v and if so what is the usual way to produce such a supply? The current precision comes from the sense resistor which will be a 0.5ohm Vishay film job and also the voltage reference, the reference effects the range and I am looking at a ADR130 which can be set to give 0.5v. On that basis I assume the 15v can be somewhat rough and ready.

    Cheers,

    Graham

    The OP1177 looks like it'd be perfectly happy on +-5v rails. It will require a bi-polar power supply and extra voltage headroom because it's input's have to stay ~1.5v from each rail and the output will only get within 1v of each power rail. (input voltage range, and output high/low specs) The other reason for the +15v power supply could be the output FET. Though the FET suggested looks like it's happy with only 2.6Vgs. So +-5v rails should work fine.

    For the negative voltage I'd use 102-1709-ND configured as shown on pages 5-6 of the datasheet. These regulators are fairly quiet and support 2 way power flow if needed. Still, for best precision I'd group all switching supplies and surround them with LC filters on the inputs and outputs. (on the ground connection too, to keep it symmetrical) Btw most isolated and flyback DC-DC converters are noisy. Avoid them if you can and be prepared to surround them with filters.

    Marty
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-04-27 02:59
    To RinkCustoms and TChap,

    In the end I decided to avoid measuring the current and instead to generate it linearly (as per the German article posted above) because if I control the current via PWM and try to measure it noise will effect measurements (yes I can filter but each component in the filter can generate noise too), this is a high precision application and so I am trying to get the best performance possible. Temperature compensation is not required with my proposed method because the feedback resistor will be one of these awsome Vishay film resistors with 2ppm at $15 a pop.

    Marty,

    That module looks excellent, come to think of it I think I have seen similar in the past. Do you think a single rail op-amp could be used? It just seems as if a dual rail op-amp adds a complication and you don't need a negative swing to turn the op-amp off.

    Thanks,

    Graham
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-04-27 06:02
    In the end I decided to avoid measuring the current and instead to generate it linearly

    Sorry to hear about your tragedy, I did notice you were quiet lately.

    Are you going to give up on measuring? I've been following since post 1 hoping for a board or a schematic at the end. Maybe feedback for robot actuator control. I thought you were getting close, I would be bummed if you determine its not feasible.
  • T ChapT Chap Posts: 4,223
    edited 2012-04-27 06:22
    Graham, are you suggesting that with the 15$ resistor, that no temperature compensation would be required on my board to maintain consistent readings? Even if the resistor is heating up do to the motor running? I am using a 4w 1ohm TH. I will see if they offer this, that would be convenient, to drop the code for tracking and temp biasing.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-04-27 07:48
    Prof,

    Thanks, I gave up in the sense that I found a better solution to my problem. My circuit must do more than just measure a DC current, it must also control the power/voltage to actuator and know as accurately as possible what the current is. The first plan was to:

    1. Control power with PWM (I would not know the power but it would be proportional to the output of my PID)
    2. Measure the current by filtering the PWM and then using a resistor and ADC.

    The new solution is:

    Control the power by outputting a digital number to a DAC which controls a voltage controlled current source. Of course this circuit does has a feedback/measurement element and you could digitize that but I don't need to because I already told it what to be.

    If you just want to measure current and that current does not have a load of modulation on it then you can just use a current sense and an ADC, if the ADC has a load of bits you may not need an amp which can be another source of noise.


    T Chap,

    Have a look back through the thread and I link to some videos, the guy from Vishay has a circuit with two of those resistors in it and he freezes one and blow torches the other and the output barely changes!!!
    You could put the resistors in parallel if the power ratings are not good enough.

    Graham
  • T ChapT Chap Posts: 4,223
    edited 2012-04-27 08:46
    The Vishay part is a very nice find. Just got off the phone with app support at Vishay Foil department, I will be swapping out my current resistor for their 8w VPR220.

    Thanks for posting this info guys.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-04-27 08:48
    Fantastic, this is the sort of thing that makes me love this forum, such a wide range of knowledge and experience lurks here.

    Graham
  • LawsonLawson Posts: 870
    edited 2012-04-27 09:38
    Marty,

    That module looks excellent, come to think of it I think I have seen similar in the past. Do you think a single rail op-amp could be used? It just seems as if a dual rail op-amp adds a complication and you don't need a negative swing to turn the op-amp off.

    Thanks,

    Graham

    Going with a single rail op-amp might work. You would need an op-amp with a rail-rail output and an input common mode range that includes the negative supply voltage. Even then, performance with outputs within 100 mV of the power supply rails could be iffy. I currently like the OPA365 for 5v rail-rail applications, but I think it's a bad fit in this case. Too much offset voltage, more speed than required, and a bit more voltage noise than the OP1177. Looking for the keywords "Copper stabilized" and "rail to rail" should find the right op-amp quickly. Make sure you also check the input bias current, that can get rather high on op-amps with high DC accuracy.

    Lawson
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-04-27 09:43
    And this is perhaps the crux of the problem, to my shame and despite a degree in Electronics I barely understand the ramifications of the various parameters associated with op-amps!

    I should probably have sat down with TAOE before thinking about any of this!

    Graham
  • LawsonLawson Posts: 870
    edited 2012-04-27 11:03
    And this is perhaps the crux of the problem, to my shame and despite a degree in Electronics I barely understand the ramifications of the various parameters associated with op-amps!

    I should probably have sat down with TAOE before thinking about any of this!

    Graham

    Heh, I've two degrees in Mechanical Engineering so I should be worse off than you! Most of this info I learned myself after I decided to make amplified photo-diodes for lab work. The circuit required is dead simple, but it's one of those circuits where the little details matter a lot. After 3-4 design generations, and lots of datasheet/app-note reading, I have a far better grasp of the details of op-amps.

    Back to your application. The app-note you're basing your design on used an OP1177 op-amp for a reason, I'd use it's specifications as a starting point for a single-supply or rail-rail op-amp. Single-supply op-amps usually work with inputs near ground, and outputs just above ground but not always as any op-amp can be operated single supply if the inputs and outputs are kept at valid voltages.

    Lawson
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-04-27 12:42
    Funnily enough some photodiode amps is my next job!

    I'll do some reading. No good just sitting around feeling bad about it!

    Cheers,

    Graham
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-04-27 12:48
    Graham,

    The current source circuit should work fine with a precision single supply op-amp. My favorite is the LTC1051. The output of the op-amp does not even have to swing all that close to Vss. It has to swing over a range from the transistor threshold up to that plus Imax * 0.5Ω. I see that the GBW of the OP1177 is 1.2 MHz, and the LTC1051, 2.5MHz. A little extra won't hurt, and it isn't a big factor in the circuit anyway, operating as it does near unity gain. The OP1177 has a higher offset but lower noise than the LTC1051 but with either you are talking microvolts. One microvolt error across 0.5Ω is 2 µA error in current.
  • T ChapT Chap Posts: 4,223
    edited 2012-05-01 17:09
    Here is an update on the Vishay Precision Foil. I got in a few VPR221 1.0ohm 8 watt resistors. The mil spec for 8 watts requires a pretty large heat sink. Open air is 1.5watts. I hacked together a crude method to mount the 4 pin device which has a little bit of heat sinking with the copper board. The pins don't fit the pads for the large resistor it is replacing, bending them to fit was precarious. I created a board with 4 pins that go to the original (2 sets) resistor pads. This device has Kelvin connections which I didn't bother with for now, as it would require cutting traces to patch into the difference amp to the 2 center leads. It is supposed to be more precise, I will do it on future PCB revisions.

    I use an AD628 difference amp to monitor the current, the gain is programmed to swing from 0 to ~3V to a comparator. At room temperature, the voltage from the amp sits at .293V. I put a heat gun near the board aimed at the resistor for 30 seconds, wires were baking and smoke was coming off the board. The voltage dropped to .209.

    I then tested the original 4w 1ohm with the same test. Room temperature idle output was .291V. Fully baked was .171V.

    I was not able to reproduce the results in the video posted in the thread where there was no obvious change. Then again, they were heating just the Vishay part. I am heating at least half the board, which could be having an effect. The results in this case show that the Vishay dropped the voltage from the amp from .292 - .209 = .084. The original 4w wirewound non inductive resister dropped from .291 - .171 = .120.

    I think I
    640 x 478 - 134K
  • jmgjmg Posts: 15,183
    edited 2012-05-01 17:54
    T Chap wrote: »
    At room temperature, the voltage from the amp sits at .293V. I put a heat gun near the board aimed at the resistor for 30 seconds, wires were baking and smoke was coming off the board. The voltage dropped to .209.

    Wow, that is a primitive and brutal sounding test :) 'Tune for maximum smoke' ;)

    The Vishay data says appx parabolic Tempco, and under 200ppm for 125'C Max spec.

    That 200ppm is going to give 0.292941V, from 0.293, but the parabola suggests it will get worse quickly at 200-300'C,
    but why test there ?
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-05-02 02:23
    Not bad considering your circuit was on fire :)
Sign In or Register to comment.