Hi guys, So... I tried to understand the different options you've exposed here.
First I'd like to better qualify my needs. As Vasile explained, I can use different motors, with different power supplies. I consider 5V-24V to be a correct range for instance. In my current design, I took 12V as the maximum voltage. When a motor @12V runs at its max speed, it can produce back-emf up to (almost) 12V. When it's not running, well, that's 0V... The voltage divider I'm using make this 0-12V range fits into 0-5V. ADC is then used to read this range. When powered @5V, I loose a lot of resolution, thus information. Even more when such a voltage divider would be designed for power supply up to 24V... So, I was wondering if there were a way to use motors with 5-24V power supply range (24V is an example, it could be higher, but I guess it's quite a reasonable limit) and still keeping to maximum resolution while reading voltages. Here's what I understood. I apologize in advance for my advanced ignorance :) 1. Use several voltage dividers This implies PIC has inputs protected by internal diodes, so a high voltage (>5V) would not damage it. If this is not the case, Schotky diodes can be used. Then, several voltage dividers are designed, to cover the whole range. One divider could be used for max 9V, another for 12V, another for 24V. Each divider output (or middle) is read with an analog input. The more there are, the more resolution I have, the less pins I have... The software then goes like this: - read the more sensitive (no divider, expecting max 5V), - if range is closed to max resolution, read the next less sensitive - if value is within a given resolution range, consider the divider as to be kept/used. This test could be part of setting. Firmware could save the divider to use. 2. Use a "big" divider and several Op-amps A voltage divider is designed to handle the maximum voltage. In our case, 24V, so 38K/10K. The divider output (middle) is then connected to different Op-amps, each having a fixed gain value: 1, 2, 4. Each Op-amp output is read by an analog inputs. Op-amp with gain=1 could be skipped and divider directly connected to an analog input. But I understand that, using it, I can have high resistance values in the divider, yet having a low resistance from op-amp output, within PIC recommended value (10K, 2K5, ...). Why is it important to have high resistor values as voltage divider ? The magic here, which I still need to investigate, is whatever the voltage (5, 9, 12, 13, ..., 24), each Op-amp won't output more than 5V. Depending on the gain and the back-emf voltage, read values will cover more or less the full resolution range. For instance, if I understand (which I doubt), if the motor produces 22V: - after the voltage divider, I'll have 22 * (10/48) = 4.6V - Op-amp (gain=1) will output 4,6V - Op-amp (gain=2) will output 5V (kinda saturate) - Op-amp (gain=4) will output 5V (ditto) So, software should find the best range where values aren't closed to saturated ones. Do I completely misunderstand ?? 3. Drive a voltage shifter with PIC internal voltage reference output As exposed here: http://johannes.eventify.de/kiste-temp/Voltage_shifter.jpg, with some modifications about some resistors values and some resistors added for prevention in case of misconfigured pins, PIC internal Vref outputs between 0V and 2.5V and drives a transistor. This transistor controls the voltage going to the analog input, proportional to the Vref voltage. Even more "magic" here... The software should then find the proper Vref so voltage at analog input is closed to 5V. One analog input per motor is used, compared to previous options. Have I absolutely misunderstood this whole thing ?? TIA Cheers, Seb 2010/10/24 Sebastien Lelong <[email protected]> > hi guys, > thanks for the replis, just let me few days to understand and I'll get back > to you ;) > > cheers > seb > > -- > Sébastien Lelong > > Le 24 oct. 2010 à 11:03, vasile surducan <[email protected]> a écrit : > > > > On Sun, Oct 24, 2010 at 1:58 AM, Joep Suijs < <[email protected]> > [email protected]> wrote: > >> Hi Vasile, >> >> If this is the case, put in a voltage divider for motors up to 25V and >> you can cope with motors from 5 to 25V, right? >> > > right > :) > > >> Below 5V probably makes no sense. All 3V motor I've seen are so bad >> that I doubt you can do anything with back-EMF. >> >> Joep >> >> 2010/10/24 vasile surducan < <[email protected]>[email protected]>: >> > Hi Joep, >> > What I understood is that he want to use different motors and offer a >> > software pack which does not need hardware acknowledges for >> recalibration. >> > That's possible with a fixed divider and some software (ADC, software >> > controlled divider, programmable controlled current source or whatever). >> In >> > my opinion even an 8 bit ADC can do this trick, the problem is one motor >> > gives him 25V and the other 10V EMF... A hobby user take the motor from >> the >> > junkbox, one is 3V but supplied at 5V, one is 12v but supplied at 5V >> too. I >> > guess this is the problem he want to avoid. >> > Vasile >> > >> > On Sun, Oct 24, 2010 at 1:43 AM, Joep Suijs < <[email protected]> >> [email protected]> wrote: >> >> >> >> Hi All, Seb, >> >> >> >> What you state is that 10 bits of resolution are required for 5v >> >> motors (5mV steps). Is that right? >> >> When you create a 25V range, you end up with 25mV steps with 10bits. >> >> Is this realy to inaccurate? If I understand correct, back-EMF gives >> >> you the voltage proportional to the rotation speed of your motor. If >> >> you have a 5V motor at top speed, it will give you (almost) 5V. If you >> >> measure in 25mV steps, you get the motor speed in 200 steps (probably >> >> 100 steps forward speed and 100 backward). I would expect this >> >> measurement is more accurate than the methode itself? >> >> >> >> But if you realy do need this accuracy, you could take a 12bit adc and >> >> get 6mV steps over the whole range. So this is one way to go. I agree >> >> it is probably a bit more expensive, but probably easier and more >> >> stable than adding a few resistors, transistors and opamps. >> >> >> >> But an other way is combining multiple measurements. Your average >> >> signal is the motor speed, which changes slow compared to the adc >> >> speed. And since your signal is quite noise, you need more samples >> >> anyway. And more samples on a noisy signal mean more resolution. >> >> >> >> Bottom line: you might be solving a problem that does not make any >> >> (much) difference in a real life app... >> >> >> >> Joep >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> Groups >> >> "jallib" group. >> >> To post to this group, send email to <[email protected]> >> [email protected]. >> >> To unsubscribe from this group, send email to >> >> <jallib%[email protected]> >> [email protected]. >> >> For more options, visit this group at >> >> <http://groups.google.com/group/jallib?hl=en> >> http://groups.google.com/group/jallib?hl=en. >> >> >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "jallib" group. >> > To post to this group, send email to <[email protected]> >> [email protected]. >> > To unsubscribe from this group, send email to >> > <jallib%[email protected]> >> [email protected]. >> > For more options, visit this group at >> > <http://groups.google.com/group/jallib?hl=en> >> http://groups.google.com/group/jallib?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jallib" group. >> To post to this group, send email to <[email protected]> >> [email protected]. >> To unsubscribe from this group, send email to >> <jallib%[email protected]> >> [email protected]. >> For more options, visit this group at >> <http://groups.google.com/group/jallib?hl=en> >> http://groups.google.com/group/jallib?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/jallib?hl=en. > > -- Sébastien Lelong http://www.sirloon.net http://sirbot.org -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
