Hi Steve,
I don't see the files. Did you forget to upload them?
For Homing you might look at the SimpleHomeIndexFunctionTest.c example which uses SimpleHomeIndexFunction.c
Regards
Tom,
Here are the files. Everything is pretty straight forward. The Spindle is controlled from a +- 10V signal. It is a three phase controlled my an ALLEN BRADLEY 1398-DDM-019 motor controller. I have it set up as a dumb servo and not using the internal PID controller. It passes through the encoder signals so is transparent in that regard. It has a pretty slow response but I've read that is normal for a spindle motor.
I did change the limits as you suggested and YES! that solved the problem with the limit errors. Having made the CAM change adding the extra M03, I've not had a problem with the spindle not spinning up when the program starts. Next steps are to add Flood and Homing the X, Y and Z axis with series limit switches.
So far, the Kflop/Kanalog is doing an excellent job. The learning curb has been a bit steep but the goal is to get everything running so a user can operate it with minimal instruction. I am still tidying up the wiring. This unit has an automatic tool changer and getting that to work is icing but I'm feeling pretty good about it right now.
Thanks
Steve
Hi Steve,
I don't see the files. Did you forget to upload them?
For Homing you might look at the SimpleHomeIndexFunctionTest.c example which uses SimpleHomeIndexFunction.c
Regards
Regards
TK http://dynomotion.com
Tom,
I guess I must have angered the thread gods... not sure why the files did not upload. Trying again.
I looked at the homing routine... looks pretty straight forward. Fingers crossed and I'll give it a try.
Steve
Tom,
I'm having fantastic success! I managed to add a relay and get the flood to work so I have accomplished all the goals I had set. I have a couple of questions that I need answered to get this thing ready for the average user. To be able to allow normal operation I have to protect people from themselves. Things like, How do I detect when the unit is running G-Code so I can lock out certain buttons like, unclamp the tool, so that a bored user won't press a button and cause a big problem. So that's one question. What tells me that the kflop/kanalog is running a program? I got homing to work but I want to set soft limits. I need to set soft limits in absolute but allow reference in relative so I can change the origin but retain the absolute limits so that the machine will not run out of limits. I also have to be able to index the spindle for the auto tool changer so the index is a differential signal from the encoder, how do I read an index pulse? I have two buttons on the front panel for Start Cycle and Pause Cycle. I want to be able to press those and get a program run and program pause. I can't find a place to define the buttons so that they cause those actions. Any ideas?
So those are my current issues: How to know the program is running. How to set soft limits. How to read differential index pulses. How to set Start and Pause cycles on the front panel.
Thanks!
Steve
Hi Steve,
There is a Macro definition in KFLOP called JOB_ACTIVE. So for example to only allow something when a GCode Job is not running you might code ('!' is the "NOT" operator)How do I detect when the unit is running G-Code so I can lock out certain buttons like, unclamp the tool, so that a bored user won't press a button and cause a big problem. So that's one question. What tells me that the kflop/kanalog is running a program?
if (!JOB_ACTIVE)
{
...
...
}
I'm not sure I understand but the normal procedure is to disable Soft Limits (by setting huge limits) until after Homing is completedI got homing to work but I want to set soft limits. I need to set soft limits in absolute but allow reference in relative so I can change the origin but retain the absolute limits so that the machine will not run out of limits
Index Pulses are detected in a software User Program so they can be connected to any spare (in this case differential) input. To index the Spindle (assuming it can move like an Axis) you might Jog it slowly, loop waiting for the Index pulse, then Stop by Jogging to Zero Speed.I also have to be able to index the spindle for the auto tool changer so the index is a differential signal from the encoder, how do I read an index pulse?
You can add a User Program to monitor (and debounce) push button inputs to issue commands. See the ExternalButtons.c Example.I have two buttons on the front panel for Start Cycle and Pause Cycle. I want to be able to press those and get a program run and program pause. I can't find a place to define the buttons so that they cause those actions. Any ideas?
Regards
Regards
TK http://dynomotion.com
Tom,
I'm still making great progress but have not had as much time to devote lately. I have been trying to read as many programs as I can and I am looking for SSO being applied as a multiplier to the spindle speed. I am reading a pot and it is successfully adjusting the SSO. However, I need to know where the SSO is used to multiply the spindle speed set by the g code S command. I need to be able to limit the S x SSO to 4500 RPM. Where does that happen? I just need to set a condition to limit the speed as adjusted by the pot.
Thanks
Steve
Hi Steve,
I'm not exactly sure if this is what you are asking but your Spindle "S" Program will be sent the S x SSO RPM value that should be set. Your Spindle Program could limit the RPM to 4500.
Regards
Regards
TK http://dynomotion.com
Tom,
Great news, I finally figured out the speed control question. I've probably driven you crazy over this and now it seems relatively simple. In the program SpindleJog that is the execfile for the S command. It reads :
if (USE_POS_NEG_VOLTAGE)
Jog(SPINDLEAXIS,speed * FACTOR * LastState);
else
Jog(SPINDLEAXIS,speed * FACTOR);
Which I modified to :
if (USE_POS_NEG_VOLTAGE)
{ if (SPINDLEAXIS,speed > 4000)
{
Jog(7,4000 * FACTOR * LastState); // jog spindle which is 7 no more than 4000RPM
}
else
{
Jog(SPINDLEAXIS,speed * FACTOR * LastState);
}
}
else
{ if (SPINDLEAXIS,speed >4000)
Jog(7,4000 * FACTOR); // jog spindle which is 7 no more than 4000RPM
else
Jog(SPINDLEAXIS,speed * FACTOR);
}
To make sure that the Variable potentiometer can never drive the spindle faster than 4000RPM. THAT's what I was trying to limit on the dial. In retrospect it seems simple but I was confused on exactly WHERE I should do that. Now I have two new questions. I have almost run out of sensor inputs and I think I know the answer but I wanted to run this by you. It appears that the 40 pin JP12 connector on the kannalog gives me 8 more inputs and outputs. They are 3.3v level but I think I can work with that. Am I interpreting that correctly?
Ok and one more question: How can I change KmotionCNC to default to Inches instead of Millimeters?
Thanks!
Hi Steve,
Great. btw if you use the #CODE tag in cnczone then the code will be formatted/indented better and much nicer to read.
Yes Kanalog has 8 3.3V LVTTL inputs and 8 3.3V LVTTL Outputs on JP12.
The default settings for the GCode Interpreter can be set in the Tool Setup | Tool Setup Files | Setup File. There is an example called INCHES.SET. See here
HTH
Regards
Regards
TK http://dynomotion.com
Tom,
I've been busy but having enormous success and have cut quite a few parts with great precision. I'm still learning how to use this system but so far everything is running great and very stable. I have a continuing problem that I wanted to run by you. I can successfully run a "Home" routine that seeks and finds a switch on all three axis. I want to use that position to set movement limits on the axis. So once I command home for, as an example, the Y Axis. The axis moves backwards towards the column until it contacts the limit switch. my bed can travel maximum of 7 inches in the Y axis. So I want to let the machine know that from the limit switch contact, it can travel no further in that direction and only a maximum of 7 inches in the opposite direction. So if I command it either in the cutting program or by trying to move the bed with joystick or keyboard buttons, it will stop before reaching its limit.
Thanks
Steve
Steve, what you need to implement is soft limits.
You'll need to work out the axis counts you want as limits, then set them for each axis, which you would normally do as part of the homing routine.
To work out the limits, I personally watch the Axis screen within KMotion, and slowly jog the machine into the limit switch. Then add/subtract a suitable safety margin, and use those values to set the soft limits.
You'll probably also want to implement the SoftLimits3Axes example file, so a feedhold gets implemented if you're going to run into a soft limit, as the basic soft limit implementation simply activates after the limit has been exceeded, which means the axis doesn't start decelerating until after the limit has been exceeded.
Ok I finally have time to revisit this limit problem. The machine has been running beautifully and in some ways it is the reason this is plodding along. (It has become a very useful tool and finding down time to continue working on this had become a welcomed problem.) There is an issue I have had since the start. If I move the X or Y axis and it runs into a hard stop on either extreme, the unit apparently continues to try to move beyond the hard stop. Ultimately, it suddenly reverses direction and will slam into the opposite extreme if I don't stop it in time. It is normally not an issue since the part I am cutting has to fit within the limits of the table. The problem comes in when there is a mistake moving the table with the game controller and I accidentally run into the hard stop. What I THINK is happening is that I'm getting some kind of PID integral windup. The unit keeps trying to move and the number generated by the PID continues to get bigger, until it finally overflows the register and crosses zero. The PID number suddenly changes signs and causes the table to run wild in the opposite direction. I THINK this is what happens. I want to fix this for safety concerns. I tried adding the soft limits. It DOES cause a stop by disabling the axis. However, as soon as I re-enable the axis, it takes that opportunity to run wild. Just playing possum until it gets its chance! I think what I need is some way to tell the controller to stop trying to move that direction and not just preventing it from being able to move. Any ideas? Or any thoughts? Am I wrong in my conclusions? Thanks
Steve
Hi Steve,
Normally a small Max Following Error would be set so as soon as the hardstop is hit the Axis would disable.
Soft Limits should not disable the axis so I don't really understand what you describe there.
It also might be how you are enabling your Axes. For a servo system is is usually best to set the Destination to the current Encoder Position when enabling so the Axis remains still. Such as:
EnableAxisDest(0,ch0->Position);
Is that what you are doing?
Regards
Regards
TK http://dynomotion.com
Thank you for the reply Tom.
I am using SoftLimits3Axes and SoftLimits3AxesV2. I have taken these programs and added them to my main program. I also added an automatic Home so that on initialization the machine homes. Homing works great and would be necessary to set valid limits in either of the Soft Limit Programs. Both programs include :
if (InLimit()) // check for any limit
{
DisableAxis(0);
DisableAxis(1);
DisableAxis(2);
while (InLimit()) ; //wait until back within limits
}
Which I take to mean if a Max or Min limit is exceeded, the Axis is disabled until it is back within Min and Max. Am I misinterpreting these programs?
Steve
Hi Steve,
Those examples were created before KFLOP Firmware supported Soft Limits. So you might use the Soft Limits setting instead.
Regards
Regards
TK http://dynomotion.com
Tom,
OK NOW I get it. For whatever reason I thought it was a software implementation from those examples and I was reluctant to incorporate them until I could take time to get it right. I used the soft limit settings and after a little tweaking got the system to home and set limits. Perfect! Thanks again for the great help!
Steve.