Motor brake

Moderators: TomKerekes, dynomotion

User avatar
cnc_freak
Posts: 58
Joined: Fri Apr 20, 2018 5:36 am
Location: Greece
Contact:

Re: Motor brake

Post by cnc_freak » Wed Oct 03, 2018 8:08 am

No this was not the case. The problem comes when i press the button MOVE X, MOVE Y... on the main screen. This button calls another c program the GOTOX.c, GOTOY.c and so on. Only the button GOTOB works ok. Also when the command DisableAxis(4) is commented, disabled, there is no problem, everything work fine.
Attachments
GOTOY.c
(360 Bytes) Downloaded 101 times
GOTOX.c
(330 Bytes) Downloaded 97 times
GOTOB.c
(381 Bytes) Downloaded 92 times
20181003_105952.jpg

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

Re: Motor brake

Post by TomKerekes » Wed Oct 03, 2018 4:05 pm

Hi cnc_freak,

That makes sense. You can not run GCode or MDI commands if all the Axes in the defined Coordinate System are not enabled. If you want to run GCode or MDI commands with Axis B disabled then B should be removed from the Coordinate System beforehand. See the example code below. A better approach might be to have the B axis normally excluded instead of included and only include it when the B axis is enabled. That would seem more logical to me and might avoid other issues.

Note you were also missing curly brackets so you would have a bad result if the Operator hit cancel.

Code: Select all

#include "KMotionDef.h"
#define TMP 10					// which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

main()
{
	int Answer;
	float value;
	char p[100];

	Answer = InputBox("Enter Distance to go X", &value);
	if (Answer)
		printf("Operator Canceled\n");
	else
	{
		DefineCoordSystem8(0,1,2,3,-1,-1,6,7);  // remove B from Coordinate System
		sprintf(p, "G0X%3.1f", value);
		MDI(p);
		DefineCoordSystem8(0,1,2,3,4,-1,6,7);   // include B in the Coodinate System
	}
}
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply