Dynomotion

Group: DynoMotion Message: 9965 From: rjreese29@ymail.com Date: 8/14/2014
Subject: CSS jog and bits on off
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob
Group: DynoMotion Message: 9966 From: Tom Kerekes Date: 8/14/2014
Subject: Re: CSS jog and bits on off
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob


Group: DynoMotion Message: 9968 From: Rjreese29 Date: 8/14/2014
Subject: Re: CSS jog and bits on off
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob


Group: DynoMotion Message: 9971 From: Tom Kerekes Date: 8/14/2014
Subject: Re: CSS jog and bits on off
Hi Rob,

In <install>\C Programs\SpindleUsingJogs\CSS\MySpindleDefs.h there is an option:

#define USE_POS_NEG_VOLTAGE 1     // 0 = output Magnitude, 1 = output positive and negative speed

If you set this to 1 then the Direction bit (IO39) of the Step/Dir Generator will naturally change with direction.  So manually switching other IO is not needed.  So you can just set the:

#define SPINDLECW_BIT 154       // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

to some unused bit (like IO46 is a KFLOP LED).

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Thursday, August 14, 2014 12:41 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob




Group: DynoMotion Message: 10000 From: Rjreese29 Date: 8/18/2014
Subject: Re: CSS jog and bits on off
A big Thank you Tom!!!

Things are beginning to work and I am receiving steps and direction thru the console to my bob, due to several posts ago. The solution was to get rid of unwanted axis polluting the ones I wanted. Oops! 
User inputs are kind of working, but I believe I will need to start over with new/original .c files for my spindle as in to deep with my lack of c knowledge. I will try out your suggestions.


Thanks so much for your support!

Rob

On Aug 14, 2014, at 2:26 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

Hi Rob,

In <install>\C Programs\SpindleUsingJogs\CSS\MySpindleDefs.h there is an option:

#define USE_POS_NEG_VOLTAGE 1     // 0 = output Magnitude, 1 = output positive and negative speed

If you set this to 1 then the Direction bit (IO39) of the Step/Dir Generator will naturally change with direction.  So manually switching other IO is not needed.  So you can just set the:

#define SPINDLECW_BIT 154       // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

to some unused bit (like IO46 is a KFLOP LED).

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Thursday, August 14, 2014 12:41 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob




Group: DynoMotion Message: 10013 From: Rjreese29 Date: 8/22/2014
Subject: Re: CSS jog and bits on off
Hi Tom,

My step and directions on my bob are working through console jog commands. However I cannot get user buttons to work. I have programmed them triggering with 2 io bits, used spindle jog programs(tried them all), 
To no avail have I been able to get the bits to switch in kmotioncnc, mach3, or gcode screen.


I can get the console to print messages from commands in kmotion with various c programs, but the outputs will never switch.
I am using axis 5 as step and direction for my spindle.

Doing my best with c and reading/learning a lot, but I just not have found a solution.

Now that I am jogging through commands in the console, what would be the most next basic test/cprogram to make this work?

Rob

On Aug 14, 2014, at 2:26 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

Hi Rob,

In <install>\C Programs\SpindleUsingJogs\CSS\MySpindleDefs.h there is an option:

#define USE_POS_NEG_VOLTAGE 1     // 0 = output Magnitude, 1 = output positive and negative speed

If you set this to 1 then the Direction bit (IO39) of the Step/Dir Generator will naturally change with direction.  So manually switching other IO is not needed.  So you can just set the:

#define SPINDLECW_BIT 154       // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

to some unused bit (like IO46 is a KFLOP LED).

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Thursday, August 14, 2014 12:41 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob




Group: DynoMotion Message: 10014 From: Tom Kerekes Date: 8/22/2014
Subject: Re: CSS jog and bits on off
Hi Rob,

Maybe this Post and Thread may help


and I assume you have read:


Please be more specific on what you understand and what you don't.   Modify the MySpindleDefs.h file for your system and post it so we can see what you have done.

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Friday, August 22, 2014 12:23 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

