Hurco BMC20 Dynomotion Retrofit - Page 23


Page 23 of 23 FirstFirst ... 1320212223
Results 441 to 459 of 459

Thread: Hurco BMC20 Dynomotion Retrofit

  1. #441
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,

    For me i dont need to see the on screen status if my LED would be in sync.
    If you Hide the on screen checkbox that should solve the problem as the Operator could then never change the state. The KFLOP C Program would need to put them in sync initially. For example during initialization you could read the state of your LED and set the screen checkbox to match.

    We did create a patch for Version 4.35b to inform KFLOP of the Block Delete Checkbox state. It is handled in the same way JOB_ACTIVE is set in KFLOP whenever KMotionCNC reads status which happens continuously. BLOCK_DELETE_CHECKED is now supported. Here is an example that sets a KFLOP LED to match Block Delete:

    Code:
    #include "KMotionDef.h"
    
    void main()
    {
        for(;;)
            SetStateBit(46,BLOCK_DELETE_CHECKED);
    }
    To use the patch:

    Copy KMotionCNC.exe to C:\KMotion435\KMotion\Release
    Copy KMotionDef.h to C:\KMotion435\DSP_KFLOP
    Copy PC_DSP.h to C:\KMotion435\DSP_KFLOP

    Note KFLOP's Firmware doesn't need to be updated as the existing status word is used. Only new definitions are needed for a User Program to access new bits of the existing status word.

    Regards
    TK http://dynomotion.com


  2. #442
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Tom,
    Patch works great.Great job again. Its nice getting these seemingly small things working and off my list.

    Now i got the Jog Buttons, Feed Forward and Reverse Buttons and a Optional Stop button if possible.

    Can a button and LED be used in a similar manner as the Block Delete button for Optional Stop M01?

    Forgot, here is a few pics of control.

    Thanks,
    Troy

    Attached Thumbnails Attached Thumbnails Hurco BMC20 Dynomotion Retrofit-img_0003-jpg   Hurco BMC20 Dynomotion Retrofit-img_0002-jpg   Hurco BMC20 Dynomotion Retrofit-img_0001-jpg  
    www.tsjobshop.com, www.homecncstuff.elementfx.com


  3. #443
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,

    KMotionCNC doesn't directly support Optional Stop M1 and by default does not stop on M1.

    However you can cause it to stop by configuring an M1 action to "Stop Next Line" such as with:

    Code:
    #include "KMotionDef.h"
    
    #define TMP 10 // which spare persist to use to transfer data
    #include "KflopToKMotionCNCFunctions.c"
    
    
    void main()
    {
        DoPC(PC_COMM_HALT_NEXT_LINE);
    }
    And of course this can be conditional based on whether an LED is on or other.

    HTH

    Regards
    TK http://dynomotion.com


  4. #444
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    So i got the M1 to operate when the OptStop LED is on but when gcode gets to a M1 it stops at next line then gcode cursor/arrow restarts to beginning and stops.
    In the Tool Setup Screen of KMCNC i set a M1 action as Exec/Wait, Thread3, Var 0, and the below C code. Also tried action Exec/Wait/Sync. I remember something like this a while back but cant remember what was causing it to restart.

    Code:
    #include "KMotionDef.h"
    
    #define TMP 10					// which spare persist to use to transfer data
    #include "KflopToKMotionCNCFunctions.c"
    
    
    main()
    {
    
    	if (ReadBit(1060) == 1)		//OptStop LED
    		DoPC(PC_COMM_HALT_NEXT_LINE);
    
    }
    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  5. #445
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Found it/ Remembered it

    I had a Action for Halt to execute a ccode that has a Restart command in it. Now that i have a button that does the same thing in my main init code i dont need the Halt action.

    Found a issue with the overrides potentiometer code. It is affecting my pendant MPG code . When i move any axis in the minus direction at a fairly fast speed , the axis will jerk like it cant keep up with how fast iam spinning the MPG. This happens for all 3 axis. If i remove the override potentiometers code there is no jerking movement. Is this because of the below code? Also attached my current init file.
    Code:
    #define TAU 0.08				// smoothness factor (Low Pass Time constant seconds)
    #define FINAL_TIME 1.0			// Set final dest after this amount of time with no change
    
    #define MAX_JOG_SPEED_X 510.0	// ipm
    #define MAX_JOG_SPEED_Y 510.0	// ipm
    #define MAX_JOG_SPEED_Z 510.0	// ipm
    
    // From SetFROwithpot.c and SetSSOwithpot.c
    #define CHANGE_TOL 0.005		// only update if change is more than this
    #define CHANGE_TIME 0.02		// don't update more often then this time

    Troy

    Attached Files Attached Files
    Last edited by Need TECH Help!; 04-17-2020 at 08:45 PM.
    www.tsjobshop.com, www.homecncstuff.elementfx.com


  6. #446
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,


    When i move any axis in the minus direction at a fairly fast speed , the axis will jerk like it cant keep up with how fast iam spinning the MPG. This happens for all 3 axis. If i remove the override potentiometers code there is no jerking movement.
    Maybe the loop time is becoming too long to monitor the MPG encoder when changing at a high rate. I do see we have 2 WaitNextTimeSlice() calls in the loop. One at the top of the loop and one in the MPG code. Remove the 1st wait by changing:

    T = WaitNextTimeSlice();

    to

    T = Time_sec();

    Does that solve the issue?

    Regards
    TK http://dynomotion.com


  7. #447
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Tom,
    It does help to smooth out the jerk a little but it is still rough axis movement only in the minus direction still.

    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  8. #448
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,

    I think I know what is going on. The MPG code is monitoring the Encoder Quadrature in software and if the loop time is too long it misses a count. Think of the quadrature as a counter that counts 0 1 2 3 then repeats. If from one sample to the next there isn't any change then there isn't any counts. A change from 2 to 1 is a change -1. A change from 3 to 0 is a change of +1. And so on. The problem occurs when we miss a count and there is a change of 2. It isn't possible to know if the change was +2 or -2. The original code always assumed +2 which was correct when going in the positive direction but wrong when going negative.

    I made a change that in the case of a change of 2 instead of always assuming +2 to use either +2 or -2 based on the last valid direction moved. This seems to work well.

    I also optimized the code a bit. The original code had a "wraps" feature that was intended to properly handle missing many counts. For example say the last sample was 1 and the new sample was 2. This could be a change of +1 or a change of +5 or a change of -3 if we missed some counts. The code analyzed previous changes to determine which made sense based on the fact that the speed can't change instantly. But this has a problem where jitter or noise could sometimes cause the algorithm to get confused and cause runaway where no changes were considered to be fast motion of one or more "wraps". We had removed this feature by deleting a term but left much of the code. I removed all this and replaced it with a fast table lookup method, The new method that handles missed counts (changes of + or - 2) should not have any runaway possibility. A change of 0 will always be no motion,

    I've attached the changed file with some additional cleanup based on the last Init file you posted.

    Please see if this solves the issue.

    Note an alternate and better approach would be to use a hardware encoder input.

    Attached Files Attached Files
    Regards
    TK http://dynomotion.com


  9. #449
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hay Tom,
    Thats a great explanation of how it works.
    The MPG is smoother than ever with your revised code! Thanks a bunch for all the work.

    If i can successfully switch drives over to Analog soon, i should have a free encoder input. I think i remember you stating this before when we first got MPG working.

    In a couple days i will get back onto the remainder of buttons on my control panel. Jog Buttons and the Feed Forward,Reverse buttons.

    Thanks again Tom,
    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  10. #450
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Tom,
    Did some more test with updated INIT v3.6 and there is an issue with the FeedHold button. It sometimes takes 2 or 3 very fast presses of button to execute a FeedHold. A few times the FeedHold button would not execute a FeedHold at all.

    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  11. #451
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,

    I can't see anything wrong. When you push the Feedhold button does Bit 58 (the Feedhold LED) always come on?

    Is this printed on the console? printf("Decel time = %f\n", CS0_DecelTime);

    I see the CycleStart button turns off FeedHold. Is there noise or something on it? You might comment out the ResumeCoordinatedMotion(); to see if it is the culprit.

    Regards
    TK http://dynomotion.com


  12. #452
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    So now i got something totally new happening.Main INIT code is not running correctly. The INIT does not recognize inputs including the Estop even tho Kmotion shows that it is running(Green bar across thread 1).And when checking inputs in Kmotion I/O screen all inputs show that they are working correctly.

    Tried using older INIT codes that worked with no problem before but still same issue. So i tried uninstalling Kmotion and installed v4.34 and re configured KMCNC, still same issue.

    Currently I have reinstalled Kmotion4.35b and configured KMCNC from scratch and using the Standard 3Axis screens. Now when i run main INIT code Kmotion shows nothing has happened in the Console and KMCNC has a pop up window stating "Encountered an improper Argument". Compiling INIT code in Kmotion shows no errors.

    I noticed these issues started after running the ccode that captures motion during a gcode, and then used the INIT code version 3.6. Have also re flashed KFLOP a couple times and even tried the Recovery Flash. Also removed the Thread Launching at boot up.

    The last thing i did on machine was the last 45* test cuts i ran a couple days ago that i posted in the other forum thread.(https://www.cnczone.com/forums/dynom...gree-wall.html)

    Any ideas what has happened?

    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  13. #453
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Got something to repeat.
    1. Launch KMCNC use on screen KMCNC button to run INIT. Code seems to run , enabling machine control relays. But no indication that Estop is still active or my other pop ups. Kmotion Console shows nothing. Ccode screen shows thread is running.

    2. Close KMCNC which also disables machine control relays.
    3. Launch KMCNC. Now Kmotion console states "Result=0" , "CurrentTool=5". And KMCNC has pop up "Gcode error Tool Slot Not Found In Tool Table" after this my pop up "E-STOP is Active" and last my "VFD Fault pop up".
    4. Run INIT code from on screen KMCNC button, pressed physical button for Block Delete and get the pop up "Encountered an improper Argument". Try inputs again, like Estop and nothing happens.

    After this i reconfigured my tool table to remove the Tool Slot Error, shutdown KMCNC and ran main INIT v3.2 in Kmotion, which is before i started adding any physical buttons or the 2nd Konnect and only had an Estop button. Then launched and configured KMCNC to use INIT code 3.2 , used on screen INIT button and now code is recognizing my Estop button followed by my pop up messages as normal.

    Last edited by Need TECH Help!; 04-26-2020 at 11:15 AM.
    www.tsjobshop.com, www.homecncstuff.elementfx.com


  14. #454
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,

    "Encountered an improper Argument"
    I think this happens when your Init file tries to click a Screen Script Screen Button when KMotionCNC is not configured to use a Custom Screen Script. This puts KMotionCNC in an unstable state and then needs to be restarted. We should handle that better. I doubt if that relates to the original problem but causes confusion.

    I can't follow all that but I think when something simple like EStop doesn't work rather than starting to swap versions and such it would be better to trouble-shoot it step-by-step. Make a list of the sequence of things that have to happen for it to work. ie. Hardware button must work, Konnect must be configured to read buttons, C Program must be running, Input must be debounced, EStop code executed. Then run diagnostics and tests to determine what step isn't working. One trick I sometimes use when adding a printf would flood the Console with messages is to increment or set a value of an unused axis. For example placing:

    ch7->Position++;

    in the code will allow you to see on the Axis Screen how many times that section of code is being executed.

    HTH

    Regards
    TK http://dynomotion.com


  15. #455
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Tom,

    I think this happens when your Init file tries to click a Screen Script Screen Button when KMotionCNC is not configured to use a Custom Screen Script.
    I have this line of ccode right before the forever loop...
    Code:
    ScreenScript("WinMsg:DlgName;IDC_But12;BM_CLICK");	//AUTO Screen
    Whenever the the INIT program is executed , this will make my AUTO screen the current screen.
    Should i be doing this another way?

    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  16. #456
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,

    Whenever the the INIT program is executed , this will make my AUTO screen the current screen.
    Should i be doing this another way?
    It should be ok. Just make sure your Screen Script is configured in KMotionCNC and not any of the non-custom dialog faces.

    Regards
    TK http://dynomotion.com


  17. #457
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Tom,
    It should be ok. Just make sure your Screen Script is configured in KMotionCNC...
    What do you mean configured in KMCNC?

    Back to the FeedHold issue before...
    When you push the Feedhold button does Bit 58 (the Feedhold LED) always come on?
    Only when the FeedHold actually happens.

    Is this printed on the console? printf("Decel time = %f\n", CS0_DecelTime);
    When the FeedHold actually happens.

    I see the CycleStart button turns off FeedHold. Is there noise or something on it? You might comment out the ResumeCoordinatedMotion(); to see if it is the culprit.
    Has no effect. The FeedHold still does not happen.
    Using the Gcode below see notes where the FeedHold will not work or is very delayed. Tested with INIT v3.5 with no FeedHold problems.
    Code:
    %
    O1001 (45MILLTESTFIN)
    (T5 D=0.5 CR=0.005 - ZMIN=-0.425 - BULLNOSE END MILL)
    N1 G90 G94 G17 G49 G40 G80
    N2 G20
    N3 G53 G00 Z0.
    
    (2D CONTOURFINISH 2)
    N4 T5 M06
    N5 S2500 M03
    N6 G54
    N7 M08
    N8 G00 X0.9137 Y-1.3892
    N9 G00 G43 Z1. H05
    N10 G00 Z0.2
    N11 G01 Z0.0394 F5.<<<FeedHold fails here
    N12 G01 Z-0.425
    N13 G01 G41 X1.1887 Y-1.3392 D05 F20.<<<FeedHold fails here,sometimes
    N14 G03 X0.8637 Y-1.0142 I-0.325 J0.
    N15 G01 X-1.1363<<<About halfway threw this move FeedHold will not work.
    N16 G01 X-2.575 Y0.4245
    N17 G03 X-3.0346 I-0.2298 J-0.2298
    N18 G01 G40 X-2.8755 Y0.1947
    N19 G00 Z1.
    
    N20 M09
    N21 M09
    N22 M05
    N23 G53 G00 Z0.
    N24 G49
    N25 G53 G00 X11. Y0.
    N26 M30
    %
    Also, in order for me to get v3.6 to compile i changed this line....
    #include "c:\KMotionSrc\C Programs\KflopToKMotionCNCFunctions.c"

    to this...

    #include "KflopToKMotionCNCFunctions.c"

    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  18. #458
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    553
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hay Tom,
    I compared v3.5 to 3.6. And at the beginning of ccode v3.5 has this include that v3.6 does not...
    #include "AdjustSoftLimits.c"

    So i added it to v3.6 and have done the same FeedHold test that i have been doing and with the #include "AdjustSoftLimits.c" in v3.6 FeedHold is working like it should. Tested several times with the AdjustSoftLimits in ccode and FeedHold works. Also tested by removing the AdjustSoftLimits and FeedHold stops responding again. Is this a fluke of some sort?

    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


  19. #459
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    3382
    Downloads
    0
    Uploads
    0

    Default Re: Hurco BMC20 Dynomotion Retrofit

    Hi Troy,

    It should be ok. Just make sure your Screen Script is configured in KMotionCNC...
    What do you mean configured in KMCNC?
    In KMotionCNC | Tool Setup | Tool/Setup Files | Main Dialog Face should be "Custom" and your Screen Script.


    Also, in order for me to get v3.6 to compile i changed this line....
    #include "c:\KMotionSrc\C Programs\KflopToKMotionCNCFunctions.c"

    to this...

    #include "KflopToKMotionCNCFunctions.c"
    Yes. Sorry my mistake.


    Back to the FeedHold issue before...
    That is all very strange. Adding in dead code or running GCode shouldn't make a difference.

    The only thing I can think of is slight timing variations. I noticed that the loop is quite long and borderline on using an entire Time Slice. Also the debounce time is set fairly long at 300 loops.
    #define DBTIME 300

    With one Thread running and executing in one Time Slice the debounce time = 180us x 300 = 0.054 seconds. If it takes 2 Time slices that would be 0.108 seconds. Could it be you are just not holding the button down long enough? Or maybe the button isn't making solid contact. The switch needs to be completely closed for 0.108 seconds to be recognized. Here is an article that shows typical switch bouncing is only about 1 milliseconds. So we could try reducing the DBTIME to a much smaller number.

    I suppose noise glitches could also be an issue. Periodic noise glitches would appear as switch bouncing and result in the button not being recognized.

    Regards
    TK http://dynomotion.com


Page 23 of 23 FirstFirst ... 1320212223

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Hurco BMC20 Dynomotion Retrofit

Hurco BMC20 Dynomotion Retrofit

Hurco BMC20 Dynomotion Retrofit