ALFA turret motor
10sep08
Hardware:
- The alfa_motor program talks 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.
Software- 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 ??
- 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.
Problems:
- 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
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