My step and directions on my bob are working through console jog commands. However I cannot get user buttons to work. I have programmed them triggering with 2 io bits, used spindle jog programs(tried them all), 
To no avail have I been able to get the bits to switch in kmotioncnc, mach3, or gcode screen.


I can get the console to print messages from commands in kmotion with various c programs, but the outputs will never switch.
I am using axis 5 as step and direction for my spindle.

Doing my best with c and reading/learning a lot, but I just not have found a solution.

Now that I am jogging through commands in the console, what would be the most next basic test/cprogram to make this work?

Rob

On Aug 14, 2014, at 2:26 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
Hi Rob,

In <install>\C Programs\SpindleUsingJogs\CSS\MySpindleDefs.h there is an option:

#define USE_POS_NEG_VOLTAGE 1     // 0 = output Magnitude, 1 = output positive and negative speed

If you set this to 1 then the Direction bit (IO39) of the Step/Dir Generator will naturally change with direction.  So manually switching other IO is not needed.  So you can just set the:

#define SPINDLECW_BIT 154       // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

to some unused bit (like IO46 is a KFLOP LED).

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Thursday, August 14, 2014 12:41 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob






Group: DynoMotion Message: 10016 From: Rjreese29 Date: 8/22/2014
Subject: Re: CSS jog and bits on off
Tom,
Thank you for the links.

#define SPINDLEAXIS 5                                 // Axis Channel to Jog to rotate Spindle

#define FACTOR (1000/60.0)       // to convert RPM to counts/sec (counts/rev / 60.0sec)

#define SPINDLECW_BIT 1024   // bit to activate to cause CW rotation

#define SPINDLECCW_BIT 1025                 // bit to activate to cause CCW rotation

#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)

#define KMVAR PC_COMM_CSS_S 113 // variable KMotionCNC will pass speed parameter (113)

#define USE_POS_NEG_VOLTAGE 1       // 0 = output Magnitude, 1 = output positive and negative speed

 

So it works now.YEAH!! Thanks Tom. The root cause was changing the bits to 1024 & 1025. Along with my #define KMVAR PC_COMM_CSS_S 113 had no 113 in it. I went back to all original settings to review the MySpindleDefs.h file and it had no number here. Your previous advice and documents/notes told me there was supposed to be a 113 here. I tried all of these settings previously, but must have missed something.

This is all great stuff with starting to see it come alive.

 

 

1)One thing I have noticed is that It requires 2 presses of m3, m4 & m5 userbutton for it to acknowledge the respective command. 1 press of each userbutton will not trigger the function. Is this normal? (Not a big deal to me at this point as a single M3 command via gcode will activate it and this is where it counts)

 

 

 

2)Another Kmotion error I am seeing is that when I single step through a line of gcode such as "s1000m3", It gives me the following error:

 

Error compiling and loading kmotion Program

C:\kmotion 433c\....\css\spindlejog.c:13;"]"expected.

 

I believe The line where this issue is starts with.     " Float speed=...."   I do not see where to insert a ] 

...?      

below is my Spindlejoge.c file:

 

#include "KMotionDef.h"

 

#include "MySpindleDefs.h"

 

int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];                                 // Mode 1=Normal RPM mode. 2=CSS

 

// desired speed is passed from KMotionCNC in variable KMVAR

// 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()

{

                float speed = *(float *)&persist.UserData[KMVAR];  // value stored is actually a float

                float LastState = persist.UserData[STATEVAR];  // get last state

               

                persist.UserData[SPEEDVAR] = persist.UserData[KMVAR];  // Always save the last desired speed

               

                if (LastState==0 || *css_mode == 2) 

                {

                                // if spindle is off (or CSS mode) and User Changes the speed

                                // just save the desired speed

                               

                                return 0;

                }

               

                // spindle is already on, so ramp to new speed

                if (USE_POS_NEG_VOLTAGE)

                                Jog(SPINDLEAXIS,speed * FACTOR * LastState);

                else

                                Jog(SPINDLEAXIS,speed * FACTOR);

                               

                printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);

}

 

