Below are my proposed stepper motor related changes to be submitted for
inclusion in the next release of EPICS. I didn't list the corresponding
necessary changes to steppermotor.h and choiceRec.ascii. The effect of
these changes are to provide a motor controller independent way of finding
the limit switches and to add support for finding a home switch. Motor
controller support routines are thus free to interpret what these concepts
mean (or to ignore them) whereas previously record support dictated the
meaning of finding a limit switch. Are these agreeable to everyone? I
realize that this breaks non(Compumotor and OMS) support that may be out
there, but the changes the owners would have to make are small.
I have also completed device support for the Allen Bradley 1746-HSTP1
stepper motor controller and would like to submit it for inclusion in the
next release of EPICS, as well.
Thanks,
Ric Claus
recSteppermotor.c / init_sm:
...
if (psm->mode == POSITION){
if (psm->ialg != 0){
> switch (psm->ialg){
> case (POSITIVE_LIMIT):
> status = (*pdset->sm_command)(psm,SM_FIND_LIMIT,1,0);
> break;
> case (NEGATIVE_LIMIT):
> status = (*pdset->sm_command)(psm,SM_FIND_LIMIT,-1,0);
> break;
> case (POSITIVE_HOME):
> status = (*pdset->sm_command)(psm,SM_FIND_HOME,1,0);
> break;
> case (NEGATIVE_HOME):
> status = (*pdset->sm_command)(psm,SM_FIND_HOME,-1,0);
> break;
> }
psm->sthm = 1;
/* force a read of the position and status */
}else{
status = (*pdset->sm_command)(psm,SM_READ,0,0);
}
...
drvCompuSm.c / compu_driver:
case (SM_VELOCITY):
compu_motor_data_array[card].velocity = arg1;
compu_motor_data_array[card].accel = arg2;
/* set the velocity */
compu_msg[0] = SM_DEF_VEL_ACC;
compu_msg[1] = 0; /* time is in seconds */
compu_msg[2] = 0;
pint = (int *)&compu_msg[3]; /* velocity */
*pint = arg1;
pint++; /* acceleration */
*pint = arg2;
compu_send_msg(pcompu_motors[card],compu_msg,11);
break;
> case (SM_FIND_HOME): /* Move to a home switch */
> break; /* Not supported by this device */
>
> case (SM_FIND_LIMIT): /* Move to a limit switch */
> arg1 = arg1 >= 0 ? 0x000fffff : -0x000fffff;
> /* break purposely left out to continue with SM_MOVE */
case (SM_MOVE):
if (compu_motor_array[card].mode == VELOCITY_MODE)
return(0);
/* move the motor */
i = 0;
compu_msg[i++] = SM_MOV_REL_POS;
pint = (int *)&compu_msg[i];
*pint = arg1;
i += 4;
compu_send_msg(pcompu_motors[card],compu_msg,i);
/* set the motor to active */
compu_motor_array[card].active = TRUE;
/* wakeup the compu task */
semGive(compu_wakeup);
break;
drvOms.c / oms_driver:
case (SM_VELOCITY):
/* set the velocity */
motor_data_array[card][channel].velocity = arg1;
strcpy(oms_move_msg,"A?\nVL");
oms_move_msg[MOTOR_POS] = oms_motor_specifier[channel];
count = cvtLongToString(arg1,&oms_move_msg[5]);
strcat(oms_move_msg,"\n");
oms_send_msg(oms_motor_present[card],oms_move_msg);
/* set the acceleration */
strcpy(oms_move_msg,"A?\nAC");
oms_move_msg[MOTOR_POS] = oms_motor_specifier[channel];
count = cvtLongToString(arg2,&oms_move_msg[5]);
strcat(oms_move_msg,"\n");
oms_send_msg(oms_motor_present[card],oms_move_msg);
break;
> case (SM_FIND_HOME): /* Move to a home switch */
> break; /* Not supported by this device */
>
> case (SM_FIND_LIMIT): /* Move to a limit switch */
> arg1 = arg1 >= 0 ? 0x000fffff : -0x000fffff;
> /* break purposely left out to continue with SM_MOVE */
case (SM_MOVE):
/* move the motor */
strcpy(oms_move_msg,"A?\nAF\nMR");
oms_move_msg[1] = oms_motor_specifier[channel];
count = cvtLongToString(arg1,&oms_move_msg[8]);
strcat(oms_move_msg,"\nGO\n");
oms_send_msg(oms_motor_present[card],oms_move_msg);
/* set the motor to active */
oms_motor_array[card][channel].active = TRUE;
/* wakeup the oms task */
semGive(oms_wakeup);
break;
- Navigate by Date:
- Prev:
error in mbbiDirect-record-processing Thomas Birke
- Next:
Possible Problem with aao Record Eric Bjorklund, NPSM
- Index:
1994
1995
<1996>
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
error in mbbiDirect-record-processing Thomas Birke
- Next:
Possible Problem with aao Record Eric Bjorklund, NPSM
- Index:
1994
1995
<1996>
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|