Multi-Axis Velocity Motion sample application.
This sample application updates a multi-axis velocity synchronously and on the fly.
It can update velocities at a rate of ~2ms.
Before runninng this sample app:
1. Make sure to configure your Multi-Axis on RapidSetup.
2. Make sure to adjust your Limits and Action for all axes.
- Precondition
- This sample code presumes that the user has set the tuning paramters(PID, PIV, etc.) prior to running this program so that the motor can rotate in a stable manner.
- Warning
- This is a sample program to assist in the integration of your motion controller with your application. It may not contain all of the logic and safety features that your application requires.
- Copyright
- Copyright © 1998-2017 by Robotic Systems Integration, Inc. All rights reserved. This software contains proprietary and confidential information of Robotic Systems Integration, Inc. (RSI) and its suppliers. Except as may be set forth in the license agreement under which this software is supplied, disclosure, reproduction, or use with controls other than those provided by RSI or suppliers for RSI is strictly prohibited without the prior express written consent of Robotic Systems Integration.
using System;
using RSI.RapidCode.dotNET;
using RSI.RapidCode.dotNET.Enums;
{
class MultiAxisVelocityMotion
{
static void Main(string[] args)
{
const int cycles = 5;
int i;
double[] accelerations = new double[6] { 1000, 1000, 1000, 1000, 1000, 1000 };
double[] velocities = new double[6];
Random rnd = new Random();
try
{
Console.WriteLine("Start Multi-Axis Move\n");
for (i = 0; i < cycles; i++)
{
int random_vel1 = rnd.Next(1, 100);
int random_vel2 = rnd.Next(1, 100);
int random_vel3 = rnd.Next(1, 100);
int random_vel4 = rnd.Next(1, 100);
int random_vel5 = rnd.Next(1, 100);
int random_vel6 = rnd.Next(1, 100);
velocities = new double[6] {random_vel1,
random_vel2,
random_vel3,
random_vel4,
random_vel5,
random_vel6 };
System.Threading.Thread.Sleep(100);
}
Console.WriteLine("\nTest Complete\n");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.WriteLine("\nPress Any Key To Exit");
Console.ReadKey();
}
}
}