Safely starting closed loop from power-up

6 years 2 months ago #29533001 by mpthompson
I have a motor successfully operating in closed loop position control using a PWM feedback from an encoder.

Without any scripting, by default, when the Roboteq controller powers up the motor automatically seeks to its zero command position. For safety reasons, the desired operation is for the motor to initialize the command position to the initial feedback position and then old that position until commanded otherwise.

Is there a way to configure the motor channel without scripting for this type of closed loop operation where the command position is initialized from the feedback position. Or, if scripting is required, what would be the best approach. I naively tried a very simple script as shown below:
InitialPosition = getvalue(_FEEDBK,1)
setcommand(_GO, 1, InitialPosition)

However, this didn't seem to work.

Or, are there other approaches to getting a RoboteQ controller under closed-loop control in a safe way so that it's command position starts from where the encoder is current set.

Thanks,

Mike

Please Log in or Create an account to join the conversation.

6 years 2 months ago #29533004 by blake
Hi Mike,

I need a bit more info:

1) Which controller model do you have?

2) Which version of firmware does your controller currently have? This can be observed in the bottom right corner of the Roborun+ window when the controller is connected.

3) Which closed loop position mode are you trying to use specifically (position relative, position tracking or count position)?

Please Log in or Create an account to join the conversation.

6 years 2 months ago #29533005 by mpthompson
Hi Blake,

I'm using the FBL2360 with the firmware version at v1.6 and running in closed-loop position tracking.

The solution I found is to apply power to control electronics first, configure the command position to match the feedback position, then apply power to the motor input. With the feedback matching the command, the motors no longer moved position during this two-step power-up sequence.

With regards to the scripting, it seems that the controllers go into closed-loop control before the start-up script is run which was giving me problems I described above.

Mike

Please Log in or Create an account to join the conversation.

6 years 2 months ago #29533011 by maple
This is my solution for same problem:
- I configure controller for Open-loop mode. Then start-up command 0 means "stop", not a position.
- In the beginning of the script Emergency stop is activated:
setcommand(_EX, 1)	' first, make sure nothing moves!
- At the end of initialization code I do the following:
setconfig(_MMOD, 1, 4)	' Closed-loop position relative
setconfig(_MMOD, 2, 4)
setcommand(_G, 1, getvalue(_F, 1))	' set target position to current position
setcommand(_G, 2, getvalue(_F, 2))
setcommand(_MG, 1)	' Release Emergency stop (both motors)
- Note that if you save configuration to device while it is running you will override mode with closed-loop, so be careful. I added setcommand(_EX, 1) in the beginning of the script just for this case, but since it runs after device startup some movement is possible.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds