totally overwhelmed! start over info

Moderators: TomKerekes, dynomotion

Moray
Posts: 288
Joined: Thu Apr 26, 2018 10:16 pm

Re: totally overwhelmed! start over info

Post by Moray » Tue Mar 26, 2019 9:56 pm

The differential inputs on Kanalog are labelled as if you're going to use them for an encoder. So A0 and B0 inputs mean channel 0, however if you just want to use a single differential input as a more generic input (aka an index signal), you need to check what pin it connects to on the KFlop, then find it's input number.

So going from the Kanalog help page (http://dynomotion.com/Help/SchematicsKa ... analog.htm), JP2 connect to KFlop I/O bits 36-43 via JP5.
So if you run through the inputs in order, you get the following input map-
A4 = 36
B4 = 37
A5 = 38
B5 = 39
A6 = 40
B6 = 41
A7 = 42
B7 = 43

The reason for this, is within the FPGA that all these inputs ultimately go, are some dedicated encoder counters. These rely on the encoder inputs being connected to dedicated pins, however those pins can be configured as general purpose inputs/outputs. When accessing the encoder counters, you access them via a channel number, whereas when you use them as general inputs/outputs, you access them via a bit number bypassing the encoder counter.

turbothis
Posts: 325
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: totally overwhelmed! start over info

Post by turbothis » Tue Mar 26, 2019 10:13 pm

ya i think thats what i am doing right?

if the output channel uses A2+, A2-, B2+ and B2- encoder inputs, it can use any of the 36-43 for Z index right?

Moray
Posts: 288
Joined: Thu Apr 26, 2018 10:16 pm

Re: totally overwhelmed! start over info

Post by Moray » Tue Mar 26, 2019 10:20 pm

turbothis wrote:
Tue Mar 26, 2019 10:13 pm
ya i think thats what i am doing right?

if the output channel uses A2+, A2-, B2+ and B2- encoder inputs, it can use any of the 36-43 for Z index right?
Yes, the index can use any suitable and available input.

turbothis
Posts: 325
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: totally overwhelmed! start over info

Post by turbothis » Tue Mar 26, 2019 10:58 pm

great
i am not sure why my Z index pulse is not coming through
i think the C program is correct

Moray
Posts: 288
Joined: Thu Apr 26, 2018 10:16 pm

Re: totally overwhelmed! start over info

Post by Moray » Tue Mar 26, 2019 11:22 pm

Might be worth writing a small C program that simply prints a message to the terminal when the input changes, to confirm the Z signal is working.

Something like this-

Code: Select all

#include "KMotionDef.h"

#define TESTBIT 37	// set to bit being watched
#define LASTSTATUS 48 // set to an unused virtual bit

int main()
{
	for (;;) // loop forever
	{
		if(ReadBit(TESTBIT) != ReadBit(LASTSTATUS))
		{
			if(!ReadBit(LASTSTATUS))
			{
				printf("Input changed\n");
				SetBit(LASTSTATUS);
			}
			else
			{
				ClearBit(LASTSTATUS);
			}
		}
	}
}
Set the define TESTBIT to the input bit you're wanting to test, and make sure LASTSTATUS is set to an unused virtual bit.
Run that with the Console window open in KMotion, then turn the motor by hand a few times. Each time the index pulse gets passed, "Input changed" should get printed to the Console. If the message doesn't show, then either you're monitoring the wrong bit, or there is an issue with your index pulse.

turbothis
Posts: 325
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: totally overwhelmed! start over info

Post by turbothis » Wed Mar 27, 2019 1:42 am

ok great help!
i was thinking it was this

Image


and it turns out to be this way, i must have missed this some where in the instructions? :?

Image

so now i get the A axis phase finding and ready
now i just cant get rid of the nan issue for the Y and A axis.

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

Re: totally overwhelmed! start over info

Post by TomKerekes » Wed Mar 27, 2019 1:49 am

Correct, a differential signal takes a + and a - signal/wire to make one bit
Regards,

Tom Kerekes
Dynomotion, Inc.

turbothis
Posts: 325
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: totally overwhelmed! start over info

Post by turbothis » Wed Mar 27, 2019 1:58 am

i was fixated on the analog outputs being a bit pin each. not in sets!

turbothis
Posts: 325
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: totally overwhelmed! start over info

Post by turbothis » Wed Mar 27, 2019 2:16 am

got a short video of my numbers and also the strange noise or input going on to the feed rate slider
i punched in axis values that are on my mill with the same version of kmotion and still get the "nan"
https://youtu.be/M0AlbksDLxQ

turbothis
Posts: 325
Joined: Fri Mar 15, 2019 4:07 pm
Location: southern oregon

Re: totally overwhelmed! start over info

Post by turbothis » Wed Mar 27, 2019 2:25 am

lol, my goodness i zero out the axis values for the Y on this machine and now get this -inf?
is there a library of all these some where i missed?

Image

Post Reply