Is there a way to get rid of this error?

 

.........

 

Thanks so much Tom.

 

Have a great weekend!

Rob




On Aug 22, 2014, at 12:44 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

Hi Rob,

Maybe this Post and Thread may help


and I assume you have read:


Please be more specific on what you understand and what you don't.   Modify the MySpindleDefs.h file for your system and post it so we can see what you have done.

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Friday, August 22, 2014 12:23 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

My step and directions on my bob are working through console jog commands. However I cannot get user buttons to work. I have programmed them triggering with 2 io bits, used spindle jog programs(tried them all), 
To no avail have I been able to get the bits to switch in kmotioncnc, mach3, or gcode screen.


I can get the console to print messages from commands in kmotion with various c programs, but the outputs will never switch.
I am using axis 5 as step and direction for my spindle.

Doing my best with c and reading/learning a lot, but I just not have found a solution.

Now that I am jogging through commands in the console, what would be the most next basic test/cprogram to make this work?

Rob

On Aug 14, 2014, at 2:26 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
Hi Rob,

In <install>\C Programs\SpindleUsingJogs\CSS\MySpindleDefs.h there is an option:

#define USE_POS_NEG_VOLTAGE 1     // 0 = output Magnitude, 1 = output positive and negative speed

If you set this to 1 then the Direction bit (IO39) of the Step/Dir Generator will naturally change with direction.  So manually switching other IO is not needed.  So you can just set the:

#define SPINDLECW_BIT 154       // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

to some unused bit (like IO46 is a KFLOP LED).

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Thursday, August 14, 2014 12:41 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob






Group: DynoMotion Message: 10019 From: Tom Kerekes Date: 8/22/2014
Subject: Re: CSS jog and bits on off
Hi Rob,

I'm confused on how that could be working.   You should not add the 113.   PC_COMM_CSS_S is already defined to be 113 in \DSP_KFLOP\PC-DSP.h

So after all the Macro substitutions are made the result is:

                float speed = *(float *)&persist.UserData[113 113];  // value stored is actually a float

Which is why the compiler is giving an error expecting a closed bracket instead of another 113.

I can't explain how the speed could be changing properly with the "S" SindleJog.c Program not compilable.

Please remove the 113 and try again.  Post screen shots of your Tool Setup | M3-M9 settings.  You shouldn't really need User Buttons as there are On CW, On CCW, Off Spindle buttons on the KMotionCNC screen that basically call M3,M4,M5 functions.

Regards
TK





From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Friday, August 22, 2014 3:38 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Tom,
Thank you for the links.

#define SPINDLEAXIS 5                                 // Axis Channel to Jog to rotate Spindle
#define FACTOR (1000/60.0)       // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 1024   // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 1025                 // bit to activate to cause CCW rotation
#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)
#define KMVAR PC_COMM_CSS_S 113 // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 1       // 0 = output Magnitude, 1 = output positive and negative speed
 
So it works now.YEAH!! Thanks Tom. The root cause was changing the bits to 1024 & 1025. Along with my #define KMVAR PC_COMM_CSS_S 113 had no 113 in it. I went back to all original settings to review the MySpindleDefs.h file and it had no number here. Your previous advice and documents/notes told me there was supposed to be a 113 here. I tried all of these settings previously, but must have missed something.
This is all great stuff with starting to see it come alive.
 
 
1)One thing I have noticed is that It requires 2 presses of m3, m4 & m5 userbutton for it to acknowledge the respective command. 1 press of each userbutton will not trigger the function. Is this normal? (Not a big deal to me at this point as a single M3 command via gcode will activate it and this is where it counts)
 
 
 
2)Another Kmotion error I am seeing is that when I single step through a line of gcode such as "s1000m3", It gives me the following error:
 
