Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How to communicate with Compax3 via RS232

Solved!
Go to solution

Are you saying that you are getting an active error?  That message in that spot is really a short history.  You should be concerned about the active error.  100 degrees is huge in the servo world.  It doesn't sound like you have it tuned correclty.  Also, I want to make sure you aren't using a load mounted encoder(second encoder).  That can throw a following error also.   Yes, the setting you have should ignore a following error. You usually don't want to do that, though.

Message 41 of 88
(4,051 Views)

Ok,

 

I fixed the problem by switching the assignment mode back to "free' rather than "fixed." I was using a previous configuration prior to changing that setting and forgot to check it.

 

Now everything runs fine.

 

Now's the time for tuning.

 

Thanks for all the help everybody.

0 Kudos
Message 42 of 88
(4,039 Views)

Check out this link...

 

http://www.parkermotion.com/dmxreadyv2/faqsmanager/faqsmanager.asp?category=68&knowledgebase=faqmana...

-Regards,
Vijay,
Application Engineer,
Parker Hannifin.
Message 43 of 88
(4,022 Views)

Hi Dave, Can you leave a brief note on all what you did to establish communication and finally get the motor running? Visitors may be benefitted!

-Regards,
Vijay,
Application Engineer,
Parker Hannifin.
0 Kudos
Message 44 of 88
(3,992 Views)

I said it up above, I changed the assignment to free from fixed. That allowed me to activate the axis which told me that serial commands were working properly.

 

I knew the axis was activated because it hums.

 

 

Now I am working on torque control with the controller setup as I10T10 and with the input simulation in the optimization window, it is indeed working. We just need to figure out what the reference voltage range from -10 to 10V corresponds to what torque we get back from it.

0 Kudos
Message 45 of 88
(3,986 Views)

I feel your pain! I bought a Compax 3 a few years ago, and it took me three months to get the thing to turn, and that after I challenged my supplier to show me where in the manual it actuually tells you how to make it go.

 

