Thursday, 30 April 2015

Guiding error 4


I've just checked if there is any delay between sending the message to change the motor speed and the actual change. The delay is about 5 frames, which is around 0.3 second.

Grey bars shows the message to the motor, blue line shows the star position.

This explains why i had that sinus like movement of the star. I started the compensation too late, and also stopped it too late.

To solve this, it's not enough to check the star's position, but also need to check the movement of the star. If it's moving to the proper direction, the compensation should be smaller, if not, the compensation should be even bigger.



The blue line shows the star's position, the red line shows the position and also added the gradient of the movement. If the value of the position is increasing (like around 50 on the chart above), the red line is much higher, so we need more compensation. If the blue line is decreasing, the red line is lower, we need less compensation. 

The guiding is much smoother like this, but in same cases the maximum compensation is not enough, so that parameter should be increased, and the compensation should be more aggressive. 

Simple protocol

The protocol between the Raspberry Pi and the Arduino. Each message is 2 bytes, the first one ends with bit-0, the second one ends with bit-1. Using this messages the Pi can change the motor speed and send motor correction. Also there is a message for backlight, as it's set by the Arduino.

0x80 + data7        1 0 0 0  0 0 x 0  | x x x  x x x x  1  - Backlight

--------------------------------------------------------------------------------------------------
        
0x60 + data7        0 1 1 0  0 0 x 0  | x x x  x x x x  1  - RA SPEED  ( 8 bit ) 0 - 256              <- ok
0x60 + data7        0 1 1 0  0 1 x 0  | x x x  x x x x  1  - RA SPEED CORRECTION ( 8 bit ) 0 - 256

0x70 + data2        0 1 1 1  0 0 . 0  | . . .  . . x x  1  - RA/DEC default direction                 <- ok

0x50 + data1        0 1 0 1  0 0 . 0  | . . .  . . . x  1  - start/stop RA    start=1 stop=0          <- ok 

0x40 + data1        0 1 0 0  0 0 . 0  | . . .  . . . x  1  - stop correction  RA=1 DEC=0              <- ok
                                
0x00 + data12       0 0 x x  x x x 0  | x x x  x x x x  1  - steps  ( 0 - 4095 )
                                
--------------------------------------------------------------------------------------------------
                
0xC0 +              1 1 x d  m a a 0  | a x x x x x x 1    - Correction                               <- ok
                        | |  | | |      | 0 0 0 0 0 0      - DO NOW                                   <- ok
                        | |  | | |      | 1 1 1 1 1 1      - wait for steps in 0x00 message
                        | |  | | |      | . . . . . .      - use these steps (6 bit) 0..62            <- ok
                        | |  | | |      | 
                        | |  | --------------------------- - correction (3bit) = 0..7
                        | |  ----------------------------- - micro correction  micro=1, normal=0      <- ok
                        | -------------------------------- - direction 1,0                            <- ok
                        ---------------------------------- - RA=1 DEC=0                               <- ok

Wednesday, 22 April 2015

Still guiding errors...

I had been trying to get rid of this sinus like error, but i could not. I run a test with constant motor speed, and i found almost the same type of error, the RA value is going up and down periodically.


So, the next step will be checking the mount, maybe some bolts are too tight or something.. These kind of fast changes in the RA values can not be easily corrected on the software side.

The Moon



Thursday, 9 April 2015

First real picture with telescope

The picture is noisy because of the high iso and the wrong dark frames, but the guiding is getting much better. 4x60 sec exposure.



The chart about the guide error:



A chart about the RA error (not the same as above, but all the guiding parameters are exactly the same), and the moving average of the error:


It seems that the same sinus-like movement of the error is still present, but the amplitude is much smaller now. It's moving now between -1.5  to +1.5. If this error could be kept between -1.0 and 1.5, that would be really good.

Monday, 6 April 2015

Guide Error 2

I found some loose bolts on the mount, but after fixing that ones the guiding still showed the same problem i had before. I also tried to balance the mount, but i made the error still bigger.

The next thing i tried was correcting the guiding error less aggressive. Instead of modifying the rotation speed by 100% in case of a small difference, i tried much smaller modifications, like 10%. It seems this worked. The error became much smaller.


The blue line shows the error what i had last time, the red one shows the error I had this time. This is much better, but the value was jumping up and down each step. The reason of this that a too bright star was selected for guiding. 

Next steps are:
- make the corrections more smooth
- find the proper pre-set speed for the motor, so less corrections will be needed, and the error value will move around zero and not around 2-3, like now
- calculate the centroid of the star more precise and get rid of this up-and-down jumping 

But still, i managed to take a picture, which is not a complete disaster. ( 3x30' exp, iso 800 )



Saturday, 4 April 2015

Guiding Error

After trying the autoguider again with the telescope, the result was far from perfect.. 



I added some logs, an checked what went wrong. 


The blue line shows the position of the star, if everything's fine, that should be very close to zero. The red lines are the corrections sent to the motor ( either positive or negative correction, based on the position of the star), and where the red line is missing, it means the motor turns with the predefined speed.

So, the problem is that after the first correction is applied, it takes still like 20 more corrections, before the star 'turns back'. As there are 15 corrections per second, it means that it takes 1.5 sec, which is way too much. So, the star goes up and down from coordinate -4 to 6, which is 10 pixel difference.  

My first thought was the Arduino board, which is controlling the motor driver IC. The Arduino board gets the correction parameter from the Raspberry Pi via I2C. There is a timer interrupt in the Arduino in every 0.5 millisecond, where a counter is increased. If the counter reaches a value (that is the speed value), it makes the stepper motor to take one steps. 


line-01 shows the time spent in the interrupt,
line-03 and line-04 is the I2C communication,
line-06 show the time spent in the function where the speed is modified 
line-02 shows a step of the motor..

It seems everything is normal.. the PI sends the corrections to the Arduino in time, the correction is applied immediately, so it seems there is no problem here, and there must be something wrong with the mount.