ALFA turret motor
10sep08
Hardware:
Downstairs:
- The alfa_motor program runs on the aeroncpu. Ittalks to the
motor amplifier on /dev/ttyS0 (the other rs232 line is for alfa
dewar monitoring).
- The rs232 line goes to the fiber transciever in the fiber
optic rack next to the pnting crate (about the middle of
the rack) and then up to the alfa motor box in the turret room.
Upstairs:
- The alfa motor controller is in a huffman box next to alfa on
the rotary floor.
- A remote/local switch allows local only or remote access to
the controller. For things to work downstairs it must be in
remote.
- Power dips/emg stop, autorest:
- a power dip or pushing the emgoff button down then pulling
it back up requires a reset of the system.
- There is an autoreset switch on top of the huffman box. If
it is in autoreset then any power dip or emgOff button
push/pull will be automatically reset. This saves us from
having to go up to the dome every time we have a power dip. If
this is not in autoreset then you have to push the reset
light/button till it goes off.
- The red light/button on top of the huffman box comes on when
a reset is needed. To perform the reset, make sure the emgoff
button is pulled up and then push the red light and make sure
it goes off.
- Normal configuration for operation:
- emgStop button is pulled up.
- autoreset switch is in auto
- remote local switch is in remote.
- Cycling the power on the motor controller.
- open the huffman box.
- switch down the red breaker next to the motor controller.
The led on the motor controller should go off.
- pull the breaker back up to turn the system on. The led
should be lit.
- The encoder.
- We have encoder type 9 (menctype=9) this is an endat
encoder.
- Documentation:
- sinEncfdBack (see below)
- page 7 C2 connector pinouts.
- Page 6 system fault codes.
- Explains the r8 a/b out of range and how to debug it.
Software
Communications
program:
alfa_motor.c
- runs on aeroncpu.
- code locations:
- source :
/home/cima/Wapp/Software/Dual/Sources/Utilities/alfa_motor. c
- binary: /home/cima/Wapp/Software/Dual/Progs/Wapp/alfa_motor
- On aeroncpu /home/cima comes from wappserv:/data/home/cima.
On other cpus it comes from fileserver:/home/cima.
- Logfile: /share/cima/Logs/ALFA_start/alfa_motor.log
- Starting program on aeroncpu
- /etc/rc3.d/S99local has:
- su -c /home/cima/Wapp/Bin/Progs/Start/start_alfa_motor
wapp .
- This checks and kills alfa_motor if it is already
running..
- ( ./alfa_motor & ) > /dev/null .. So all
the printf output goes to /dev/null ??
- You can now restart the program with the alfamotorwin gui..
- to start it manually on aeroncpu:
/home/cima/Wapp/Software/Dual/Progs/Wapp/alfa_motor -loopback
-blast -debug
- be sure and kill any copy that is currently running.
- -debug will output messges/errors to stdout.. To send to a
file:
- ./alfa_motor -debug >
/tmp/motor.log &
- -loopback used for debugging. Writes a byte, reads a
byte, and compares that they are equal. If not equal output
a message error. Wait 1 millisec between each byte. Use byte
values 1..255. Loops forever
- while ( 1 ) {
printf("starting 1-255
loopback test\n");
for ( i = 1; i < 256 ; i++
) {
byte = i;
if (
write(mot->motor_fd, &byte, 1) != 1 )
printf("write error\n");
byte = 0;
if (
read(mot->motor_fd, &byte, 1) != 1 )
printf("read error\n");
if ( byte != i )
printf("failed to loopback %d\n", i);
usleep(1000);
- -blast .. debugging. write byte values 1..255 as fast as
you can forever..
- Notes on sockLib communications with alfa_motor (via mikael)..
ALFAMOTOR:
The ALFA rotator should now be
working.
Commands are send to the
ALFAMOTOR socket.
Commands to this socket are:
POSITION degrees [ REPLY
] - Starts the ALFA rotator moving to the desired position
in degrees.
Valid positions are +/- 100
degrees. If you put the optional "REPLY" command, it will send a
message when
it gets there. If it never gets
there (maybe because somebody sent a DISABLE command) it will
barf an
error. The REPLY option was
added for the observing executive so that it can block till the
rotator is
in-position. The POSITION
command always sends DISABLE then ENABLE and then the position
command.This action clears any
pending move commands.
ENABLE - Enables the rotator to
accept POSITION commands. (Never needed in practice.)
DISABLE - Stops the rotator from
moving.
RAW enc_counts velocity - Debug
tool.
The position is polled every
half a second and if it changes it is sent to the
ALFAMON program which broadcasts
the position with the monitor data every 10 seconds.
There is a new keyword for the
tcl/tk alfa command to return the motor position called:
alfa motor_position
The motor is controlled via a
serial port plugged into the aeroncpu (192.168.100.118)
computer in the wapp room.
gui to control the
alfa motor: alfamotorwin
- a tk gui lets you control the alfa motor.
/home/cima/bin/alfamotorwin.
- The tcl/tk code is in
/home/cima/Software/Normal/Progs/Display/alfa_motor_control.tcl
- You can read the position and command it to position.
- With full control button enabled you can:
- enable/disable the motor
- check the status. See the status bits below for what the
status bits mean.
- restart the comm program alfa_motor.c on aero
Problems/Debugging:
Check that
the alfa_motor program is running on aeroncpu:
- The alfa_motor program can abort on aeroncpu without leaving
any messages...
- To check if it is running:
- ssh -l wapp aeroncpu ps -ef | grep alfa_motor (you
need the wapp passwd).. you should see an entry like:
- wapp
1648
1 0 10:14 pts/0 00:00:00
./alfa_motor
- To restart the program:
- slogin aeroncpu -l wapp
- /home/cima/Wapp/Bin/Progs/Start/start_alfa_motor
- From within cima the restart alfa programs button will
restart alfa_motor
Check the
alfa motor controller status:
The alfamotorwin program is a gui based program
that lets you read the motor status:
- start the program (/home/cima/alfamotorwin)
- click on full control
- Click on check status. two rows of hex digits will be
printed:
- line 1: 0000 (from stat
command)| 0000 0000 0000 0000 0000 (from status command)
- line 2: 0000 0000 0000 0000 0000 0000 0000 (from status2 command)
- The status info is in the Setup and
Reference Guide ServorStar Controller (.pdf)
Starting on page 97.
- STAT
- b0- disable status
- 1= drive is disabled.
- 0 = drive is enabled
- b1- fault status
- 1= fault exists
- 0 = no fault exists
- b2 = safety status
- 1 - safety feature triggered:
- CWLIM=1,CCWLIM=1, LIMDIS=1, THERMODE=1 OR 2,FOLD=1,
(PLIM>0) and (PFB>PMAX),or ((PLIM>0) and (PFB
< PMIN))
- 0 - drive is safe
- b3 = special mode status
- 1 - step, burnin, or zero is active
- 0 - normal
- b4 = Hold mode status
- 1 - drive is in hold mode, in Position, or stopped
- 0 - drive is not in hold mode
- see the manual (page 97) for the rest of the bits
- STATUS
- word 1: disable
status word. (set if STAT B0=1) Tells why disabled
- b0: remote disable
- b1 software disable
- b2: dip switch disable
- b3: fault disable
- b4: velocity loop design failure
- b5: encoder not initialized
- word 2: Fault status word. (set if STAT b1 is set) This
describes which fault occurred.
- b0: drive over temp
- b1: over voltage condition:
- b2: over current condition
- b3: feedback loss
- b4: under voltage condition
- b5: motor over temp
- b6 analog supply fault
- b7: over speed condition
- see manual for the rest of the faults
- word 3: safety word status
- word 4: specel mode status word
- word 5: hold mode status word
- STATUS2 : (see manual
page 87)
- word 1: feedback loss status word
- b0 resolver line break
- b1 resolver/digital converter error bit I(following err)
- b2 sine encoder initialization failed
- b3 line break of encoder A/B input
- b4 line break of encoder index input
- b5 illegal halls state
- b6 line break of encoder C/D input (sine encoder)
- b7 A/B lines out of range (sine encoder)
- b8 burst overflow (sine encoder)
- b9* eternal feedback line break
- b10-15 not used.
- word 2: analog supply fault status word
- word 3: position deviation and over travel fault status word
- word 4: limit switches status word
Check the
LED on the motor controller front panel:
The motor controller is inside the huffman box
next to alfa on the rotary floor. It is has servostar printed on its
front panel. An led on the front panel tells the status of the
controller. page 112 of the setup and reference guide gives the
values:
Some values are:
- u under voltage .. motor bus voltage
is too low:
- The red disable button on the top of the huffman box has not
been pulled up, or the automatic disable switch is off and you
need to push the red light to reset the emg off.
What you see on the amplifier LEDS:
Some common failures:
- motor won't move. stat read 3, statusW1 reads 0010. a u is
displayed on the motor controller led.
- The emgoff switch on the top of the huffman box is pushed
in. pull it out and then push the reset light button
till it goes off.
Manuals:
Setup and Reference Guide ServorStar CD
(we're using a CE06)
ServoStart S and ServoStar CD
installation manual
ServoStar S andCD series Sine encoder
feedback
Application note: S/CD Series Serial
communications protocol
Application note: Servostar S/CD
position control
Kolmorgon
documentation
ServoStartCD controller.
page_up
home_~phil