Search:

Type: Posts; User: curious_mind

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    0
    Views
    172

    Closed: dSPIC Blockset Simulink

    Has anybody worked using dSPIC blockset in simulink and in particular with custom C code?
  2. Replies
    16
    Views
    942

    [SOLVED]Closed: Re: fixed point arithmetic in c

    fixed point multiplication issue is resolved. Thanks for all help
  3. Replies
    16
    Views
    942

    [SOLVED]Closed: Re: fixed point arithmetic in c

    Q1.15 range is -1.0 to +1.0 , -32768 to 32767, in hex it is 0x8000-0xffff for negative range and 0x0000-0x7fff for positive range, so 65535 is around -1. So I guess it is the valid range.
  4. Replies
    16
    Views
    942

    [SOLVED]Closed: Re: fixed point arithmetic in c

    I used the following code

    a=23166, b=65535;

    long result,a,b;

    result =(a*b)>>15;
  5. Replies
    16
    Views
    942

    [SOLVED]Closed: Re: fixed point arithmetic in c

    Stuck with basics operations again in Q1.15 multiplication. What should be the result of multiplication of 23166 (0.707) and 65535 (0.0), the result is 46332 and not 65535. Could it be clarified? It...
  6. Replies
    22
    Views
    876

    Closed: Re: sine/cos encoder to digital

    Hi FvM

    The data was captured during running conditions, and I analyzed the data. The distortion of signal vanished, however the angle data points are not equidistant as previously posted. This...
  7. Replies
    22
    Views
    876

    Closed: Re: sine/cos encoder to digital

    please suggest a workaround
  8. Replies
    22
    Views
    876

    Closed: Re: sine/cos encoder to digital

    Hi FvM

    How did you conclude about the superimposed ripple and how do we remove it. I am unable to make it out. I tried FFT of the two waveforms and it did not show any other component except 1Hz
  9. Replies
    22
    Views
    876

    Closed: Re: sine/cos encoder to digital

    Hi FVM

    Sampled the same signals at 10kHz. Please see the results(attached) . What should we conclude?
  10. Replies
    22
    Views
    876

    Closed: Re: sine/cos encoder to digital

    Hi FvM

    Just tried atan including quadrant detection. I find the readings of angle non monotonic. excel file attached
  11. Replies
    22
    Views
    876

    Closed: Re: sine/cos encoder to digital

    Hi KlausST

    How do we deal with infinity (cos90 or cos270)? Secondly I have to also consider time resolution of the incoming data. Input shaft rotates art low rpm (0-60 rpm) for the highest rpm,...
  12. Replies
    22
    Views
    876

    Closed: sine/cos encoder to digital

    I have sine cos data from encoder and have to convert it to digital corresponding to angle and estimate the velocity as well. I need to do this using MCU. any proven methods?
  13. Replies
    20
    Views
    956

    Closed: Re: Where does this equation come from?

    Hi FvM.

    It is clear now. It works fine now
  14. Replies
    20
    Views
    956

    Closed: Re: Where does this equation come from?

    Added the printf in for loop: printf("p,q,accumulator data %d\t%d\t%f\n",(int)p,(int)q,(double)((acc*180.0)/65535));

    results are recorded below. The q value does not change sign and hence wrong...
  15. Replies
    20
    Views
    956

    Closed: Re: Where does this equation come from?

    Hi FvM,

    No change in the result by changing the datatype
  16. Replies
    20
    Views
    956

    Closed: Re: Where does this equation come from?

    I tried implementing fixed point C code. I am getting wrong answer. What could be the problem. Answer is 0x4279 instead of 0x4000

    int atan_cordic_atan_fixed(int x, int y);
    int add(long int a ,...
  17. Replies
    20
    Views
    956

    Closed: Re: Where does this equation come from?

    Can I get sample C code for 16 bit fixed point cordic, which is understandable?
  18. Replies
    20
    Views
    956

    Closed: Re: Where does this equation come from?

    thanks. I tried it and verified through sample c code. It works. I have one last clarification. Why cordic is restricted to -pi/2 to pi/2.
  19. Replies
    20
    Views
    956

    Closed: Re: Where does this equation come from?

    hi

    I do not actually get how yi becomes negative in the first quadrant? ( let us say original angle to be estimated is 30 degrees). If I do conventional calculations with cosphi and sinphi, I get...
  20. Replies
    20
    Views
    956

    Closed: Where does this equation come from?

    I was referring to this article http://ww1.microchip.com/downloads/en/appnotes/01061a.pdf to understand cordic to implement atan function.
    After a struggle, concept is just sinking into my brain. At...
  21. Replies
    16
    Views
    942

    [SOLVED]Closed: Re: fixed point arithmetic in c

    I came up with the following custom c code. Your view on this will be helpful


    unsigned int add (unsigned int a ,unsigned int b)
    {
    unsigned int res;
    unsigned long tmp;
    tmp=a+b;...
  22. Replies
    16
    Views
    942

    [SOLVED]Closed: Re: fixed point arithmetic in c

    Hi

    I am considering 2's complement unsigned data that varies from 0 to 65535. What would happen if I would add 10 with 32767. The result is a negative number. How would I guard this?
  23. Replies
    16
    Views
    942

    [SOLVED]Closed: Re: fixed point arithmetic in c

    how to take care of oveflow for addition and subtraction? c should be short or long?
  24. Replies
    16
    Views
    942

    [SOLVED]Closed: fixed point arithmetic in c

    I am looking for a C code to perform Q15 addition, subtraction, multiplication, division , sine(x) and cosine(x). Can anybody provide good reference that works?
  25. Replies
    6
    Views
    486

    Closed: Re: power supply residual voltage

    I could kind of solve this issue a bit. I just connected the power supply chassis ground to protective earth and I could get a criteria-A performance for 4kV surges. However, arduino resets for EFT...
Results 1 to 25 of 49
Page 1 of 2 1 2