Hello Guest it is March 28, 2024, 11:31:57 AM

Author Topic: Plugin Function Polling Speed  (Read 3642 times)

0 Members and 1 Guest are viewing this topic.

Plugin Function Polling Speed
« on: December 27, 2009, 12:38:33 AM »
I have been trying to write a controller app for my keyboard encoder project and am considering move it into a plugin as the Cypress Enable language is to limited for my needs and using Visual Basic in an outside app works but provided stuttered movement. So I am going to test out the plugins capabilities and see where this takes me. My question is:

I saw in the code and videos that the Update() routine is called ~10 times a second and Art's explanation on setting the engine dir/vel/accel parameters and then jog = true was very helpfull but alot of movement can happen in a 100ms period I would think.

Is this internal 10Hz call cycle the fastest any given plugin will ever be able to run? I inquire as if I spin my encoder any faster that that It will loose steps and it causes many issues for me. (eg 100 ppr encoder, quadrature decoded is 400 ppr, 1 second rotation I want my jog function to be updated every 2.5ms)

What am I missing here?

EDIT:

Also I want to load up the JoyStickPlugIn from the SDK examples download but I get errors about wrong defs and need ; before things that are obviously right. How do you guys recommend setting up my environment and placing my projects so its easiest to code?

I copied the JoyStickPlugIn folder to C:\Mach3\PlugIns and setup in the linker ../JoyPlugin.dll and in debugger run C:\Mach3\Mach3.exe in the runtime folder C:\Mach3\ just as in arts video. Do I need to setup includes to wherever mach has its includes hidden? I have installed Mach3Wizard and its default projects will build without error.
« Last Edit: December 27, 2009, 01:26:19 AM by iceblu3710 »

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Plugin Function Polling Speed
« Reply #1 on: December 28, 2009, 08:14:16 AM »
There are two speed routines in the plugin, the standard is 10htz, update time, there is a "High speed" function that can call at 40 htz, (for small fast code only). NOTE: if you not having your encoder go striaght to the PP driver. Then you will need to have one or two, or both things:  a tick timer sent from your hardware, (that will help smooth your encoder), and/or perhaps spin off a thread that runs on its own to capture and buffer your encoder and when mach gets around to its 10hrz loop have it get the data then.....

down load the "Universal" plugin template in the finished plugins, and try it with your settings like you discuss above.

scott
fun times
Re: Plugin Function Polling Speed
« Reply #2 on: December 29, 2009, 12:06:44 AM »
Ok I think I will just stick with the SDK examples and the wizard for now as the "Universal" profile will compile but I get over 120 of errors about this:

Code: [Select]
1>c:\mach3\plugins\universalblank\resource.h(62) : warning C4005: 'IDC_FIRMWARE' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(1147) : see previous definition of 'IDC_FIRMWARE'
1>c:\mach3\plugins\universalblank\resource.h(63) : warning C4005: 'IDC_BOARDID' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(933) : see previous definition of 'IDC_BOARDID'
1>c:\mach3\plugins\universalblank\resource.h(65) : warning C4005: 'IDC_MAVG' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(903) : see previous definition of 'IDC_MAVG'
1>c:\mach3\plugins\universalblank\resource.h(145) : warning C4005: 'IDC_STATUS' : macro redefinition
1>        c:\mach3\plugins\machincludes\resource.h(126) : see previous definition of 'IDC_STATUS'


I am an embedded c programmer for micro controllers and am not accustomed to the plethora of compile time options visual studio has available. Also this SDK being written primary in C++ and defiantly multi threaded its way over my head. The structures and things I have seen don't even make sence to me... I have a long way to go. For example I tried to add a forum for the dialog box to your "Universal" template and I got more errors than I even cared to look at. Visual Basic is mind numbingly easy as it handles everything for you, c is so simplistic its easy to follow when one thread is going at a time and I have a main() function to center around.

One thing to help me understand how this plugin structure works is to get access to machs internal engine variables. In the mach3_sdk.wmv at 10:30 into the video on debug he talks about all the variables and how you can setup the velocity and max acceleration and such but I don't see anything. Usually all I get is a mach crash and dissembler view. I have mach3 set as the debugger but how do I get to see its variables?

Other than that anyone recommend a good thread or tutorial or something on how to actually add something like forums to the projects?

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Plugin Function Polling Speed
« Reply #3 on: December 29, 2009, 01:45:23 PM »
you are missing the "Mach Includes file" that is the errors your getting....

Please read James "Plugin tutorial" docs, he is good at explaining how to start and learn it...

scott
fun times