Jump to content


Photo

Telescope Drive Master - The Truth of the Matter

  • Please log in to reply
309 replies to this topic

#301 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5720
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 21 September 2012 - 01:09 PM

That's the thing Mert - interpolation works for some things (like the TDM) but not for others.

Also quadrature is already a form of (digital) interpolation. I do not think 4096X interpolation would give very good results.

Best to find an analog (voltage mode, not current mode) encoder like the Heidenhain, with 5000 tics, and built an analog interpolation module like the TDM folks did. You can find 5000 tic analog encoders on ebay for $200 range.

#302 Mert

Mert

    Skylab

  • *****
  • Posts: 4231
  • Joined: 31 Aug 2005
  • Loc: Spain, Pamplona

Posted 21 September 2012 - 01:53 PM

I was thinking of "up-scaling" the sin-wave to 0-5V and
use that in the Arduino ADC to get 1024 samples from 0-5V.
That would cover a half cycle or 2048 samples per cycle.
Each sample could generate a pulse maintaining quadrature
and then with a simple quadrature circuit x4.
At least this is what I was thinking for the moment! :shrug:

#303 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5720
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 22 September 2012 - 02:35 AM

You have given me an idea, thank you! I'm not sure the Arduino has enough processor power for that... but can the Arduino compute arc-tangents quickly? (I might try this, because I have a PIC32 which is a 32-bit Arduino compatible)

I get what you are thinking - use two A/D converter channels to get the 2 sinusoids. Now you have A and B, take the arc-tangent which then gives you the angle between the two encoder ticks.

You probably don't even need to up-sample to 0-5V, 0-1V is probably OK but the resolution is less.

I have calculated with a 5000-ppr encoder, if you do 256X interpolation (8-bit) that will give you 1280000 counts/rev, which is pretty close to 1" per rev.

Since the sidereal rate is 15.04" / second, with 1280000 counts/rev you will get basically one tick per second. Should be enough, since then you can do 1 correction per second.

#304 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5720
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 27 March 2013 - 01:14 PM

Since I last posted on this thread, I have built a prototype.

http://www.cloudynig...5756299/page...

it is half-working (I can measure the PE). I will add the ST4 correction this weekend.

#305 cn register 5

cn register 5

    Viking 1

  • -----
  • Posts: 760
  • Joined: 26 Dec 2012

Posted 27 March 2013 - 04:53 PM

You have given me an idea, thank you! I'm not sure the Arduino has enough processor power for that... but can the Arduino compute arc-tangents quickly?

A lookup table is a good way to do trig quickly, if you have the memory. You need tangents for 0 to 45 degrees, then do some jiggery pokery to get this to 360 degrees.

Chris

#306 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5720
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 27 March 2013 - 07:23 PM

already thought of that Chris... the Arduino only has 2K of RAM, so a lookup table is out.

The AVR math library can calculate an arc-tangent in 5700 clock cycles (!!) which is about 0.4 ms. That's what am doing..

#307 benula

benula

    Vostok 1

  • *****
  • Posts: 120
  • Joined: 27 Apr 2011
  • Loc: Stillwater, MN

Posted 27 March 2013 - 08:38 PM

If doing the calculations on the fly isn't fast enough, you could use a lookup table stored in SPI rom. This would work around the RAM limit and would only cost $1-2.

#308 saadabbasi

saadabbasi

    Apollo

  • -----
  • Posts: 1136
  • Joined: 23 Aug 2009
  • Loc: 29N

Posted 28 March 2013 - 12:40 AM

I don't know which Ardunio you're using but the Uno has an ATMega328 which has 1KB EEPROM built-in. You can also store the look up table in the 32KB flash using the PROGMEM keyword.

#309 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5720
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 28 March 2013 - 03:51 AM

Yes I could use the flash... But arc tangent works fine and consumes less than 1ms.

Here's my time budget so far...

1) reading the A, B, and N channels 16 times - takes 13-15 milliseconds

2) calculating the arc-tangent - takes <1 millisecond

I only aim to do corrections every 100ms (that's 10X per second) so as can be seen I still have lots of CPU time left over. Futzing around with the flash, SPI ROM, etc. is simply not worth it.

#310 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5720
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 29 March 2013 - 06:28 AM

Posted Image

Units in deci-arcseconds. So that's between 0.8" and 1.2" p-p and 0.23" RMS PE. On a CGEM. With the following parts count:

1x Arduino Uno
1x MCP3304 AD converter
1x ACPL 847 optocoupler
miscellaneous wires and a breadboard

1x Baumer-Sinus Thalheim ITD 42 encoder

The encoder is by far the most expensive component at over $700, but the equivalent Heidenhain ERN480-5000 is $325. All the other parts are probably less than $50.







Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics