HELP! Chaining commands in SDC2150

11 years 3 months ago #29526893 by subzero787

I really need help regarding this. What is the best way of chaining commands to the SDC2150 controller? Right now, I am using the closed loop position relative mode, using a timer in visual basic to set the delay for the commands. I also need it to have different speeds at different go commands.

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

11 years 3 months ago #29526903 by roboteq
Replied by roboteq on topic Re:HELP! Chaining commands in SDC2150
There is a method for chaining position commands at preset acceleration, deceleraton and velocity. This mode is not fully validated and so it may have problems. Please report if you try.

Below are the summary instructions for using this mode:

To enter this mode you will first need to configure the encoder so that it is used as feedback for motor1 (and feedback for motor2 on the other encoder).

Then select the Motor Mode “Close Loop Count Position”

you should also set the default acceleration, decelleration and position mode velocity in the motor menu. You will be able to change these values on the fly if needed.

Then to go to an encoder position value, just use the !p command:

example: !p 1 10000, will get the motor to move to absolute counter position 10000. You will notice the smooth ramp up and down so that the motor gently stops at count 10000

The !pr command is similar except that it gives a count to go to that is relative to the current counter value. So sending !pr1 10000 repeatedly will cause the motor to move an additional 10000 count every time. (beware that this will work until you reach the maximum counter value of +/-2,000,000)

At any time you can change the acceleration and velocity uising the !ac (acceleration in RPM/s*10), !dc and !s. Example !ac 1 10000 = acceleration for channel 1 is 1000 RPM/s

Next, you can define up to 4 \"goto position\" commands in a table that can be chained and looped.

For each goto position, you will enter the count (relative or absolute), acceleration, speed, and deceleration. If you dont enter something for the acceleration, speed or deceleration, the default values will be used for these parameters. You will also enter the number of the next goto command to perform when the current end destination is reached. This is done with the !nx command (as in \"next\").

To enter the goto counts, you will use the !p (absolute) or !pr (relative) commands. The argument you put after the command determines its order in the table

!pr 1 1000 is first goto command for channel 1
!pr 2 2000 is first goto command for channel 2
!pr 3 3000 is second goto command for ch 1
!pr 4 3000 is second goto command for ch 2

5 and 7 are goto commands 3 and 4 for ch 1
6 and 8 are goto commands 3 and 4 for ch 2

Entering the acceleration, deceleration and speed in the table is done the same way.

The !nx command is also done the same way, with the first argument being the position in the table (1, 3, 5, 7, for command 1, 2, 3, 4 of ch1, respectively). The second argument is the next command to be executed after the destination is reached. The choices are 0 to stop the motion (ie do not chain another goto position), or 1, 2, 3, or 4 for selecting the next motion in the table.

After you loaded the tables, the motion will start either after you enter a motor 1 command (for example !pr 1 1000), or after you call a specific goto command in the table using the !GP n command where n=0 to stop, n=1 to 4 to select the position command in the table.

Notice that since the goto position command will start immediately after you enter a motor1 command, you should load the tables with the others first and finish with the motor1 command.

Finally, the ?CP query will let you see which goto position is being executed at a given time. This is a useful way to determine when a motion has reached it destination and the next is being selected.

Note also, that when going from one table element to another, only the acceleration parameter is used. The new destination is loaded – and the motor will start accelrate/decelerate - when the previous destination count has been reached.

The way the system works, the microcomputer onboard the controller computes the exact position the motor is expected to be at every 1ms. Then, a closed loop algorithm ajust the power to the motor so that the motor is precisely at the desired counter value at every instant. This means that you will need to tune the PID.

So, to make a practical example, if you have a 100 line encoder (400 counts) and you want to run 2 turns a 100 RPM and 10 turns at 1000 RPM, you will do as follow for Channel 1:

!s 3 1000 (speed table element 2 of channel 1 = 1000 RPM)
!nx 3 1 (next table element 2 of channel 1 = next motion will be 1)
!pr 3 4000 (count table element 2 of channel 1 = 10 x 400 counts)

!s 1 100 (speed table element 1 of channel 1 = 100 RPM)
!nx 1 2 (next motion will be 2)
!pr 1 800 (count is 2 turns of 400 counts. Motion will start immediately upon entering this.

Notice that the acceleration values have not been entered here. If you dont plan to have different accelration values, set them in the motor configuration menu.

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

Moderators: tonysantoni
Time to create page: 0.056 seconds