Error compiling and loading kmotion Program
C:\kmotion 433c\....\css\spindlejog.c:13;"]"expected.
 
I believe The line where this issue is starts with.     " Float speed=...."   I do not see where to insert a ] 
...?      
below is my Spindlejoge.c file:
 
#include "KMotionDef.h"
 
#include "MySpindleDefs.h"
 
int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];                                 // Mode 1=Normal RPM mode. 2=CSS
 
// desired speed is passed from KMotionCNC in variable KMVAR
// 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()
{
                float speed = *(float *)&persist.UserData[KMVAR];  // value stored is actually a float
                float LastState = persist.UserData[STATEVAR];  // get last state
               
                persist.UserData[SPEEDVAR] = persist.UserData[KMVAR];  // Always save the last desired speed
               
                if (LastState==0 || *css_mode == 2) 
                {
                                // if spindle is off (or CSS mode) and User Changes the speed
                                // just save the desired speed
                               
                                return 0;
                }
               
                // spindle is already on, so ramp to new speed
                if (USE_POS_NEG_VOLTAGE)
                                Jog(SPINDLEAXIS,speed * FACTOR * LastState);
                else
                                Jog(SPINDLEAXIS,speed * FACTOR);
                               
                printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
}
 
Is there a way to get rid of this error?
 
.........
 
Thanks so much Tom.
 
Have a great weekend!
Rob



On Aug 22, 2014, at 12:44 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
Hi Rob,

Maybe this Post and Thread may help


and I assume you have read:


Please be more specific on what you understand and what you don't.   Modify the MySpindleDefs.h file for your system and post it so we can see what you have done.

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Friday, August 22, 2014 12:23 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

My step and directions on my bob are working through console jog commands. However I cannot get user buttons to work. I have programmed them triggering with 2 io bits, used spindle jog programs(tried them all), 
To no avail have I been able to get the bits to switch in kmotioncnc, mach3, or gcode screen.


I can get the console to print messages from commands in kmotion with various c programs, but the outputs will never switch.
I am using axis 5 as step and direction for my spindle.

Doing my best with c and reading/learning a lot, but I just not have found a solution.

Now that I am jogging through commands in the console, what would be the most next basic test/cprogram to make this work?

Rob

On Aug 14, 2014, at 2:26 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
Hi Rob,

In <install>\C Programs\SpindleUsingJogs\CSS\MySpindleDefs.h there is an option:

#define USE_POS_NEG_VOLTAGE 1     // 0 = output Magnitude, 1 = output positive and negative speed

If you set this to 1 then the Direction bit (IO39) of the Step/Dir Generator will naturally change with direction.  So manually switching other IO is not needed.  So you can just set the:

#define SPINDLECW_BIT 154       // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

to some unused bit (like IO46 is a KFLOP LED).

Regards
TK



From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Thursday, August 14, 2014 12:41 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK




From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob








Group: DynoMotion Message: 10036 From: Rob Reese Date: 8/25/2014
Subject: Re: CSS jog and bits on off
Hi Tom,

I removed the "113" from #define KMVAR PC_COMM_CSS_S and the step and direction stopped working on my bob. The compile error did go away though. I power cycled the kflop and saw no change, rebooted the computer and kflop and it began to work... But only for a little.

After alot of tinkering with it over the weekend, things are beginning to work. Things are a bit unstable, but I am attributing that to user error.
 
My step and dir spindle axis is so far developed into this:
 
