Extract ServoEncoder Counts in eV+

Extract ServoEncoder Counts in eV+

Postby Kevin Hiller » Fri Apr 18, 2014 9:31 am

Hello,

I'm wondering if it's possible to extract a servo's internal encoder counts (possibly for belt tracking) in V+ (possibly with a "DEVICE(3,...)" instruction?

Regards,
Kevin Hiller
 
Posts: 5
Joined: Thu Dec 05, 2013 2:20 pm

Re: Extract ServoEncoder Counts in eV+

Postby KevinS » Tue Apr 22, 2014 10:44 am

You could do this with the Advanced Servo Library license using V+ or a C# program in ACE using the PC.
KevinS
 

Re: Extract ServoEncoder Counts in eV+

Postby Kevin Hiller » Tue Apr 22, 2014 11:05 am

So, would the "DEVICE" instruction be used in V+ code?
Kevin Hiller
 
Posts: 5
Joined: Thu Dec 05, 2013 2:20 pm

Re: Extract ServoEncoder Counts in eV+

Postby KevinS » Wed Apr 23, 2014 1:35 pm

Yes, the DEVICE real valued function is used in a V+ program. See the link below for more information.
http://www1.adept.com/main/ke/data/V%20 ... html#33864

V+ code:
Code: Select all
        AUTO encoder, stt, status, position, velocity, predicted_pos, latched_pos

        encoder = 1 ; Zero based index of encoder channel to access
        stt = 0     ; Reset the error code

        status = DEVICE(0,encoder,stt,0)        ; Get encoder channel status
        position = DEVICE(0,encoder,stt,1)      ; Get encoder channel position
        velocity = DEVICE(0,encoder,stt,2)      ; Get encoder channel velocity
        predicted_pos = DEVICE(0,encoder,stt,3) ; Get encoder channel predicted position
        latched_pos = DEVICE(0,encoder,stt,4)   ; Get encoder channel latched position

        ; Check for any errors
        IF stt < 0 THEN
            TYPE "Some error occured reading encoder data"
        END


C# code:
Code: Select all
using Ace.Adept.Server.Controls;
using Ace.Core.Server;
using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace Ace.Custom {

   public class Program {

      public AceServer ace;

      public void Main () {
         
         // Reference to controller object in ACE workspace
         IAdeptController adeptController = (IAdeptController) ace["/SmartController 1/SmartController 1"];
         
         Trace.WriteLine("Encoder Position (cts): " + adeptController.GetEncoderPosition(0).ToString());
         Trace.WriteLine("Encoder Velocity (cts/sec): " + adeptController.GetEncoderVelocity(0).ToString());
         
      }
   }
}

C#_GetEncoderData.PNG
C#_GetEncoderData.PNG (15.73 KiB) Viewed 19755 times
KevinS
 

Re: Extract ServoEncoder Counts in eV+

Postby Kevin Hiller » Wed Apr 23, 2014 1:49 pm

Thanks, but do these V+ code/C# example(s) refer to a belt encoder? (encoder type = 0).
Would/could you use "DEVICE(3,encoder,stt,1) for accessing a servo's encoder count value in V+?
Kevin Hiller
 
Posts: 5
Joined: Thu Dec 05, 2013 2:20 pm

Re: Extract ServoEncoder Counts in eV+

Postby KevinS » Wed Apr 23, 2014 2:20 pm

DEVICE 3 is an internal, Adept, use only access to servo parameters. The generic/customer access to servo parameters is through the Advanced Servo library. This is V+ license that needs to be purchased to allow this level of access. Please contact your local sales representative. General information about the Advanced Servo Library can be found with the links below.

Overview:
http://www1.adept.com/main/ke/data/V%20 ... erview.htm

Encoder data :
http://www1.adept.com/main/ke/data/V%20 ... ncoder_DAC
KevinS
 

Re: Extract ServoEncoder Counts in eV+

Postby Kevin Hiller » Wed Apr 23, 2014 2:26 pm

OK, thanks!
Kevin Hiller
 
Posts: 5
Joined: Thu Dec 05, 2013 2:20 pm


Return to MotionBlox-10 ServoKit

Who is online

Users browsing this forum: No registered users and 1 guest