ts-7000
[Top] [All Lists]

RE: [ts-7000] Re: TS-7400 ADC sampling rate

To: <>
Subject: RE: [ts-7000] Re: TS-7400 ADC sampling rate
From: Andrés Sebastián Nagy <>
Date: Tue, 23 Oct 2007 12:15:23 -0300
Hi.

    May be this help. If you cast the result to a short value (signed), you
will see that the value varies in a range from -25000 to +25000 aprox.
corresponding with the input values of:

0 v       ==> -25000    (really, -24500 +/-)
1.65 V    ==> 0
3.30 V    ==> +25000

Then, you can convert to any range, in a linear way (more or less), and
particulary to a range from 0 to 3.3 v. Eg. convert input [0 ; 3.3] volts to
a range of values from [-4000 ; 4000], center in 0.

#define DATA_MASK               0xFFFF

#define PLC_RANGO_TORQUE        8000
#define PLC_CENTRO_TORQUE       0

#define ADC_MAX                         +25000
#define ADC_MIN                 -24500

//.....//
unsigned long aux = PEEK32(m_adc_page + DATA_OFFSET) ;

//Signed
short muestra = (short)(aux & DATA_MASK);

*torque = (muestra * PLC_RANGO_TORQUE / (ADC_MAX - ADC_MIN)) +
PLC_CENTRO_TORQUE;


Hope this helps.

Atte.
Andrés Sebastián Nagy


-----Mensaje original-----
De:   nombre de
PeterElliot
Enviado el: Martes, 23 de Octubre de 2007 10:34 a.m.
Para: 
Asunto: [ts-7000] Re: TS-7400 ADC sampling rate


That should have been:

if (A2D<32000) Voltage = 1.5+((A2D*1.5)/24000);
else Voltage = ((A2D-42000)*1.5)/24000;

PJE

--- In  "PeterElliot" <> wrote:
>
>
> Hi,
>
> If you plot your data in Excel you will see that the data consists
> basically of two straight lines with a dicontinuity at 1.5V. (The
> data at 1.5V is odd as some samples were obviously above 1.5V and
> some below).
>
> The A/D reading is a line from 42000 at 0V up to 65535 at 1.5V and
> then a second line from 0 at just over 1.5V to 23350 at 3V. This
> gives a 24000 count swing over 1.5V either side of 1.5V.
>
> Therefore the A/D to (approximate) Voltage would be:
>
> if (A2D<32000) Voltage = (A2D*1.5)/24000;
> else Voltage = ((A2D-42000)*1.5)/24000;
>
> This may also be due to the resultant number being a signed value
and
> it being assigned to a non-signed integer...
>
> Also, if you're averaging, you need to average the voltage result
> from the sample and not the numeric A/D reading as this results in
a
> faulty average (in your data 1.5V has the same reading as 0.7V).
>
> Hope this is of help.
>
> Regards,
>
> PJE
>
> >
>
> --- In  "hunterofcow" <hunterofcow@> wrote:
> >
> > Did you ever find out about this problem? I cannot even get
> readings
> > correct at all. I believe i am using similar code to yours. The
> > voltage i am reading from a Multimeter, the average is what
> > read_channel outputs.
> >
> >
> > voltage average
> > 3.05 23365
> > 2.78 18837
> > 2.47 14122
> > 2.24 10411
> > 2 6932
> > 1.74 3282
> > 1.5 52125
> > 1.26 61799
> > 1.06 58913
> > 0.74 53904
> > 0.48 49962
> > 0.235 46070
> > 0.001 42415
> >
>





Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
    
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU