Max Velocity regulation via external inputs

More
14 Jan 2012 22:09 #16775 by dsoodak
I am using a 3 axis CNC router with stepper motors (interface: axis direction, step axis)(see "mydiycnc.com")

Before I start digging through the source code, I wanted to verify that the following features don't currently exist in the emc2 software:
1. de-power the stepper motors when not moving.
2. I really like the "Max Velocity" slider. Is there anyway to adjust it based on external digital feedback? Ex: use 2 digital inputs to encode "tool can cut at faster x-y-z velocity", "slow down cutting velocity", "slow down cutting velocity as fast as possible".

Feature #1 I can live without (it just makes it so I have to leave the driver box open for ventilation), but it would be very nice to at least have a "decelerate fast but don't stop" input so it could better handle irregular surfaces without damaging tools.

Please Log in or Create an account to join the conversation.

More
15 Jan 2012 00:07 #16779 by andypugh
dsoodak wrote:

1. de-power the stepper motors when not moving.

Not a built-in feature (it is often a feature of the drives though). It can be added:
thread.gmane.org/gmane.linux.distributio...er/26042/focus=26105
Is a long thread on a similar subject, and somewere in there is a HAL module to do what you seem to want.

2. I really like the "Max Velocity" slider. Is there anyway to adjust it based on external digital feedback?.

Yes: www.linuxcnc.org/docview/html/man/man1/halui.1.html
You have a choice of linking inc/dec pins in HAL, or connecting it to a front-panel encoder.
if you need to know how to use HAL pins, just ask.

Please Log in or Create an account to join the conversation.

More
15 Jan 2012 00:45 #16782 by dsoodak
Thanks for the fast reply! I honestly didn't expect any easy answers.
Now I just have to figure out how to write & load HAL components.

Please Log in or Create an account to join the conversation.

More
15 Jan 2012 00:50 - 15 Jan 2012 00:52 #16783 by andypugh
dsoodak wrote:

Thanks for the fast reply! I honestly didn't expect any easy answers.
Now I just have to figure out how to write & load HAL components.


Nothing so hard, you need HALUI=halui in the right place in the INI file (the [HAL] section) , then a few "net" commands in the HAL file.
www.linuxcnc.org/docview/html/hal_basic_hal.html

(edit) the amp-off is a bit harder, you might need comp
www.linuxcnc.org/docview/html/hal_comp.html
and that needs a "sudo apt-get install emc2-dev" I think.
Last edit: 15 Jan 2012 00:52 by andypugh.

Please Log in or Create an account to join the conversation.

More
15 Jan 2012 10:31 #16788 by Rick G

1. de-power the stepper motors when not moving.


Not sure what you want to do here. If you completely remove power from the drives you risk loosing your position. With and without power the steppers may jump to the closest detent.
When you power up the steppers you may hear a slight thump as they jump to position and any forces applied to them without power could move them.

If you have an available output pin you can use hal to toggle that pin based on a signal.
It is more common to reduce the driver output when the axis is not moving some drives do this automaticaly some have an input for it.
If your driver has an input for low power you can use one of the velocity pin in hal to do this.

Rick G

Please Log in or Create an account to join the conversation.

More
15 Jan 2012 23:11 #16795 by dsoodak
>without power the steppers may jump to the closest detent.
I'm not doing actual microstepping at the moment, though I guess I don't actually know if the detents are at each full motor electrical cycle or at each 1/4 cycle. If they are at each full cycle then I suppose this might be an issue. I'm hoping that the friction created by the anti-backlash mechanisms will be enough to keep me from losing my position.

Please Log in or Create an account to join the conversation.

More
15 Jan 2012 23:20 #16796 by dsoodak
I think I'm starting to understand how to customize emc2 I/O pins, but in order to troubleshoot the hardware mods I need a way to monitor the parallel port.

I found & compiled a program to do this and discovered that even though emc2 communicates fine with my PCI parallel port card (once I entered the correct address), there doesn't appear to be a file such as "lp0" or "parport0" in my /dev folder (which the port testing program needs to function).

Any suggestions?

Please Log in or Create an account to join the conversation.

More
16 Jan 2012 00:54 #16799 by andypugh
dsoodak wrote:

I need a way to monitor the parallel port.

Is this any help?
wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Parallel_Port_Tester

Please Log in or Create an account to join the conversation.

More
16 Jan 2012 03:17 #16802 by dsoodak
Thanks! It worked perfectly and I only had to edit the device address.

Please Log in or Create an account to join the conversation.

More
29 Jan 2012 01:04 - 29 Jan 2012 01:12 #17246 by dsoodak
I took a break from looking at LinuxCNC documentation to actually build the spindle motor current monitoring circuit. This ended up being much harder than expected. Both power and ground had high frequency noise from the switching power supply plus a noisy sine wave as it tried to keep up with the varying current draw of the DC motor.

It's been so long probably noone is looking at this thread anymore, but here's a picture of the bread board rat's nest after I finally found a configuration that worked. The board has its own power source (a battery), and the voltage/current set point is doubled and each sent out to a different output comparator so that I have a hysteresis to work with.


Dustin Soodak
Attachments:
Last edit: 29 Jan 2012 01:12 by dsoodak. Reason: made smaller version of image

Please Log in or Create an account to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum