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

Here's the VB6 code I used to change speed:

 

format_speed = Format(Str(speed_value * 174 / 11), "####0.000000") 'Controls format of sent string, converts to deg per sec at motor

next_buffer = "o1902.1=" & format_speed

Call send

next_buffer = "o1100.3=16643" 'Sets start bit low

Call send

next_buffer = "o1100.3=24835" 'Sets start bit high.

Call send

 

So..load the next speed into the buffer, then flick the start bit low then high.

 

Hope this helps

 

Roy

Message 71 of 88
(2,809 Views)

Thanks Roy!

 

That'll let me do some interesting things.

 

Have you measured the time it takes for the controller to respond to the messege?

You think it's around 10's of ms or 100's?

 

No probs if you don't know. Just wondering.

 

Thanks,
Dave

0 Kudos
Message 72 of 88
(2,805 Views)
Hi Dave

It was quite quick, as I remember. I was getting around the whole loop in 30-50ms, and this included reading a strain gauge sensor and a few other things. I guess that a lot of the delay was in the I/O ports and handshaking. Would have been faster if I was using a PLC instead of a Windows XP PC.

Good luck!

Roy
0 Kudos
Message 73 of 88
(2,788 Views)

Thanks Davecyli....just to confirm what you just said, I have to:

 

First, command to set to MoveRel mode in Motion Table Row 2:

O1905.2=2

 

Then, command entry to set table (Pg. 296 in the C3I1T11 manual):

O1904.2=$32

 

and finally Set Bit code

O1100.3=$6203

 

correct? In case this does not work and I'm not in free mode, I do I enable the FREE mode  in the Parker Integrated Engineering Tool. Do I do it through the C3manager software? Thanks!

0 Kudos
Message 74 of 88
(2,787 Views)

@Roy,

Yeah I'm running through windows as well.. but that delay should be fine. I'll post my results once I get it working.

 

@Mel,

That looks correct.

 

If your controller had a position feedback, you could also do O1905.2=1 for MoveAbs in place of O1905.2=2 for MoveRel.

I just said MoveRel because that worked for me when I didn't have position feedback.

 

Here is where you choose Free Assignment mode in Parker Integrated Engineering Tool:

Labview Free Assignment.JPG

 

And then download to controller.

 

 

Good Luck,

Dave

0 Kudos
Message 75 of 88
(2,784 Views)

Mel, in the Parker configuration software (as shown by Dave) check the 'Motion Profile Table' and make sure you have a profile setup on SET#2. Without that, you're not going to move at all.

 

Regards,

 

Jason

0 Kudos
Message 76 of 88
(2,760 Views)

@ Dave and Jason. I really do appreciate the help. What Dave said was right on...I can now move.

Now the next step is to track the position until the target position is reached. My motor has an encoder so if I put the following command sequence:

 

  • Write O 680.5CR to buffer (request current position). I found that object on page 318 of the manual
  • Write O 1904.2=$32CR to buffer (Entry to table set). Do I need this?
  • Write O 1100.3=$6203CR to buffer (to execute the request, as I'm guessing that's what this command does, but Do I need this?)
  • Use the "VISA Read" (to read the buffer and find out what the encoder replied.)

in a while loop and stop the loop when the current position is equal to the target position will that work? Or this should be done differently.

cheers!

0 Kudos
Message 77 of 88
(2,752 Views)

I'm not sure, I haven't done any position tracking. Only velocity,as I'm using my motor in a dyno rig.

 

In my labview code, I have a separate thread that constantly reads the speed and updates a variable.

You can do the same for position with your first command. O680.5CR

0 Kudos
Message 78 of 88
(2,740 Views)

Hello,

You guys know if the compax3 has an E-STOP command that will stop the motion in case of an emergency? Also is there a HOMING command? I don't know but the manual doesn't seem to be clear on those. 

 

0 Kudos
Message 79 of 88
(2,699 Views)

There's definitely a homing command. I've never used it though because, again no encoder.

 

The homing feature is shown in the status diagram on page 289. 

 

As for the estop, I have a estop on my rig that i press that shuts power to everything.

 

The estop feature might be in PIET?

Sorry, I can't be of more help.

 

-Dave

0 Kudos
Message 80 of 88
(2,682 Views)