The trick is that the "go" bit of the status word (IIRC, it's 16 bits long). Has to be set to 0, then 1, then 0. So 3 operations instead of one, which didn't impress me. Anyhow, I programmed it in VB6. Here's a couple of subroutines, which I hope will help:

 


Public Sub motor_init()     'Initialise communications with motor
Dim temp

servo_comm = MSComm.CommPort                                                                          'Com port selected on props panel = COM1
Label4.Caption = "Com Port " & Str(servo_comm) & " connected"
    If Not Connect Then                                                                                                     'If not already connected
        
         If MSComm.PortOpen = False Then
            MSComm.PortOpen = True                                                                               'Open the Comm Port
            Delay (100)                                                                                                          'Allow for connection time
        End If
       
       
       
        MSComm.Settings = "115200,N,8,1"                                                                'Set Comm Settings
   
      
       
        'Check if connected by writing down a query and seeing if there is a response
        MSComm.Output = "o1.1" & vbCr
            Delay (100)
                temp = MSComm.Input
                    If Mid(temp, 1, 6) = "Parker" Then                                                        'If response correct then show connected
  

            Com_led.FillColor = QBColor(10)                                                              'LED to green
            Connect = True
            Timer1.Enabled = True
        Else                                                                                                                     'If nothing returned then show disconnected
            Disconnect
            Com_led.FillColor = QBColor(12)                                                              'LED to red
            Call MsgBox("Connection Failed. Check cable and power", vbOKOnly, "Connection Status")
          
        End If
    Else
        Disconnect                                                                                                        'Is connect if connected
    End If
End Sub

 

Public Sub set_speed() 'speed needs to be in deg per sec  motor speed (=output shaft speed * 29/3 * 48/22 for CTPT2, =output shaft speed * 29/3 * 36/22 for CTPVT )

flag_change = 1

next_buffer = "o1902.1=" & Str(speed_value)
    Call send
   
flag_change = 0

End Sub

 

Public Function motor_stop() '    Stops Motor

flag_change = 1

next_buffer = "o1100.3=0"
Call send

flag_change = 0

End Function

 

Public Function motor_start()   'Start motor, or effect changed run parameters. Uses motion table row 1 (o1902.1)
    flag_change = 1                                                            'Sets flag for send routine
      next_buffer = "o1100.3=0"                                        'Send ACK to clear buffer
           Call send
     next_buffer = "o1100.3=16643"                               'sets start bit low as start needs to see a rising edge
            Call send
    next_buffer = "o1100.3=24835"                                'Sets start bit high.
            Call send
    flag_change = 0
End Function

Public Sub send()         'Send data to servo under control

delay_time3 = Timer
memo_int = Servo.Timer1.Interval                                           'Disabling timer seems to set interval to zero
Servo.Timer1.Enabled = False                                                'Stop auto timer
    drive_indata = ""
        Servo.txtBack.Text = ""                                                      'Clear TextBox
         servo_sending = 1                                                             'Set busy flag

If Connect Then
    'if connected then send the buffered strings to the C3, then clear the buffer and Comm input

If flag_change = 1 Then buffer = next_buffer                            'Does not set buffer parameter until auto timer stopped
   
    If buffer <> "" Then
        buffer = buffer & vbCr                                                                  'Add a carriage return
        MSComm.Output = buffer                                                          'Send the buffered commands
            Servo.Delay (5)
                buffer = ""                                                                              'Clear the buffer
                    drive_indata = MSComm.Input                                      'Clear the receive buffer
                        Servo.txtBack.Text = drive_indata                            'Print received data in textbox
    End If
   
    'Query and update the status word value from C3 T11
    MSComm.Output = "o1000.3" & vbCr
         Servo.Delay (5)
            Update_Status (MSComm.Input)
                servo_sending = 0                                                           'Reset busy flag
End If
        Servo.Timer1.Enabled = True                                                'Restart auto timer
        Servo.Timer1.Interval = memo_int                                         'Reset timer interval to original setting

End Sub

 

Hope these help, and good luck! By the way, I found that the "current speed" returned by the Compax 3 was unusable as a process control variable - it seemed to be the instantaneous speed of the drive, which was varying. I use a separate rotoary encoder to get a true measure of speed these days.

Message 46 of 88
(3,919 Views)

Hi TWGomez,

 

I'm currently trying to figure out how to get my compax3 working...to tell you the truth i'm a little new in all of this (labview). In the past, I was able to send simple commands to a controller (Velmex controller) to turn a step motor through labview. And those were pretty easy. With the compax3 however, I'm not sure what the manual(s) are talking about.

All I would like to do is to send commands to the compax3 so that it could let a ETH Parker linear cylinder extend/retract at for any desired length...that is all... really. I just do not know where to start. Please any labview code(s) you or someone on this post has and willing to share will be greatly appreciated. 

 

0 Kudos
Message 47 of 88
(3,740 Views)

You have to configure the Compax3 and get it working with C3ServoManager before you can do anything in LabVIEW.  Did you buy this from a local distributor?  They should be able to help you with that at least.  Tackle the LabVIEW after that.

0 Kudos
Message 48 of 88
(3,737 Views)

Ok. Will do and let you guys know after....appreciate it. Thanks.

0 Kudos
Message 49 of 88
(3,724 Views)

I've written a C# program to communicate with my compax I11T30.  Once I created a program and loaded it onto the drive I was able to communicate with the C# program.  One workaround is that I had to use INT to BOOL conversion with the codesys software instead of a control word, although now I think I know how I could have set up the control word to fit my custom application.  Anyhow, there are plenty of integer inputs in the array tables so I probably won't go back and fix it.  Here is a little bit of the code for motor control via serial port communication.  Fastest it seems to accept commands and provide a response is 10mS (100 times/second).

 

 

0 Kudos
Message 50 of 88
(3,614 Views)