Index: /trunk/MagicSoft/Cosy/Changelog
===================================================================
--- /trunk/MagicSoft/Cosy/Changelog	(revision 1674)
+++ /trunk/MagicSoft/Cosy/Changelog	(revision 1675)
@@ -1,3 +1,11 @@
                                                                   -*-*- END -*-*-
+ 2002/11/12 - Thomas Bretz (LaPalma):
+
+    * aposs/Manual.m:
+      - fixed a bug which caused the drive to shake in case is was
+        switched on again after an emergency switch off
+
+
+ 
  2002/09/24 - Thomas Bretz (LaPalma):
 
Index: /trunk/MagicSoft/Cosy/aposs/Manual.m
===================================================================
--- /trunk/MagicSoft/Cosy/aposs/Manual.m	(revision 1674)
+++ /trunk/MagicSoft/Cosy/aposs/Manual.m	(revision 1675)
@@ -4,7 +4,11 @@
 /*                                                                         */
 kVERSION    = 0   /*                                                       */
-kSUBVERSION = 1   /*                                                       */
+kSUBVERSION = 2   /*                                                       */
 /*                                                                         */
 /*  HISTORY:                                                               */
+/*                                                                         */
+/*   * V0.2:                                                               */
+/*       - fixed a bug, shaking the telescope switching on again after an  */
+/*         emergency stop                                                  */
 /*                                                                         */
 /*   * V0.1:                                                               */
@@ -74,5 +78,5 @@
 SET VELMAX     3000          /* Motor: Maximum revolutions per minute      */
 SET POSERR     1500          /* Maximum tolarable Position error (qc) 0.1° */
-SET RAMPMIN   10000         /* Shortest Ramp 10s                          */
+SET RAMPMIN   10000          /* Shortest Ramp 10s                          */
 
 /*----------------*/
@@ -148,21 +152,22 @@
 /*-------------------------------------------------------------------------*/
 if (get cannr==1) or (get cannr==3) then
-   cvel 0
-   cstart
    print "Starting..."             
 else          
+   /*motor off /* switch off motor controlling: No 'Schleppfehler' */
    print "Synchronizing..."             
+   motor on
    syncv
-endif
-          
+endif      
+         
 mainloop:       
    fuse  = in (kIoModule+1)
    emcy  = in (kIoModule+2)
    vltg  = in (kIoModule+3)
-   mode  = in (kIoModule+4)
+   mode  = in (kIoModule+4)   
+   
    if (get cannr==1) or (get cannr==2) then
        ready = in 1
    elseif get cannr==3 then
-      ready = in (kIoModule+5)
+       ready = in (kIoModule+5)
    endif   
        
@@ -190,8 +195,8 @@
       print "DKC not ready... setting RF=AH=0!"
       out 1 0
-      out 2 0
-      cvel 0   
-      RF = 0           
-      waitt 1000       
+      out 2 0   
+      RF = 0
+      motor off
+      waitt 1000
       goto mainloop    
    elseif (ready==1) and (RF==0) then
@@ -200,15 +205,18 @@
        * After switching on power wait at least 300ms until
        * control changed state 'bb' to 'ab'
-       */   
-      cvel 0
+       */
+      cvel 0 
       waitt 300
       out 1 0
       out 2 0
-      waitt 100
-      def origin
+      motor off      
+      waitt 100 
       out 1 1
       out 2 1                                 
       RF = 1
       waitt 100
+      motor on
+      cstart
+      /*waitt 100*/
    elseif (ready==0) or (RF==0) then
       goto mainloop
@@ -216,6 +224,6 @@
 /*       
    if (get cannr==2) then
-      print "M:", mapos, " ", mavel, "  S: ", apos, " ", avel, "  C:", cpos 
-      waitt 500      
+      print apos, " ", mapos, "  ", avel," ", mavel
+      waitt 500
       goto mainloop
    endif       
