-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Motor commutation; ACS command acsc_CommutExt not wrapped #19
Comments
This should be pretty easy to add to the I don't currently have access to an ACS controller. Could you put together a PR for this addition? |
I will put a pull request. I just have added that function, but tested only in simulation. Christof |
If you want to submit it now, I have no problem merging. I will also keep this issue open until resolved. Thanks! |
Pete, unfortunately our ACS hardware is hung-up in customs, so I am still limited to simulation.
Regards Christof |
I think that all sounds good. If you want to submit a PR early for code review purposes, you can just call it out as WIP. Don't worry about additional commits you may need after debugging with real hardware. I can wait before merging. |
Pete, Current state:
|
Cool! Nope, you don't need permissions. The best way to do this is and do some code review to use the fork/pull process:
|
Motor commutation
Some positioning systems (e.g. direct drive with missing hall sensors) need to calibrate the motor commutation. ACS controllers feature a auto commutate function.
This is supported by SPiiPlus C Library from version 2.5 on with the acsc_CommutExt function.
Description:
The function initiates motor commutation.
Syntax
Int acsc_CommutExt(HANDLE handle, int Axis, float Current, int Settle, int Slope, ACSC_WAITBLOCK *Wait)
Arguments:
Handle – Communication handle
Axis – The axis to perform commutation on. ACSC_AXIS_0 corresponds to axis0, ACSC_AXIS_1 –to axis1, etc.
Slope – Specifies the time it takes for the current to rise to the desired value, ACSC_NONE for default value.
Wait – Pointer to ACSC_WAITBLOCK structure.
If Wait is ACSC_SYNCHRONOUS, the function returns when the controller response is received. If Wait points to a valid ACSC_WAITBLOCK structure,
the function returns immediately. The calling thread must then call the acsc_WaitForAsyncCall function to retrieve the operation result.
If Wait is ACSC_IGNORE, the function returns immediately. In this case, the operation result is ignored by the library and cannot be retrieved to the
calling thread.
C Example use:
if(!acsc_CommutExt(Handle,// Communication handle
ACSC_AXIS_0, // Commuting axis 0
43, // Commutation current
ACS_NONE, // Use default settle
ACS_NONE, // Use default slope
ACSC_SYNCHRONOUS // Waiting call
)){
printf(“commutation error: %d\n”,acsc_GetLastError());
}
Can you add this?
The text was updated successfully, but these errors were encountered: