Subject: |
OMS VME-8 motor controllers: PAL upgrades |
From: |
[email protected] (Bob Dalesio) |
Date: |
Fri, 17 Jun 94 11:28:47 MDT |
I am not sure what version of the OMS driver is in use by the CAT's, but the
original driver uses the interupts to get data back from the OMS.
Polls the motor at 30Hz when it is moving and notifies the database at 10Hz
or immediately when the motor stops. This is a maximum latency of
~34 milliseconds. I've attached the code segments. My memory is not great,
but I seem to remember something about the end of move interrupt not
working. That would be the lowest latency response. If someone checks that
out and determines that it works, let me know so that we can incorporate it
immediately, thanks.
The CPU usage on this driver was realtively small as I recall. It is only active
when there is a motor in use, and the overhead to send position requests is
minimal - about 10usecs per byte.
I would be very interested in beta testing their PAL. I was too quick to
delete that message - could someone give me a contact at OMS? Is this only
available on the OMS-8? To date, we've been able to use the same driver for all
of their cards.
Bob
===============================================================
OMS interrupt for data ready from the card:
oms_intr(card)
register short card;
{
register struct vmex_motor *pmotor;
register int key;
register char inp_char;
register int *pinx;
key = intLock();
/* pointer to this motor */
if ((pmotor = oms_motor_present[card]) == 0){
intUnlock(key);
return(0);
}
pinx = &resp_inx[card];
/* get the next character */
if (pmotor->status & INPUT_BUFFER_FULL){
/* check for end of command */
inp_char = pmotor->data;
if (((inp_char == 0xa) || (inp_char == 0xd)) && (*pinx > 0)){
/* check if the encoder command caused an error */
if (pmotor->status & (OMS_ENCODER | OMS_CMD_ERROR))
encoder_present[card] = FALSE;
else encoder_present[card] = TRUE;
/* terminate and send the message */
read_buffer[card][*pinx] = 0;
if (rngBufPut(oms_resp_q,read_buffer[card],OMS_MSG_SZ)
!= OMS_MSG_SZ){
logMsg("oms_resp_q full\n");
}else{
semGive (oms_resp_sem);
}
*pinx = 0; /* reset buffer */
/* save printable ascii characters */
}else if ((inp_char >= 0x20) && (inp_char < 0x7f)){
if (*pinx == 0){
read_buffer[card][*pinx] = card;
*pinx += 1;
}
if (*pinx < OMS_MSG_SZ){
read_buffer[card][*pinx] = inp_char;
*pinx += 1;
}else{
logMsg("oms intr buffer full\n");
}
}
}
intUnlock(key);
return(0);
}
=================================================================
Polls for motor position at 30 Hz when the motor is moving:
while (motor_active){
motor_active = FALSE;
taskDelay(2);
=====================================================================
Notify at 10Hz or as soon as the motor stops:
/* post every .1 second or not moving */
if ((poms_motor_array->update_count-- <= 0)
|| (pmotor_data_array->moving == 0)){
if (poms_motor_array->callback != 0){
(int)psmcb_routine = poms_motor_array->callback;
(*psmcb_routine)(pmotor_data_array,poms_motor_array->callback_arg);
}
if (pmotor_data_array->moving){
poms_motor_array->update_count = 2;
}else{
poms_motor_array->update_count = 0;
}
}
End of returned message
----- End Included Message -----
----- End Included Message -----
- Navigate by Date:
- Prev:
Re: vxWorks Bob Dalesio
- Next:
Re: OMS VME-8 motor controllers: PAL upgrades Joseph P. Sullivan
- 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:
Re: DSP edward moler
- Next:
Re: OMS VME-8 motor controllers: PAL upgrades Joseph P. Sullivan
- 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
|