ch5->InputMode=NO_INPUT_MODE;
      ch5->OutputMode=STEP_DIR_MODE;
      ch5->Vel=400;
      ch5->Accel=2000;
      ch5->Jerk=4e+006;
      ch5->P=0;
      ch5->I=0;
      ch5->D=0;
      ch5->FFAccel=0.000001;
      ch5->FFVel=0.001;
      ch5->MaxI=200;
      ch5->MaxErr=200;
      ch5->MaxOutput=200;
      ch5->DeadBandGain=1;       
      ch5->DeadBandRange=0;
      ch5->InputChan0=-1;
      ch5->InputChan1=-1;
      ch5->OutputChan0=5;
      ch5->OutputChan1=-1;
      ch5->MasterAxis=-1;
      ch5->LimitSwitchOptions=0x110;
      ch5->LimitSwitchNegBit=0;
      ch5->LimitSwitchPosBit=0;
      ch5->SoftLimitPos=1e+009;
      ch5->SoftLimitNeg=-1e+009;
      ch5->InputGain0=1;
      ch5->InputGain1=1;
      ch5->InputOffset0=0;
      ch5->InputOffset1=0;
      ch5->OutputGain=1;
      ch5->OutputOffset=0;
      ch5->SlaveGain=1;
      ch5->BacklashMode=BACKLASH_OFF;
      ch5->BacklashAmount=0;
      ch5->BacklashRate=0;
      ch5->invDistPerCycle=1;
      ch5->Lead=0;
      ch5->MaxFollowingError=10000000;
      ch5->StepperAmplitude=250;
 
      ch5->iir[0].B0=1;
      ch5->iir[0].B1=0;
      ch5->iir[0].B2=0;
      ch5->iir[0].A1=0;
      ch5->iir[0].A2=0;
 
      ch5->iir[1].B0=1;
      ch5->iir[1].B1=0;
      ch5->iir[1].B2=0;
      ch5->iir[1].A1=0;
      ch5->iir[1].A2=0;
 
      ch5->iir[2].B0=1;
      ch5->iir[2].B1=0;
      ch5->iir[2].B2=0;
      ch5->iir[2].A1=0;
      ch5->iir[2].A2=0;
 
Sorry about the formatting, Thats not what it really looks like.
 
I added a folder called Rob R and put the 2 screenshots of tool setup in there.
In Conclusion: Things are working OK. I am seeing really odd ghost in the machine behaviour Such as:
-the M3 program inadvertantly changing to "none" When it was previously selected as EXEC PROGRAM| ....OnCWJog.c
-My Outputgain changed to .000000001 which also caused me some...PITA. This is also fixed by changing it back to 1.0 (I have no idea why these things are changing, I don't remember changing these...... and I am only 40some odd years old...)
 
Either way, I am happy it's back.
Let me know what you think so far.
 
Thanks!!!!!
 
Rob R.
 







Rob

On Aug 22, 2014, at 4:16 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
Hi Rob,

I'm confused on how that could be working.   You should not add the 113.   PC_COMM_CSS_S is already defined to be 113 in \DSP_KFLOP\PC-DSP.h

So after all the Macro substitutions are made the result is:

                float speed = *(float *)&persist.UserData[113 113];  // value stored is actually a float

Which is why the compiler is giving an error expecting a closed bracket instead of another 113.

I can't explain how the speed could be changing properly with the "S" SindleJog.c Program not compilable.

Please remove the 113 and try again.  Post screen shots of your Tool Setup | M3-M9 settings.  You shouldn't really need User Buttons as there are On CW, On CCW, Off Spindle buttons on the KMotionCNC screen that basically call M3,M4,M5 functions.

Regards
TK




From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Friday, August 22, 2014 3:38 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Tom,
Thank you for the links.

#define SPINDLEAXIS 5                                 // Axis Channel to Jog to rotate Spindle
#define FACTOR (1000/60.0)       // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 1024   // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 1025                 // bit to activate to cause CCW rotation
#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)
#define KMVAR PC_COMM_CSS_S 113 // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 1       // 0 = output Magnitude, 1 = output positive and negative speed
 
So it works now.YEAH!! Thanks Tom. The root cause was changing the bits to 1024 & 1025. Along with my #define KMVAR PC_COMM_CSS_S 113 had no 113 in it. I went back to all original settings to review the MySpindleDefs.h file and it had no number here. Your previous advice and documents/notes told me there was supposed to be a 113 here. I tried all of these settings previously, but must have missed something.
This is all great stuff with starting to see it come alive.
 
 
1)One thing I have noticed is that It requires 2 presses of m3, m4 & m5 userbutton for it to acknowledge the respective command. 1 press of each userbutton will not trigger the function. Is this normal? (Not a big deal to me at this point as a single M3 command via gcode will activate it and this is where it counts)
 
 
 
