SDC2130 - Disable Closed Loop at startup

5 years 4 months ago #29530509 by DCON
Hello,

I'm driving a motor in closed loop using a script and commands.
I want to avoid any movement at startup until the controller receive a scripted command.

I've tried to set _MVEL to min, to set _MS or to set EX_ but the motor still goes to the default position command.

Do anybody have any idea to solve my problem ?

Thanks

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

5 years 4 months ago #29530510 by TechSupport
Write a script that will set the controller to open loop mode. Then have it wait x time and then configure back to closed loop mode.

setconfig(_mmod, 1, 0)
wait(10000) ' waits 10 seconds
setconfig(_mmod, 1, cc) 'cc = mode. 1: speed, 2: position relative -refer to manual.


You will need to start the script upon power up. Set script to autostart in your configuration.

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

5 years 4 months ago - 5 years 4 months ago #29530512 by DCON
Thanks. But I've still have a problem.

The motors are configured in closed loop.
After implementing mmod commands in the script, the motor still goes to the default position at startup, and after only, it seems to execute the script and goes to open loop mode.

The controller is shutten down by a on/off switch so at each startup the last conf (closed loop position) will be runned.

A "Default Max Speed value" would solve my problem ...

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

5 years 4 months ago #29530513 by TechSupport
It would likely be better to have the controller set for open loop by default, and then have your script go into the closed loop mode. This way you are guaranteed to have no motor movement upon power up.

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

5 years 4 months ago #29530516 by DCON
Sorry i've made a mistake in my previous message :
The motors are configured in open loop and not closed loop.

Since my script change the conf to closed loop, the controller with restart the next time configured in closed loop.

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

5 years 4 months ago #29530518 by TechSupport
You can always have a digital input switch activate your script once your controller has been turned on. This way, while the digital inputs is low, the controller will power up in open loop mode; no motor movement at all.

Then when your digital input goes active high (momentary push button is fine, set to activate "Run Script"), then the script will convert the configuration into your closed loop parameter.

If your PID parameters are tuned, then the motor should still be at rest, therefore no movement until a command is given.

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

Moderators: tonysantoni
Time to create page: 0.120 seconds