Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: mark4 on April 25, 2020, 10:36:01 AM

Title: Dro counter
Post by: mark4 on April 25, 2020, 10:36:01 AM
Hello I have not been able to find information on how to set up a dro to count on an input.
I am programming an automatic tool changer and it has 21 tools. the changer has a sensor that
triggers once per tool. The dro needs to count to 21 then reset to 1. I am then planning a homing
routine that will move the carousal to the home position and trigger a sensor and reset the dro also. that should be easy after i get it to count.

This is an extra tidbit. The machine i am upgrading is a cincinati millicron with a 6000 rpm spindle. the question is in the original control that i never saw work. when the spindle is screaming along at 6000 rpm and you call for 0rpm or dead stop was it immediate or was there some delay. In other words from 10v to 0v instantly? If anybody has seen one actually running.

Thank you
Mark
Title: Re: Dro counter
Post by: mcardoso on April 27, 2020, 10:49:49 AM
This sounds like a custom script. You'll want a script that responds to the button press, reads a register value, increments and saves the register value, and a DRO that just displays the data in the register. The DRO is a dumb object on the screen - just a display. Adding the homing would be easy

The signals script is probably the best place to write this code. I tend to add to the signals enumeration inside the screen load script, although it can be done elsewhere. PMC is also an option, but this is such a simple script, I'd encourage you to try out LUA. Do some research on the signals script and how to read and write registers. Feel free to ask questions here if you get stuck.

If this is a mechanical switch, your hardware better have some filtering or you'll get input bounce where it will count many times for a single switch hit. This can be handled in software too, but easier if your motion controller filters inputs (I know the ESS does).

I don't know how the machine would have worked originally, but I would personally want 2 cases. An M05 should ramp the spindle to a stop gently, however (if your VFD can handle it with a braking resistor) an ESTOP should stop the spindle in a minimum amount of time. No need to do this for every stop as it will stress the electrical components in your VFD and wear it out faster.

Mike
Title: Re: Dro counter
Post by: mark4 on April 27, 2020, 09:02:05 PM
Hello Thank you for the reply I found this searching and it does exactly that registers. I am going to give it a go
https://www.machsupport.com/forum/index.php?topic=38376.msg260231#msg260231

I like the idea of ramping my m5 to a stop but haven the foggiest how to go about it. This is a kollmorgan vfd and fancy
the only reason i can get where i am is I have full documentation and electrical drawings as to how it was hooked up.
My usual westinghouse vfd's have ramp settings and you can adjust. i have a guy i am going to call that has seen them run
I am going to ask him how they stop.

I will post back my progress or not.
Mark
Title: Re: Dro counter
Post by: mcardoso on April 28, 2020, 08:43:16 AM
Nice! There are some great guides to registers on here. I figured I'd let you do the research, but please ask questions if you get stuck.

Most high end VFDs like you have will have a million configuration parameters. It can be a chore to learn the manual and set them up, but if you know a guy who works with them, then you're way ahead of the game. I would look to see if you can add a "fast stop" to the drive as a digital input. When the signal goes low, the drive does a max ramp to a stop. Just an idea for safety, otherwise let Mach 4 handle the normal accel/decel.