2)Another Kmotion error I am seeing is that when I single step through a line of gcode such as "s1000m3", It gives me the following error:
 
Error compiling and loading kmotion Program
C:\kmotion 433c\....\css\spindlejog.c:13;"]"expected.
 
I believe The line where this issue is starts with.     " Float speed=...."   I do not see where to insert a ] 
...?      
below is my Spindlejoge.c file:
 
#include "KMotionDef.h"
 
#include "MySpindleDefs.h"
 
int   *css_mode = &persist.UserData[PC_COMM_CSS_MODE];                                 // Mode 1=Normal RPM mode. 2=CSS
 
// desired speed is passed from KMotionCNC in variable KMVAR
// 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()
{
                float speed = *(float *)&persist.UserData[KMVAR];  // value stored is actually a float
                float LastState = persist.UserData[STATEVAR];  // get last state
               
                persist.UserData[SPEEDVAR] = persist.UserData[KMVAR];  // Always save the last desired speed
               
                if (LastState==0 || *css_mode == 2) 
                {
                                // if spindle is off (or CSS mode) and User Changes the speed
                                // just save the desired speed
                               
                                return 0;
                }
               
                // spindle is already on, so ramp to new speed
                if (USE_POS_NEG_VOLTAGE)
                                Jog(SPINDLEAXIS,speed * FACTOR * LastState);
                else
                                Jog(SPINDLEAXIS,speed * FACTOR);
                               
                printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
}
 
Is there a way to get rid of this error?
 
.........
 
Thanks so much Tom.
 
Have a great weekend!
Rob



On Aug 22, 2014, at 12:44 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
Hi Rob,

Maybe this Post and Thread may help


and I assume you have read:


Please be more specific on what you understand and what you don't.   Modify the MySpindleDefs.h file for your system and post it so we can see what you have done.

Regards
TK


From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Friday, August 22, 2014 12:23 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

My step and directions on my bob are working through console jog commands. However I cannot get user buttons to work. I have programmed them triggering with 2 io bits, used spindle jog programs(tried them all), 
To no avail have I been able to get the bits to switch in kmotioncnc, mach3, or gcode screen.


I can get the console to print messages from commands in kmotion with various c programs, but the outputs will never switch.
I am using axis 5 as step and direction for my spindle.

Doing my best with c and reading/learning a lot, but I just not have found a solution.

Now that I am jogging through commands in the console, what would be the most next basic test/cprogram to make this work?

Rob

On Aug 14, 2014, at 2:26 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
Hi Rob,

In <install>\C Programs\SpindleUsingJogs\CSS\MySpindleDefs.h there is an option:

#define USE_POS_NEG_VOLTAGE 1     // 0 = output Magnitude, 1 = output positive and negative speed

If you set this to 1 then the Direction bit (IO39) of the Step/Dir Generator will naturally change with direction.  So manually switching other IO is not needed.  So you can just set the:

#define SPINDLECW_BIT 154       // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155        // bit to activate to cause CCW rotation

to some unused bit (like IO46 is a KFLOP LED).

Regards
TK


From: "Rjreese29 rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
Sent: Thursday, August 14, 2014 12:41 PM
Subject: Re: [DynoMotion] CSS jog and bits on off

 
Hi Tom,

Thanks for your reply, I will work through the frankenpost and other links you have sent me.
I'll try to apply these suggestions over the next couple days.

My vfd requires 0-10vdc. This is generated on board of my c23 bob.
The 0-10vdc is generated through a hardware device on the c23. A sstep signal on port1pin14 on the c23 achieves this 0-10vdc.
I am going to use stepdir 5 (io38,39)


