Changed C program?

Moderators: TomKerekes, dynomotion

Scott Pancheau
Posts: 50
Joined: Sat Dec 28, 2019 10:52 pm

Re: Changed C program?

Post by Scott Pancheau » Tue Jan 18, 2022 5:22 pm

Hi Tom,
I know you have to respond to many questions every day and thus you probably would not remember, but my second post in this exchange says the same thing about the spindle. It worked after you tuned it up when you had control of the computer. Now it does not and I have not messed with any of the programming since you finished, and have not changed any connections in regard to it. I also mentioned my other lathe you tuned a couple of years ago does the same thing. It accelerates to a high speed as soon as kmotion is initialized , then slows to a stop, reverses and goes the other direction and continues this cycle a few times getting less force full each time and eventually settles down to zero speed and is then good for the rest of that initialization cycle. This lathe cannot complete this action because it does not have enough supply power to accelerate that quickly. The DC drive trips out. I will attach the copy of the TK C program here. Please let me know if you want to see any other programs under the CNC Lathe main file.
Thanks again Tom,
Scott
Attachments
C PROGRAM BY TK 4   1  16  22.PNG
C PROGRAM BY TK 3   1  16  22.PNG
C PROGRAM BY TK  2   1  163  22.PNG
C PROGRAM BY TK 1  16  22.PNG

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

Re: Changed C program?

Post by TomKerekes » Tue Jan 18, 2022 6:31 pm

Hi Scott,

Please attach the C Program as a .c file rather than photos of pieces of it.

To see what is happening please do do the following:

#1 Import into KMotion All the settings from the C Program
#2 On the Step Response Screen select axis 4
#3 On the Step Response Screen Push the Zero button.
#4 On the Axis Screen observe the #4 Destination and Position. Are they Zero?
#5 On the Step Response Screen set the size to 0 and Push "Move" to configure and enable the Axis
#6 what did the Spindle do? Is the Spindle enabled?
#7 post the Step Response Screen and the data
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 50
Joined: Sat Dec 28, 2019 10:52 pm

Re: Changed C program?

Post by Scott Pancheau » Thu Jan 20, 2022 10:17 pm

Hi Tom, Your item #1 import into kmotion. Just want to make sure I did this right. I opened the channel setup screen, input chanel 4 at top,then with the C program open I pressed the import all from open program. I got the 3 axis found message 0,1, and 4 . Pressed the import all from open C. If that was not correct then I did not do what you wanted. The step response buttons did then work in so far as enable, zero and move. For some reason as soon as I enable I get a voltage output. If I disable it goes back to zero. If I push the move button with 0 move I get the same 40 as you see on the axis screen and the spindle moves even though it is a zero move. Hope I have attached all you want to see.
Attachments
CNCLathe TK c program 1 20 22.c
(3.92 KiB) Downloaded 52 times
step response with 0 input move  1  20  22.PNG
step response data fo 0 move 1 20 22.txt
(401.87 KiB) Downloaded 48 times

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

Re: Changed C program?

Post by TomKerekes » Fri Jan 21, 2022 12:26 am

Hi Scott,

That looks to be classic positive feedback runaway with the motor driving away from the target making the error larger rather than toward the target to make the error smaller.

Limiting the Error to 200 and with only a P Gain of 0.2 limits the Output to 200 x 0.2 = 40 DAC counts. So the DAC quickly goes to -40 and remains there.

Reverse either the InputGain0 or OutputGain0. The first will reverse the direction the encoder counts the second will not.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 50
Joined: Sat Dec 28, 2019 10:52 pm

Re: Changed C program?

Post by Scott Pancheau » Mon Jan 24, 2022 4:06 pm

Hi Tom,
I reversed the output gain from 1 to 0. Got the same result. As soon as I enable kmotion the spindle takes off. I have the snap amp installed with the correct 80 volt max power supply for the X axis that would not tune when we last got together on it. I would like to set a time for you to get the X axis running and figure out what is wrong now with the spindle. Please advise a time that will work and send an invoice.
Thanks,
Scott

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

Re: Changed C program?

Post by TomKerekes » Mon Jan 24, 2022 4:14 pm

Hi Scott,

If 1 it should be changed to -1 to reverse not 0. But then 0 Output Gain should never have any output at all. Maybe you changed the program and didn't import the change into the KMotion.exe Screens? You might read this about which parameters are active.

How about Wed 1/26/22 9:30am PST?
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 50
Joined: Sat Dec 28, 2019 10:52 pm

Re: Changed C program?

Post by Scott Pancheau » Wed Jan 26, 2022 2:41 pm

Hi Tom,
I went back and changed the output gain to -1. That changed the response when spindle is enabled to the spindle hunting back and forth positive voltage , negative voltage outputs with spindle rotating CW, CCW in response. This just continues until the disable is pushed. Went to kmotion to see if there was any change there. The spindle just tries to take off full speed as soon as kmotion is initialized. I really just want to get the lathe up and running. I know you would prefer that I would sort through these problems myself, but I want to just set up to get with you again and finish getting the spindle problem resolved and the X axis implemented with the snap amp. Please let me know if there is a time we could set up and if you will send the advance invoice I will get it paid.
Thanks,
Scott

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

Re: Changed C program?

Post by TomKerekes » Wed Jan 26, 2022 6:25 pm

Hi Scott,

I proposed doing it this morning, but we missed that. I could do:

Tomorrow 1/27/22 9:30am PST?
or
Monday 1/31/22 9:30am PST?
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 50
Joined: Sat Dec 28, 2019 10:52 pm

Re: Changed C program?

Post by Scott Pancheau » Thu Jan 27, 2022 3:53 pm

I could do this morning if still available Tom. If not then the Monday date / time would work as well. My email is spancheau@gmail.com

Thanks,
Scott

Post Reply