Page 1 of 2

ADC Screen

Posted: Fri Dec 11, 2020 10:24 pm
by GabrielR922
Hi Tom!

Me again!

Maybe it's a dumb question, but i cant figure it out!

My VFD can output a analog output based on the current.

Wired the ADC and can read in the console.

How can I show the ADC value in the screen? Can't find the right command.

Also, can I make a slide bar with it ? Similar to feed, but for the load of the spindle.

Thanks Tom!

Re: ADC Screen

Posted: Sat Dec 12, 2020 4:32 pm
by TomKerekes
Hi Gabriel,

Please see this post on cnczone which shows the example ShowInstantVelocityDROBar.c + ShowInstantFeedRate3AxisBar.scr to display a rate as a DRO and Verical bar graph. Of course you would display the ADC reading instead.

Also attached is a similar example to display Spindle RPM but using a non-blocking method (no delays).

HTH

Re: ADC Screen

Posted: Wed Dec 16, 2020 2:04 pm
by GabrielR922
Hi tom.
Have a mega problem.

I flashed user memory without any thread marked to launch and with a program.

The board connect to USB
But the message appear :

Kmotion present but not responding
Correct Problem and restart application.


Unwired all from kflop (power from usb now), it boots ok, USB is ok, but kmotion cant connect to it.
Reinstalled drivers, tried another pc, reinstalled kmotion also.

Re: ADC Screen

Posted: Wed Dec 16, 2020 2:42 pm
by GabrielR922
Hi Tom.

Managed to recover it.

I had to wait recovery load a little bit and then connect the kflop board.

If i plugged it right when the message "turn on board" appeared, it connect and disconnect and fail.

Almost had a heartattack here.

Thanks!

Re: ADC Screen

Posted: Wed Dec 16, 2020 6:21 pm
by GabrielR922
Tom,

Another question;

Is there a way to put a led in the kmotioncnc screen?

Then i would make C program to turn on the led when a input is high.

Thanks!

Re: ADC Screen

Posted: Wed Dec 16, 2020 6:29 pm
by TomKerekes
Hi Gabriel,

See the KMotionCNC Screen Editor.


Re: ADC Screen

Posted: Wed Jan 20, 2021 1:22 am
by GabrielR922
Hi Tom!

Been some time since we last talked. How are you doing ?
I'm getting some progress with my machine and the retrofit, the rotary tool changer is almost 100% configurated.

Right now I started to clean the screen and develop the way it suits better for me.

The ADC's works great and I managed to get Spindle Load and Axis load also, but i'm stuck with a problem.
I want to use buttons to control feedrate override, similar to mach3, +10% -10%.

I could do a C program to control the feed based on last pressed button, that would work.
If FR is at 100% and I press -10%, it goes to 90%, If I change the slider, it would go to a random value (ex 110%) and if I press -10% button again it would go to 80%.

Is there a way to read FRO before use the -10% button so if it was at 110% it would go to 100%?
I found PC_COMM_SET_FRO, but not the "get" one.

Attached a pic of the current screen (under development)

Re: ADC Screen

Posted: Wed Jan 20, 2021 5:56 am
by TomKerekes
Hi Gabrriel,

You can use:

DoPCFloat(PC_COMM_SET_FRO_INC,1.1f);

to increase the FRO by 10%

The variable CS0_LastFRO is the last FRO commanded.

Re: ADC Screen

Posted: Wed Jan 20, 2021 1:05 pm
by GabrielR922
Hi Tom.

I'm very newbie at C coding.
Does CS0_LastFRO need the machine to be in feedhold mode or can I read it and change the feed while the machine is running ? Will it have delay (just curios, ok if have)?

Also, is it limited to 1? if i move FRO slider to 1.5 it prints 1, but anything lower than 1 gives the correct value.

extern float CS0_LastFRO;
printf("%2.2f\n", CS0_LastFRO);

Thanks Tom!

Re: ADC Screen

Posted: Wed Jan 20, 2021 4:14 pm
by TomKerekes
Hi Gabriel,

KMotion has Hardware and Software FRO. See here.

You can use the function void SetFRO(float FRO); to instantly change the hardware FRO in KFLOP.