CoordMotion A-Axis Failure

Moderators: TomKerekes, dynomotion

Post Reply
MSdfarhner
Posts: 3
Joined: Wed Mar 07, 2018 6:59 pm

CoordMotion A-Axis Failure

Post by MSdfarhner » Thu Mar 08, 2018 6:12 pm

Hello,

We're bringing up a test suite on Tactile Automation's TakTouch 1000, with motions being executed via CoordMotion, developed in C#.
We can successfully operate the X, Y, Z and B (peripheral) axes via CoordMotion using the below command, but when attempting to control the A (tool rotation) axis, we get a StackOverflowException.

public void StraightFeed(double feedrate, double x, double y, double z, double a, double b, double c, int sequence_number, int ID)

(Implemented as below)
this.controller.CoordMotion.StraightFeed(velocity, x, y, z, rotation, pinchZoom, 0, this.CommandedLocations.Count, this.CommandedLocations.Count);

For example, the below two sets of parameters to the call represent two moves: a simple, successful 10mm X move, and a solely rotational move.

velocity: 1.968...
x: -7.035...
y: -9.373...
z: -3.314...
rotation: -4.827...
pinchZoom: 0
....Count: 0

velocity: 2
x: -7.035...
y: -9.373...
z: -3.314...
rotation: -135
pinchZoom: 0
....Count: 0

(Our sequence_number and ID values are probably not as intended, but it hasn't been an issue before)

We have also tried manually entering values identical to successful calls, and still gotten StackOverflowExceptions. Investigating the Exception revealed nothing.

Do you have any suggestions for narrowing down the issue?

Let me know if I can clarify anything.

Thanks!

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

Re: CoordMotion A-Axis Failure

Post by TomKerekes » Thu Mar 08, 2018 7:40 pm

What Version of KMotion are you running?

I thought there might have been a Fix regarding something like that some time ago. Or with AB fixture offsets.

The most direct way of figuring it out would be to step into the code to see what is happening. Feeds are recursively subdivided until they are smaller than some limit specified. An infinite size move or a zero limit could cause a stack overflow.
Regards,

Tom Kerekes
Dynomotion, Inc.

MSdfarhner
Posts: 3
Joined: Wed Mar 07, 2018 6:59 pm

Re: CoordMotion A-Axis Failure

Post by MSdfarhner » Fri Mar 09, 2018 11:24 pm

Sorry for the delay - it took some finagling to get set up stepping into the KMotion code from ours. I need to do more digging, but it looks like it may be stuck recursively calling StraightFeedAccelRapid in CoordMotion.cpp.

We're using KMotion 4.33.

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

Re: CoordMotion A-Axis Failure

Post by TomKerekes » Sat Mar 10, 2018 2:19 am

Please try the latest Test Version from here:
http://www.dynomotion.com/wiki/index.ph ... ion_Topics

Here is the code in CoordMotion.cpp that decides to recurse or not. You might look at the variables at that point to see why it is continuously recursing. Basically if d > MaxLength it recurses.

Code: Select all

	BOOL pure_angle;

	// compute total distance tool will move by considering both linear and angular movements  

	double d = FeedRateDistance(dx, dy, dz, da, db, dc, &pure_angle);

	if (d==0.0 && !RapidMode) return 0;  // ignore zero length moves

	// if this move is expected to take more than 1/2th of the download time then break int0 2 parts (recursively)
	// (or if greater than the Kinematics length (line might actually be curved in actuator space)

	MaxLength = FeedRateToUse * MP->TPLookahead/2.0;
	if (MP->MaxLinearLength < MaxLength) MaxLength = MP->MaxLinearLength;

	if (!m_Simulate && !pure_angle && d > MaxLength)

Regards,

Tom Kerekes
Dynomotion, Inc.

MSdfarhner
Posts: 3
Joined: Wed Mar 07, 2018 6:59 pm

Re: CoordMotion A-Axis Failure

Post by MSdfarhner » Mon Mar 12, 2018 6:09 pm

I ended up continuing to dig and follow the code through CoordMotion.cpp with monitoring d in mind.
It ended up being that RadiusA had not been set in the CoordMotion MotionParams setup. Because RadiusA was at 0, nothing iterated.
Once RadiusA was set to 1 (as per KMotion CNC settings provided by Tactile Automation), things worked smoothly!

Sorry, I didn't end up trying the latest test version.

Thanks!

Post Reply