Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: How to have torque mode be initiated and stopped by another motor's trajectory?

How to have torque mode be initiated and stopped by another motor's trajectory? 2 years, 10 months ago #1177

I have two motors daisy-chained together. I want to run one in torque mode (motor 2) while the other (motor 1) is moving through a trajectory. When that motion is complete, I then want to reverse the motors and have motor 1 in torque mode while motor 2 moves through its trajectory.

What is the best method to have the two motors communicate with each other? I am currently trying to run separate programs on each motor using a project, but haven't had success in communicating with each other. When I used a single program to run both motors, I was not able to run them in two different modes.

Thank you for any help!

Re: How to have torque mode be initiated and stopped by another motor's trajectory? 2 years, 10 months ago #1178

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
If you have Class4 motors, it's a tall order. You would probably have to tie I/O between the motors to accomplish this with Class4... or open Ports E and F as RS485 on both motors... and exchange data with PRINT1 commands.

If you have Class5 motors, and you have the Combitronic option (-C or -DN)... it gets much easier. If you have Class5 motors, and you do not have the Combitronic option... you would have to use the same options as with the Class4 motor.

Re: How to have torque mode be initiated and stopped by another motor's trajectory? 2 years, 10 months ago #1179

I have Class 5 motors without Combitronic.

I have tried printing data over RS485, but have not been able to read the data.
'Motor 1
OCHN(RS4,1,N,38400,1,8,D)
PRINT1(#49)

'Motor 2
OCHN(RS4,1,N,38400,1,8,D)
RGETCHR1

I have also tried using I2C
'Motor 1
OCHN(IIC,1,N,200000,1,8,D)
PRINT1(IIS,#49,IIP)

'Motor 2
OCHN(IIC,1,N,200000,1,8,D)
RGETCHR1

Am I completely off the mark in how I am using those commands?

Re: How to have torque mode be initiated and stopped by another motor's trajectory? 2 years, 10 months ago #1180

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
Don't open the 485 port in Data mode(the last argument D)... use command mode instead.
OCHN(RS4,1,N,9600,1,8,C) is a good place to start (this needs to be in both motors).

For Motor1 to set the variable "a" in Motor2 equal to 123... send the following...
PRINT1(#130,"a=123",#13)

For Motor2 to set the variable "a" in Motor1 equal to 321... send the following...
PRINT1(#129,"a=321",#13)

Re: How to have torque mode be initiated and stopped by another motor's trajectory? 2 years, 10 months ago #1181

  • hsummer
  • OFFLINE
  • Posts: 12
  • Karma: 1
If you are running the motors such that the second motor aids the first motor in torque mode, then be sure to use the TRQ command. (assuming class 5)
If you have canopen version, it is easy,
For the main motor,
This code loop wil assign the torque value of the local motor (regardless of being in velocity or position mode) into the second motor to give it equal force to match the local motor.

WHILE Bt 'while local motor is busy moving
T:x=TRQ G:x 'assign torque of local motor to other motor
LOOP
X:x 'stop other motor

value of "x" is the canopen address of the other motor.

If using RS232, or 485:
WHILE Bt 'while local motor busy is moving
PRINT(#x,"T=",TRQ," G",#13) 'assign torque of local motor to other motor
LOOP
PRINT(#x,"X ",#13) 'stop other motor

again where value of "x" is the serial address of the other motor.
If it is RS485, use PRINT1(.....

Note that bidirectional communication over 485 and 232 is possible but not nearly as easy.
If you use RS-232 and there are just two motors, be sure to issue ECHO_OFF first. Otherwise, the commands printed out will echo back forever because both motors will be in a serial loop.
This is not required or relevant if using RS485 on the secondary port.
  • Page:
  • 1
Moderators: hsummer, csearcy
Time to create page: 0.44 seconds