Build Thread Tree325 Retrofit Started - Page 12


Page 12 of 18 FirstFirst ... 29101112131415 ... LastLast
Results 221 to 240 of 343

Thread: Tree325 Retrofit Started

  1. #221
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by TomKerekes View Post
    .... What is the lowest speed that it runs well at?
    It would seem that DAC=60 which is 273 RPM at the Spindle were spindle seems run smooth without any jerking or making funny noises


    Quote Originally Posted by TomKerekes View Post
    ....
    Can the DAC drive the spindle both directions?
    Yes. If I supply the DAC with a negative value the spindle will rotate in the CCW direction.


    Quote Originally Posted by TomKerekes View Post

    I forget do you have an encoder on the Spindle? One would be required to do rigid tapping.

    If so after it is connected up and working the next step would be to configure an axis just like your XYZ and tune it in a similar way using the Step Response Screen. Performance will be very poor with lower gains poor accuracy but it should move and function. At that point you should be able to Jog the spindle at any speed. We can then configure KMotionCNC to use the Example Programs that control any spindle via Jog commands.
    I do not think I have a encoder on this motor or at least I do not see any wires coming from the existing controller that would reflect that there is an encoder. Based on the Tree schematic page-8, if I know what I am looking at, there is no encoder.

    So I am thinking that I need to do what mmurray70 is suggesting.

    Quote Originally Posted by mmurray70 View Post

    You need to do a few very simple C programs before g code commands will work. You need one configured for the M3 command which basically just turns that opto output on, you need another for M5 to turn it off, and another one is used to set the DAC value to get the right speed based on the "S" value.

    There are two ways of setting up the spindle. You can do it open loop which is basically like I described above. Or you can configure it like an axis like Tom suggested. Id reccomend you go that route since Tom suggested it. But if you run into much trouble tuning spindle, or you dont have a spindle encoder at all, dont worry about it too much. It will probably run just fine without being configured as an axis. Mine is just open loop and it works great. And it will still do rigid tapping (assuming you have an encoder) without being configured as an axis.
    So if I need to start writing a "few very simple C programs" are their any I can use for a good starting point that came with KMotion as defaults where DAC values are used on Kanalog output JP11 (#7) ? Or would anyone be able to share what they are using base on DAC values from JP11?

    These are the values I got from testing different DAC values in KMotion and the RPM readings I got at the motor shaft and spindle shaft.

    Tree325 Retrofit Started-dac_to_rpm-xlsx-jpg Link to Spreadsheet

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....



  2. #222
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Try these files. You will need to change the extenstion to .C instead of .c.txt. You will need to specify what output bit number you are using in the M3 and M5 programs.

    For the spindle program you will need to set kmotioncnc to use VAR 9, and also its set to use DAC 3, you may need to adjust if you are using a different DAC. Good luck with it. See if we can get this working before we worry about CCW.

    Attached Files Attached Files


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

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    I plotted your data and added a trendline through zero. It looks nice and linear:

    Tree325 Retrofit Started-dacvsrpm-png

    I think the factor in mmurray70's Spindle.c for you should be 0.2228

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  4. #224
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by TomKerekes View Post
    Hi PeterTheWolf,

    I plotted your data and added a trendline through zero. It looks nice and linear:

    Tree325 Retrofit Started-dacvsrpm-png

    I think the factor in mmurray70's Spindle.c for you should be 0.2228

    HTH
    Regards
    Yes your right Tom, sorry I used "Motor RPM" values instead of "spindle RPM"

    Just edit the spindle.c file peter.



  5. #225
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by mmurray70 View Post
    Try these files. You will need to change the extenstion to .C instead of .c.txt. You will need to specify what output bit number you are using in the M3 and M5 programs.

    For the spindle program you will need to set kmotioncnc to use VAR 9, and also its set to use DAC 3, you may need to adjust if you are using a different DAC. Good luck with it. See if we can get this working before we worry about CCW.
    Thanks mmurray70;

    ... however, I am not sure what parameters I should be setting.

    1.) I understand that the DAC 3 will be changed to DAC 7 in the "Spindle.c" file.

    2.) All three files will be copied to the "C:\KMotion434j\C Programs\" directory.

    3.) When you say "the spindle program you will need to set kmotioncnc to use VAR 9" ... is this because the line "float spd = *(float *)&persist.UserData[9]; // s value from g code" in the "Spindle.c" file where the UserData[9] is set to 9?

    4.) Where is this VAR 9 set? In KMotionCNC--> "tool Setup Sceeen" --> M0-M30 --> M3 (Execute Prog) Thread=3 Var=9 , C File= m3.C?

    5.) Where is the bit number coming from in the line " SetBit(XXX); // spindle on" in the file m3.c file?

    6.) Also, where is the bit number coming from in the line " ClearBit(XXX); // spindle off" in the file m5.c?

    7.) How do I make sure that Thread #3 is active while running NC code from KMotion CNC?

    8.) Sorry ... I am sure these elementary question to most all here. I expect to caught-on once I see how this is working.


    Tree325 Retrofit Started-current_settings-jpg Image Link

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....



  6. #226
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by PeterTheWolf View Post
    Thanks mmurray70;

    ... however, I am not sure what parameters I should be setting.

    1.) I understand that the DAC 3 will be changed to DAC 7 in the "Spindle.c" file.
    Ok, Good.

    2.) All three files will be copied to the "C:\KMotion434j\C Programs\" directory.
    It might be easier to create a seperate folder under C:\ for your C programs and also any configuration files in kmotionCNC. I just called mine kmotion files. Otherwise when you upgrade you will have to find all your specific files and copy them to the new kmotion version folder. This just makes upgrades a little easier. You will have to specify the exact path in kmotioncnc for each file.

    3.) When you say "the spindle program you will need to set kmotioncnc to use VAR 9" ... is this because the line "float spd = *(float *)&persist.UserData[9]; // s value from g code" in the "Spindle.c" file where the UserData[9] is set to 9?
    Yes, Kmotioncnc sends the speed value to Kflop in persist.UserData variable number 9. You could use other numbers as well as long as they match and are not used for something else. Kflop then uses this information to set the DAC so it runs at the right speed.

    4.) Where is this VAR 9 set? In KMotionCNC--> "tool Setup Sceeen" --> M0-M30 --> M3 (Execute Prog) Thread=3 Var=9 , C File= m3.C?
    Yes, exactly the way you have it set in the picture. Only the spindle.c file reads info from kmotioncnc so you dont need to specify variable 9 for m3 and m5 programs. Should work fine either way.

    5.) Where is the bit number coming from in the line " SetBit(XXX); // spindle on" in the file m3.c file?
    Every output on Kanalog has a bit number. This is basically telling it which switch to turn on to start spindle. Number will depend on where you wired it. You had it turning on and off in kmotion right? When you toggled on and off, the bit number would be right next to the box for toggling it on and off. also see Kanalog Connectors

    6.) Also, where is the bit number coming from in the line " ClearBit(XXX); // spindle off" in the file m5.c?
    This will be the same bit number as above.

    7.) How do I make sure that Thread #3 is active while running NC code from KMotion CNC?
    When you execute M3 or M5 it will send that C program to kflop and start automatically in that thread, and then end when finished. You may want to change the spindle.c to another thread number. They are executed in the same block of G code, not sure if it would work this way or not.

    8.) Sorry ... I am sure these elementary question to most all here. I expect to caught-on once I see how this is working.
    Yeah you will get it all after a while. Once you figure out how to control a few different inputs and outputs it will start to sink in and it gets to be fun because you realize you can pretty much do anything you can imagine with your machine.



  7. #227
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by mmurray70 View Post
    It might be easier to create a seperate folder under C:\ for your C programs and also any configuration files in kmotionCNC. I just called mine kmotion files. Otherwise when you upgrade you will have to find all your specific files and copy them to the new kmotion version folder. This just makes upgrades a little easier. You will have to specify the exact path in kmotioncnc for each file.

    Yes, Kmotioncnc sends the speed value to Kflop in persist.UserData variable number 9. You could use other numbers as well as long as they match and are not used for something else. Kflop then uses this information to set the DAC so it runs at the right speed.

    Yes, exactly the way you have it set in the picture. Only the spindle.c file reads info from kmotioncnc so you dont need to specify variable 9 for m3 and m5 programs. Should work fine either way.

    Every output on Kanalog has a bit number. This is basically telling it which switch to turn on to start spindle. Number will depend on where you wired it. You had it turning on and off in kmotion right? When you toggled on and off, the bit number would be right next to the box for toggling it on and off. also see Kanalog Connectors

    This will be the same bit number as above.

    When you execute M3 or M5 it will send that C program to kflop and start automatically in that thread, and then end when finished. You may want to change the spindle.c to another thread number. They are executed in the same block of G code, not sure if it would work this way or not.

    Yeah you will get it all after a while. Once you figure out how to control a few different inputs and outputs it will start to sink in and it gets to be fun because you realize you can pretty much do anything you can imagine with your machine.
    Thanks mmurray70 --- I implemented as you advised and I can now control the spindle via NC code.

    I want to try to use Kanalog to control one of the existing Tree 24VDC relays, so I purchase a small cheap relay that uses about 7.1mA to engage it if I calculated correctly; however, I am not sure how to connect this to Kanalog for the signal to switch it on.

    This is how I think it should be connect:

    Tree325 Retrofit Started-kanalog_relay_connections-jpg Link to the Image << ------ >>Here is Link to the Relay


    Does this look correct??


    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....



  8. #228
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by PeterTheWolf View Post
    Thanks mmurray70 --- I implemented as you advised and I can now control the spindle via NC code.

    I want to try to use Kanalog to control one of the existing Tree 24VDC relays, so I purchase a small cheap relay that uses about 7.1mA to engage it if I calculated correctly; however, I am not sure how to connect this to Kanalog for the signal to switch it on.
    Awesome! Glad to hear spindle is working. Do you think youll need to use M4 as well? Might take a few more steps on your machine since it involves reversing DAC signal. I was thinking we could set a variable or bit in the M3/M4 programs that the spindle.c program could use to check direction and then send the proper DAC value.

    Im not sure, but i think that relay might be wanting 5v for signal (green wire) and those relay outputs on kanalog basically just switch to ground. Tom will know much more about these little electrical details, hopefully he can help you with it. Might need to do something a little different like your 5v, run it through an opto out and then to relay signal pin.



  9. #229
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by mmurray70 View Post
    ...
    Do you think youll need to use M4 as well? Might take a few more steps on your machine since it involves reversing DAC signal. I was thinking we could set a variable or bit in the M3/M4 programs that the spindle.c program could use to check direction and then send the proper DAC value.
    ...
    Yes, I would like to get the "M4" working as well via NC code.

    Is there a means of debugging "C" code in Kmotion? Like see what value variables are? Seeing what the variables change too as the "C" code runs? Is there as way of test "C" code via step-by-step as it is run?

    This looks just like another steep learning curve.

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....

    Last edited by PeterTheWolf; 05-13-2018 at 12:34 PM.


  10. #230
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Post the edited m3 and spindle.c programs your using now and ill see if i can help with getting reverse working.

    C programming will take a little while to learn, but I found it very rewarding in the end to be able to control my machine the way i can now. There is lots of tutorials out there, try and learn the very basics and then look at sample programs. Your machine wont be too bad anyway. You dont have a toolchanger or anything so it should go smoothly. The most your really going to want to be doing is maybe adding some buttons, overrides and a MPG and your done. There are many examples of this so most of it will be simply copy and paste and change a few numbers.

    You can print variables to console in kmotion (not kmotioncnc). Im not sure how to run it step by step or how to debug properly. Honestly i just setup the files to run in kmotioncnc and try it. If it gives me an error i go back and look for it. Might not be the proper way but I did manage to get everything working eventually.



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

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    I want to try to use Kanalog to control one of the existing Tree 24VDC relays, so I purchase a small cheap relay that uses about 7.1mA to engage it if I calculated correctly; however, I am not sure how to connect this to Kanalog for the signal to switch it on.

    This is how I think it should be connect:

    Tree325 Retrofit Started-kanalog_relay_connections-jpg Link to the Image << ------ >>Here is Link to the Relay


    Does this look correct??
    As murray70 points out the relay drivers only switch to ground. They only sink current they do not source current as I believe that module requires, There are several solutions: #1 drive the original relay directly with the Kanalog Relay drivers. #2 use a 3.3V output from Kanalog JP12 which can sink/source current. #3 hard wire the relay module signal input to 5V and switch its GND connection with the Kanalog Relay Driver. I recommend Option #3. See below for the connections:


    Tree325 Retrofit Started-kanalogrelay-jpg

    Yes, I would like to get the "M4" working as well via NC code.

    Is there a means of debugging "C" code in Kmotion? Like see what value variables are? Seeing what the variables change too as the "C" code runs? Is there as way of test "C" code via step-by-step as it is run?
    Single stepping through code isn't usually practical as the code usually needs to run real-time.

    It can be helpful to build your program incrementally. In other words add functionality bit by bit and check that each newly added item works before going to the next.

    You can add printf statements to print messages to the Console Screen, ie. printf("M3 program started\n"); and/or time delays, ie. Delay_sec(3.0); to help show what things executed and what any values were.

    Another trick is to set an unused Axis Destination to a value, ie. ch7->Dest=spd; You can then watch this speed value on the Axis screen as the Axis 7 Destination.

    Regards

    Regards
    TK http://dynomotion.com


  12. #232
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by TomKerekes View Post

    As murray70 points out the relay drivers only switch to ground. They only sink current they do not source current as I believe that module requires, There are several solutions: #1 drive the original relay directly with the Kanalog Relay drivers. #2 use a 3.3V output from Kanalog JP12 which can sink/source current. #3 hard wire the relay module signal input to 5V and switch its GND connection with the Kanalog Relay Driver. I recommend Option #3. See below for the connections:


    Tree325 Retrofit Started-kanalogrelay-jpg
    Thanks Tom ... I just tried Option #3 .... and it Worked; however, I will need to turn the "FET Driver 0" on and off as "OPTO Out 7" goes on and off I think.


    Then I think the following will work. However, I still need to prove this.

    Quote Originally Posted by PeterTheWolf View Post
    .....
    The way I understand it should work on terminal DI2 on the VFD terminal is:

    The +24VDC terminal on the VFD provides DI2 terminal with +24VDC. At least that is what I tested with along with a 1K ohm resister in series.
    The old controller had an output to wire #217, which I am thinking was +24VDC.

    Attachment 392134 LINK

    So, I am thinking for the Spindle to run through Kanalog/KFLOP I need wire #217 connected to JP13 Opto Output (I will be use # +7) which will:

    1.) Wire #217 must be connected to Kanalog JP13 Opto Output (# +7) so when KFLOP reads a "M03" and "S" NC Code -- this JP13 Opto Output (# +7) would provide +24VDC to wire #217 (which is connected to 13CRE relay).

    2.) So when wire #217 on 13CRE relay gets +24VDC then wire #218 on 13CRE relay would have +24VDC -- which in turn would feed wire #218 connected to 12CRE relay which would turn 12CRE relay on.

    3.) Once 12CRE relay is on then wire #243 would connect to wire #242 which is also connected to 12CRE relay and the other end of wire #242 is connect to DI2 on the VFD terminal.

    4.) And the wire #242 get +24VDC from the VFD +24VDC terminal because ....

    5.) Wire #243 and wire #241 are connected together just outside of the VFD (separate from the VFD bus terminal).

    6.) However, since 1CR relay is on at this point, wire #240 (which is connected to the VFD +24VDC terminal), now has +24VDC from the VFD +24VDC terminal which in turn feeds wire #241 on 1CR relay (when on) with +24VDC.

    7.) So, I am thinking this is how wire #242 on 12CR relay gets the +24VDC from the +24VDC VFD terminal, which is connected to DI2 terminal on the VFD.

    This LINK has the 1CR, 2CRE, 12CR, and 13CRE relays wire pin for quick reference (see last 4 images of link).

    Do all KMotion Bits work the same as far as setting them on and off?


    So, I should be able to turn the "FET Driver 0" Bit (in my case #152)

    on by: SetBit(152); // FET Driver 0 on (Relay), Spindle will go on thru Interlock

    and

    off by: ClearBit(152); // FET Driver 0 off (Relay), Spindle will go off thru Interlock

    Tree325 Retrofit Started-kmotion_digital_i_o_screen_4k_large-png

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....



  13. #233
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started



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

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    Thanks Tom ... I just tried Option #3 .... and it Worked; however, I will need to turn the "FET Driver 0" on and off as "OPTO Out 7" goes on and off I think.
    I'm a bit confused. You will need to turn FET Driver 0 on and off instead of OPTO Out 7. OPTO Out 7 should no longer be needed. It isn't clear to me if we will then have the proper interlocks enforced by some of the original wiring (EStop. Drawbar, and such). You should test that.

    Yes all output bit can be controlled by SetBit and ClearBit in the same manner. Just use the associated bit number.

    Regards

    Regards
    TK http://dynomotion.com


  15. #235
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by TomKerekes View Post
    I'm a bit confused. You will need to turn FET Driver 0 on and off instead of OPTO Out 7. OPTO Out 7 should no longer be needed. It isn't clear to me if we will then have the proper interlocks enforced by some of the original wiring (EStop. Drawbar, and such). You should test that.

    Yes all output bit can be controlled by SetBit and ClearBit in the same manner. Just use the associated bit number.

    Regards
    Thanks Again Tom for paying close attention to my moves on this retrofit!!!

    You absolutely correct
    ... The OPTO Out #7 wires are no longer used. I made the mistake of disconnecting the two wires from the VFD and not disconnecting them from the Kanalog (instead I left them in place as I tested the option #3 of the relay.)

    And in my post to the forum I wasn't paying close enough attention to what exactly I had ended up with on my wiring.

    I really appreciate your depth of insight into the posts on this forum. For beginners (like me) using KFLOP/Kanalog ... it makes a World of difference, at least in my understanding.

    ...
    ....



  16. #236
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    ...
    ....
    ...

    Can I please get some clarification on using the KMotion C-Program editor and how it works?

    If I am running KMotionCNC and I have C-Programs defined in the Tool-Setup parameters ... like:

    Tree325 Retrofit Started-tool_setup_page_001-jpg Link to Image

    Where the M3, M4, M5, and S are defined via C-Code files and I open the KMotion C-Program editor and edit one of these files lets say in Thread #4, re-compile, Download, and Run ... which C-Code is KMotionCNC responding too?

    Another Question:

    If I am in KMotion C-program editor and I open threads #3, 4, 5, and 6 with M3.C, M4.C, M5.C, and Spindle.C respectively ... will the variables defined and used in, lets say M3.C be available to Spindle.C?
    If not, how can I use variables defined and set in one C-program in another C-program?

    Another Question:

    If I want to use a longer USB cable (9 feet) to connect KFLOP to Laptop, does it have to have the ferrite chokes on each end of the USB cable like the one that came with KFLOP/KMotion?

    Tree325 Retrofit Started-ferrite_choke_usb_cable-jpg Link to Drawing


    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....



  17. #237
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    Can I please get some clarification on using the KMotion C-Program editor and how it works?

    If I am running KMotionCNC and I have C-Programs defined in the Tool-Setup parameters ... like:

    Where the M3, M4, M5, and S are defined via C-Code files and I open the KMotion C-Program editor and edit one of these files lets say in Thread #4, re-compile, Download, and Run ... which C-Code is KMotionCNC responding too?
    When KMotionCNC decides it needs to perform some action (such as M3) it looks in the Tool Setup for what it is supposed to do. In this case it Compiles and downloads to KFLOP the C file it was configured to use into the KFLOP Thread that it was configured to use. Then executes that Thread. This is all regardless of what programs were last used in whatever Threads in KMotion.exe. KMotion.exe is simply a configuration and debugging tool to help with experimentation and testing. In the end it will not be needed or used at all. However if you use KMotion.exe or any other editor to modify the disk file that KMotionCNC is configured to use, then of course the next time KMotionCNC uses the file it will use the modified file.

    If I am in KMotion C-program editor and I open threads #3, 4, 5, and 6 with M3.C, M4.C, M5.C, and Spindle.C respectively ... will the variables defined and used in, lets say M3.C be available to Spindle.C?
    In general no.

    If not, how can I use variables defined and set in one C-program in another C-program?
    The simplest method is to place data into persist user data variables. There are 200 variables defined 0-199. Each is a 32-bit integer which can hold any whole number between (-2147483648 to +2147483647). Floating point values can also be placed into these variables although it requires some special casting to force the compiler to reference the variable as a float rather than an integer. Not only will the data be available to other C Programs and Threads, it will be available to the same C Program if executed at a later time. Think of it as a chalkboard where anybody can erase and write a value which anyone else can read or you can read yourself at a later time. Of course if anyone writes a new value any previously written value will be lost. To access a variable from C code: persist.UserData[xxx] where xxx is the variable number you wish to reference. The persist.UserData can also be Flashed to KFLOP memory so the value Flashed will persist after the next power cycle. But this is not normally necessary or recommended.

    If I want to use a longer USB cable (9 feet) to connect KFLOP to Laptop, does it have to have the ferrite chokes on each end of the USB cable like the one that came with KFLOP/KMotion?
    Its not absolutely necessary but highly recommended. The ferrite rings have been shown to help reduce noise problems. Something else to check is that the shield resistance from shell to shell is < 1 Ohm. Many low cost cables do not meet this requirement even though they claim to be compliant so its worth checking.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  18. #238
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by TomKerekes View Post

    When KMotionCNC decides it needs to perform some action (such as M3) it looks in the Tool Setup for what it is supposed to do. In this case it Compiles and downloads to KFLOP the C file it was configured to use into the KFLOP Thread that it was configured to use. Then executes that Thread. This is all regardless of what programs were last used in whatever Threads in KMotion.exe. KMotion.exe is simply a configuration and debugging tool to help with experimentation and testing. In the end it will not be needed or used at all. However if you use KMotion.exe or any other editor to modify the disk file that KMotionCNC is configured to use, then of course the next time KMotionCNC uses the file it will use the modified file.
    ....
    ...

    The simplest method is to place data into persist user data variables. There are 200 variables defined 0-199. Each is a 32-bit integer which can hold any whole number between (-2147483648 to +2147483647). Floating point values can also be placed into these variables although it requires some special casting to force the compiler to reference the variable as a float rather than an integer. Not only will the data be available to other C Programs and Threads, it will be available to the same C Program if executed at a later time. Think of it as a chalkboard where anybody can erase and write a value which anyone else can read or you can read yourself at a later time. Of course if anyone writes a new value any previously written value will be lost. To access a variable from C code: persist.UserData[xxx] where xxx is the variable number you wish to reference. The persist.UserData can also be Flashed to KFLOP memory so the value Flashed will persist after the next power cycle. But this is not normally necessary or recommended.
    Thanks Tom ........ I will do some more testing and experimenting.

    Quote Originally Posted by TomKerekes View Post

    Its not absolutely necessary but highly recommended. The ferrite rings have been shown to help reduce noise problems. Something else to check is that the shield resistance from shell to shell is < 1 Ohm. Many low cost cables do not meet this requirement even though they claim to be compliant so its worth checking.
    Question:

    Tom, Do you offer a 10 foot USB cables for sale from Dynomotion Motion Control Boards? I do not see them on your web site. If so, How can I order them?

    Thanks,

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....



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

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    Do you offer a 10 foot USB cables for sale from Dynomotion Motion Control Boards? I do not see them on your web site. If so, How can I order them?
    No we don't. There are many sources. This is a brand we've had good luck with on Digikey:

    https://www.digikey.com/product-deta...414-ND/3782937


    Regards

    Regards
    TK http://dynomotion.com


  20. #240
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    ....
    ....

    Can I get some help with my, what should be simply, C-Code?

    I am trying to write some C-code to change the << DAC(7,speed); >> value "speed" from Positive to Negative and/or Negative to Positive for the M03/M04.

    At least what I thought should be simple is not working so well. It would seem the I cannot get the correct sign on the this "speed" value when it is needed base on the M03 and/or the M04.
    What I thought should happen is the M03/M04 code would be read first in the "Tool Setup Screen" and then the "S" code from the Spindle.C which I though should setting the "speed" value sign correctly.
    But this is not the case.

    The NC code I am testing is:

    M05
    M03S200
    M05
    M04S200
    M05
    M30

    My Spindle.C is this:
    Code:
    #include "KMotionDef.h"
    
    #define FACTOR 0.2228  // Factor 0.2228 * Speed from NC code for DAC7
    #define SPEEDVAR 99			// global persistant variable to store latest speed
    #define STATEVAR 98			// global persistant variable to store latest state (-1=CCW,0=off,1=CW)
    
    main()
    {
    	int speed; 
    	float spd = *(float *)&persist.UserData[9]; // s value from g code
    	speed = spd * FACTOR; // set dac counts 
    		printf("Spindle Speed = ");  //single line comment
    		printf("%4.4f\n",spd);
    		printf("Factor Used Spindle Speed = ");  //single line comment
    		printf("%4.4f\n",FACTOR);
    
    
    	// limit min speed
    	if (speed < 60)
    	{
    		speed = 60;
    	}
    
    	// limit max speed
    	if (speed > 1000)
    	{
    		speed = 1000;
    	}
    
    	if (persist.UserData[STATEVAR] == -1)  // should be M04
    	{
    		DAC(7,-speed);
    		persist.UserData[SPEEDVAR] = spd;
    		printf("Spindle Speed = ");  //single line comment
    		printf("%d\n",persist.UserData[SPEEDVAR]);
    		printf("Print the value for STATEVAR for M4 in Spindle.C = ");  //single line comment
    		printf("%d\n",persist.UserData[STATEVAR]);
    		printf("\n");
    		printf("\n");
    		printf("\n");
    			
    	}
    	if (persist.UserData[STATEVAR] == 1) // should be M03
    	{
    		DAC(7,speed);
    		persist.UserData[SPEEDVAR] = spd;
    		printf("Spindle Speed = ");  //single line comment
    		printf("%d\n",persist.UserData[SPEEDVAR]);
    		printf("Print the value for STATEVAR for M3 in Spindle.C = ");  //single line comment
    		printf("%d\n",persist.UserData[STATEVAR]);
    	}
    }
    My m3.c code is this:
    Code:
    #include "KMotionDef.h"
    
    // M03 C-Code for Spindle Direction
    // Spindle CW Jog function with +/- voltage used for direction
    
    #define SPEEDVAR 99			// global persistant variable to store latest speed
    #define STATEVAR 98			// global persistant variable to store latest state (-1=CCW,0=off,1=CW)
    
    
    // M03 command passes no arguments
    // desired speed is read from user variable SPEEDVAR
    // save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
    // save in user variable SPEEDVAR the last desired speed
    
    main()
    {
    	persist.UserData[STATEVAR] = 1;
    
    			// SetBit(151); // spindle on; when OPTO Out #7 is used to signal spindle direction
            SetBit(152); // FET Driver 0 on (Relay), Spindle will go on thru Interlock
     	
    		printf("Print the value for STATEVAR from M3.C = ");  //single line comment
    		printf("%d\n",persist.UserData[STATEVAR]);
    		printf("\n");
    		printf("\n");
    		printf("\n");		
    }
    My m4.c is this:
    Code:
    #include "KMotionDef.h"
    
    // M03 C-Code for Spindle Direction
    // Spindle CW Jog function with +/- voltage used for direction
    
    #define SPEEDVAR 99			// global persistant variable to store latest speed
    #define STATEVAR 98			// global persistant variable to store latest state (-1=CCW,0=off,1=CW)
    
    
    // M03 command passes no arguments
    // desired speed is read from user variable SPEEDVAR
    // save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
    // save in user variable SPEEDVAR the last desired speed
    
    main()
    {
    	persist.UserData[STATEVAR] = -1;
    
    			// SetBit(151); // spindle on; when OPTO Out #7 is used to signal spindle direction
            SetBit(152); // FET Driver 0 on (Relay), Spindle will go on thru Interlock
     	
    		printf("Print the value for STATEVAR from M4.C = ");  //single line comment
    		printf("%d\n",persist.UserData[STATEVAR]);
    		printf("\n");
    		printf("\n");
    		printf("\n");		
    }
    Also, I was trying to use other C programming syntax I see on online however, it would seem I do not have the correct default C Standard Input and Output Library like "stdio.h" and "stdlib.h".
    However, if I try to add these at the beginning of the Spindle.C program as #include "stdio.h" the compiler does not like it and/or there are other libraries within the library that also are not available.
    Is there a way to get more of these default C Standard Input and Output Library included in the C-code I am trying to write for KMotion?

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"
    Tree Journeyman 325 Designed Specs.
    Tree Journeyman 325 Axis-Tension Frequency Settings
    Final Axis Tuned Error Parameters
    VFD Wiring to Existing Tree325 Old Controller
    DAC Values to RPM / Voltage Checks

    .....
    .....



Page 12 of 18 FirstFirst ... 29101112131415 ... LastLast

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

Tree325 Retrofit Started

Tree325 Retrofit Started