Chris Bott - Moderator Posted April 30, 2020 Author Share Posted April 30, 2020 Mine is with both tracks used. Calibrated at 2A. 0A at no load. It does look like we need an offset and a lower multiplier But If I add a +1 as here Amps = (((Atemp+LOOPS/2)/(LOOPS))+1)*(1.1/1023.0)*48*TrimA ; Then it reads 50mA with no load. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted April 30, 2020 Author Share Posted April 30, 2020 Peter try this. I'm sure we can get closer, iteratively but using this line has improved mine. Amps = ((Atemp+LOOPS/2)/(LOOPS))*((1.1/1023.0)+0.018)*2.75*TrimA ; Edit - See later post for a newer version Edited By Chris Bott - Moderator on 01/05/2020 12:42:36 Quote Link to comment Share on other sites More sharing options...
Mike Blandford Posted April 30, 2020 Share Posted April 30, 2020 I just tried your values in a spreadsheet. If I scale your readings by 0.95 and add 0.1, then your readings match the multimeter values almost exactly up to 3A. One solution might be to provide a "wetting voltage" to the analog input to bias the A2D. I would try something like reducing R1 form 10K to 2K2, then adding a 470K resistor between the "top" of R1 and VCC (3.3V). This would provide an A2D count of about 14 when no current is flowing. Then use: #define AOFFSET 14 Amps = (((Atemp+LOOPS/2)/(LOOPS))-AOFFSET+1)*(1.1/1023.0)*48*TrimA ; If you just add the offset as you suggest, try also testing for ((Atemp+LOOPS/2)/(LOOPS) being zero and set Amps to zero if it is, otherwise do the calculation. This would give a reading of zero when no current is flowing, but jump to 150mA to 200mA (correctly) when current is flowing. You just would not be able to measure a current of less than the offset value. From your data, I think you would need to add 2 rather than 1. Above 3A, since you say the tracks are getting warm, then you are seeing the track resistance increasing causing the wattmeter to read too high. Either declare the meter only reads to 3A, or you could try to compensate for the overreading in the software. The amount of heating is a square law (of course). Peter, I think you are correct, the A2D is starting from -200mA in effect. What I saw was the wattmeter value reading 0 when 200mA was still flowing. Mike Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 1, 2020 Author Share Posted May 1, 2020 Mike thanks again for your input. This morning I've been seeing what I can do just in the software. I led myself up a garden path last night. We (I) have to remember that due to the simplicity of the design, and that we're trying to keep volts drop right down, we're only using around 90 of the 1024 A/D steps. Only 60 if we Declare 3A max, which I'm inclined to do. I've come up with this line for amps. Almost the original with an offset added. Amps = (((Atemp+LOOPS/2)/(LOOPS))*((1.1/1023.0))*45*TrimA)+0.11 ; This tracks the multimeter much better but leaves a reading of 0.11A whenever no current is flowing. The reading does ahow 0.15A when multimeter says 0.149 and this is step 1 of the A/D. So I've changed the lines just after setting 2 decimal places to read: if (Amps <0.12) { Amps = 0; } Peter it would be really useful if you could try this. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 1, 2020 Author Share Posted May 1, 2020 An update on the new PCBs They are this far through production but it looks like the factory is closed for a holiday today. Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted May 1, 2020 Share Posted May 1, 2020 Chris, that is much better. A quick check gives 0.50A displayed at 0.5A 1.00A displayed at 1.0A & 1.56A displayed at 1.5A. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 1, 2020 Author Share Posted May 1, 2020 That's great news, thanks Peter. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 1, 2020 Author Share Posted May 1, 2020 The final adjustment (I hope). I've just changed my C2 to a1uF tant and I'm getting nice stable current readings even at partial throttle. The only thing I haven't addressed now, is the fact that all three of the Max/Min readings are now triggered by the Power being greater than previously recorded. This has the advantage of taking all three at the same moment and I think is actually what we're looking for, rather than recording separate Max amps, Max power and Min volts, as and when they occurr separately. A startup surge is still recorded, I did consider trying to miss that out. But it's real and the meter shows what's going on. If we want to miss it, we have to be gentler with the throttle. Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted May 2, 2020 Share Posted May 2, 2020 Chris, do you mean C1? C2 is on the voltage divider, so should filter voltage readings, rather than Amps? Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 2, 2020 Author Share Posted May 2, 2020 I do indeed mean C1. Thank you Peter, it's a good job someone is awake. Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted May 12, 2020 Share Posted May 12, 2020 Chris, (and anyone else with a working setup), I’ve just tried to use the wattmeter to measure the startup current & operating current (mostly no load) & cannot get much visible current. My setup uses a 4 cell NiMn Rx battery connected via a switch to both a servo driver and the IN side of the wattmeter. The servo under test is then connected to the Load side of the Wattmeter, plus servo signal output from the servo driver. Checked that I get no current with no servo connected & approx. 5v shown - thus not seeing the servo driver power. Interesting thing is that with HS81MG, CS239MG or HS225MG servos I get the same 220mA max current reading (sometimes zero) for all servos, but normal current stays at zero unless I really load the servo (goes up to a couple/three hundred mA with servo virtually stalled. Max current copies instantaneous if higher than previous Max. (as expected). My reading of this is thus either that modern servo currents are very low or, (probably likely to be a bit of both) that the current/voltage sampling rate is such that the peaks are short enough to be missed. As the device is intended to be used as a power train wattmeter, then the motor currents will be much longer term & easily caught by the sample rate. I’m just wondering if anyone else has noticed the same thing. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 13, 2020 Author Share Posted May 13, 2020 Hi Peter. I think, just from your results, that this is asking too much from our very simplistic design. Are you able to test with a multimeter for comparison? These came today Of course I'm out of Arduinos so ordered some to arrive last week. A parcel finally came yesterday but it contained an HDMI cable, so I'm now going through a returns procedure. I'll get the money back 14 days after they receive the cable back. (Why is nothing straightforward?) So more have been ordered and I'm at the mercy of the mail service, again. I'm just contemplating whether to retrieve a used one from a previous project. Can I guarantee it will still be a working one by the time I have it unsoldered? I'll ponder a little longer and let you know if/when I have any progress. Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted May 13, 2020 Share Posted May 13, 2020 Thanks Chris, Please don’t go to any trouble as I suspect the test is asking a bit too much of the wattmeter. I will have a look with a multimeter this evening. Quote Link to comment Share on other sites More sharing options...
Peter Balcombe Posted May 13, 2020 Share Posted May 13, 2020 Chris, just had a look with a digital multimeter & results are just as inconclusive. Might do better with an analogue meter, but still relies on the Needle to swing fast enough, eye to note movement & memory to record! That application needs more specialised kit I think.😏 Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 14, 2020 Author Share Posted May 14, 2020 Peter - thanks for the update. I'm hoping for a component delivery today so I can move this along. Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 14, 2020 Author Share Posted May 14, 2020 Good news then, the new PCB has been built up and works fine. All componets fit nicely and the extra physical support for the other end of the display board works really well. Quote Link to comment Share on other sites More sharing options...
Danny Fenton Posted May 14, 2020 Share Posted May 14, 2020 That looks ace Chris well done Cheers Danny Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 14, 2020 Author Share Posted May 14, 2020 Thanks Danny. Right - we now need to discuss kits of parts etc. I'd like to keep costs down as far as possible for everyone. I'm up to around £120 spent on development parts. I don't need to make that back or break even or anything but would like to make a dent in it at least. Which way would anyone interested like to go? I will list a set of part numbers available from bitsbox.co.uk. (There are plenty of other suppliers). As well as that list, builders will need PCB, 3d Printed case, 4 screws, flying leads to suit your batts/models. I could do pre-programmed arduinos, I could supply full kits, I could build fully tested units. So, my first stab at prices are these:- Complete, built and tested - £40 you'll still need to add flying leads - post at cost. Full kit - £30 - you'll still need screws and flying leads. - post at cost. PCB - £2 each + £1 postage (I've done that before) 3d Printed case - £10 - post at cost. Pre programmed arduino on it's own - £5 - post at cost. Obviously I'd combine post, not interested in profiting from that. I'm not keen on buying stock just in case I get an order, so all orders would be subject to a short delay while I get the parts. Here are the parts that can be had from bitsbox.co.uk Plus p&p I'm quite happy to be flexible, take suggestions, buy in the right flying leads if we can identify them and a suplier, etc etc. Edited By Chris Bott - Moderator on 23/05/2020 11:52:47 Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 19, 2020 Author Share Posted May 19, 2020 So with one kit, two cases and two PCB posted out and a fully built one on order I thought I'd better post how I finished the built one off. I think the pics are self explanatory. There's a little bit of "dressing" of the wires to do to make sure the PCB isn't lifted off its connectors. Some heatshrink has been added to try to afford a little strain relief and the case has been filed to accommodate the flying leads. Edited By Chris Bott - Moderator on 19/05/2020 15:48:22 Quote Link to comment Share on other sites More sharing options...
Dennis Mulhair Posted May 19, 2020 Share Posted May 19, 2020 Nice Chris! Dennis Quote Link to comment Share on other sites More sharing options...
Danny Fenton Posted May 19, 2020 Share Posted May 19, 2020 Lovely, I cannot wait to put mine into service Chris Cheers Danny Quote Link to comment Share on other sites More sharing options...
Phil Olson - Model Technics Posted May 20, 2020 Share Posted May 20, 2020 I'd certainly take a circuit board Chris Quote Link to comment Share on other sites More sharing options...
Chris Bott - Moderator Posted May 20, 2020 Author Share Posted May 20, 2020 Thanks everyone. Phil I'll send you a PM Quote Link to comment Share on other sites More sharing options...
Dennis Mulhair Posted May 23, 2020 Share Posted May 23, 2020 Hi Chris, Looking at the picture of the assembled circuit board I see you have the Tant 1UF (C2) capacitor in the position of C1. Is this correct? Also, you have the +ve leg of the capacitor connected to P1 terminal of the screen. Quote Link to comment Share on other sites More sharing options...
Dennis Mulhair Posted May 23, 2020 Share Posted May 23, 2020 Hi Chris, Just read throught the earlier pages and found the answers to my questions. Dennis Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.