At this point, I am not to the point of being concerned about getting 0-10v, but more so seeing my hardware software function in the correct manner. 
For right now, just getting the c program and m3,4,5 to control my io bit 38,39.
My thread is 2 var 1 as you have exampled in you docs and this is for all relative CSS files and their respective commands (m3, m4... Buttons pointing to this respective thread and then calls the appropriate program(cw.c, ccw.c...)

To ask you a more specific question,
What should my cw and ccw bits be for this c program? Both of them 39?
This level of c in these c files confusing me.

Thanks,

Rob

On Aug 14, 2014, at 9:33 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 
It isn't clear to me whether your Spindle requires a 0-10V analog signal or Step/Dir Signals.

I'll assume it requires a 0-10V analog signal that you want the C23 board to generate from a Step/Dir from KFLOP.

In this case configure a KFLOP axis as a Step Dir Output mode. Configure the KFLOP Axis to use one of the Step/Dir Generator Device channels.  Probably with TTL output mode.  Wire the Step/Dir outputs for that device to the input on the C23 that will generate the Analog Voltage.  Then from the Console Screen Jog the axis to see if a corresponding Analog Voltage is generated.

You might read this post to help with the concepts.  Although it refers to DAC devices the concept for Step Dir devices is similar.


See also:


It isn't clear what you need the other IO bits for.  You might use the Direction output to control your CW/CCW function/relay.

After you are able to properly control your Spindle using KFLOP Axis Jog Commands you might read this to configure for CSSand so forth:


HTH
Regards
TK



From: "rjreese29@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Thursday, August 14, 2014 6:46 AM
Subject: [DynoMotion] CSS jog and bits on off

 
Hi, It is safe to say, I am not a programmer. I have watched quite a few turorials, learned a bit to get a foundation. So hear I am. We are working on getting CSS to control a step direction spindle on a kflop with a c23 bob. I have followed all of the instruction sheets/tutorial provided. How are bits 154 and 155 turned on and off ( I see no setbit or clear it commands in the files for cw or cww? My bits are not switching when I change these values to 38 and 39 as these will be my stepdir bits in the c files. My c23 has a dac already (I believe) as it generates a 0-10v through port 1 pin14. Any insight would be greatly appreciated. Thanks, Rob






(Message over 64 KB, truncated)
Group: DynoMotion Message: 10037 From: Tom Kerekes Date: 8/26/2014
Subject: Re: CSS jog and bits on off
Hi Rob,

You aren't supplying enough detailed information - exactly what all your files are and what you are doing step-by-stepand what happens.

The code fragment you included seems reasonable with the exception that Velocity of 400 steps/sec and Acceleration of 2000 steps/sec^2 seem very slow.  At that acceleration to Jog to 25000 steps/sec would take 12 seconds.

Also Input channels are set to invalid values of -1, but they should not be used so that shouldn't matter.  But please change them to 0.

Not sure why the files you are creating would be mysteriously changing.

Regards
TK


Group: DynoMotion Message: 10038 From: Rjreese29 Date: 8/26/2014
Subject: Re: CSS jog and bits on off
Hi Tom,

Sorry for not providing you enough info. I will need to take more time to find trends, see stability of turning issues on/off. ... Root cause.
I'll have to take more time to understand all parameters and the effects, them communicate them.

Always, thank you for your -1 vs 0 feedback.

Again, things are working better and more stable. So I think it has been fixed. 

Thanks,

Rob

On Aug 26, 2014, at 11:26 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

Hi Rob,

You aren't supplying enough detailed information - exactly what all your files are and what you are doing step-by-stepand what happens.

The code fragment you included seems reasonable with the exception that Velocity of 400 steps/sec and Acceleration of 2000 steps/sec^2 seem very slow.  At that acceleration to Jog to 25000 steps/sec would take 12 seconds.

Also Input channels are set to invalid values of -1, but they should not be used so that shouldn't matter.  But please change them to 0.

Not sure why the files you are creating would be mysteriously changing.

Regards
TK