Press Brake CNC Control & G-Code

More
23 Mar 2017 17:02 - 23 Mar 2017 17:11 #90123 by bymccoy
I've been getting very intimate with the machine's electrics, and it seems like I'll be upgrading them at some point as expected...

Now, what's added urgency is that the machine's current NC has an issue and isn't doing anything with the encoder feedback (works manually, but won't position automatically).

So, I need to hookup the encoders and the X and Y motors to something ASAP to give me a basic NC functionality. My thought is to do it quick and dirty with LinuxCNC or worst case with an Arduino.

The encoders are Omron E6B2-CWZ6C, at 100 pulse per rev. These look really common, and there's lots of info for hombrew use of these encoders with Arduino etc.

The X and Y axis both share the same variable speed drive via a pair of interlocked contactors. The VSD has preset high and low speeds set too. The idea is that the forward or reverse signal is used with the fast signal to move the axis rapidly at 50Hz toward the desired position. When it gets close, the fast signal is removed, which reduces the speed to 5Hz for slow seeking of the final position. The encoders need to be monitored for position feedback.

VSD inputs:
- forward
- reverse
- fast

The signals to be sent:

to move X axis:
- X on (to switch on the motor contactor)
- X forward or X reverse
- X fast

to move Y axis:
- X on (to switch on the motor contactor)
- X forward or X reverse
- X fast

There are two feedback from the NC, that then enable the press to be operated:
- X in place
- Y in place

How do I implement the logic, such as the Y then X sequence; to operate signals such as the motor contactor plus the forward/reverse or fast signals; the in-place positions etc in Linux CNC? Theres also a signal to interlock the NC, so that it only moves the X or Y axis when in the home/safe position (so axis are clear to be moved). With a PLC I can easily build the logic, but need to understand the relationship between all of this within Linux CNC...

Mid-term plan is to use something like a MESA board to interface the encoders and IO. The long-term plan are MESA boards to interface all of the new axis servos. But, the short-term plan is to just get the encoder signals into something that can scale and show exact position in mm/inches and can control the motors to set position. I don't have any spare MESA boards to hand. Have a spare PC, some Arduino and some Raspberry Pi. The encoders are read sequentially and never at the same time, so no risk of overpowering even an Arduino.

Help!!
Last edit: 23 Mar 2017 17:11 by bymccoy.

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

More
23 Mar 2017 17:35 #90133 by andypugh

How do I implement the logic, such as the Y then X sequence; to operate signals such as the motor contactor plus the forward/reverse or fast signals; the in-place positions etc in Linux CNC? Theres also a signal to interlock the NC, so that it only moves the X or Y axis when in the home/safe position (so axis are clear to be moved). With a PLC I can easily build the logic, but need to understand the relationship between all of this within Linux CNC...


If you are familiar with PLCs then you can use the soft-PLC in linuxCNC for your sequences.

I am not familiar with PLCs, so I would implement it as a G-code subroutine.

You probably need to use the PID module to combine encoder feedback with output values.

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

More
23 Mar 2017 18:20 #90138 by bymccoy
Thanks Andy...

I'm very comfortable with PLCs, plus these routines are pretty much 'baked in', so I wouldn't consider them as subroutines, but as interfacing with the underlying electrics. That said, I might actually move some of this into a real PLC I'll be installing, and that way I can use a Modbus interface and maybe create pseudo servo interfaces that the PLC will interpret.

In terms of hackable hardware, is there any quick and dirty way of interfacing the encoder with Linux CNC? Not sure how easily I can interface an Arduino etc for basic IO?

Thanks
J

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

More
23 Mar 2017 19:13 #90143 by andypugh

In terms of hackable hardware, is there any quick and dirty way of interfacing the encoder with Linux CNC?


You can connect them to the parallel port if you have one.

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

More
31 Mar 2017 00:29 #90617 by bymccoy
Okay, might try that... Just trying an Arduino with some basic incremental counting code, and it seems to be working well. May just go for a MESA encoder daughter card, they're cheap enough!

Doing the math on the gearbox reduction and motor speed, it would appear at full speed it'll be producing max 4400 pulses per min (under 74Hz). Can the Parallel port stretch to 74Hz?

J

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

More
31 Mar 2017 00:32 #90618 by andypugh

Doing the math on the gearbox reduction and motor speed, it would appear at full speed it'll be producing max 4400 pulses per min (under 74Hz). Can the Parallel port stretch to 74Hz?


Yes, the pport can do 20kHz or thereabouts. Have you checked your maths?

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

More
31 Mar 2017 00:42 #90619 by bymccoy
Yeah, both axis are actually pretty slow...

One motor is 1315rpm, it has a right angle 1:30 gearbox, so about 44rpm output. The encoder is 100pulses/rev, so about 4400pulses per minute, circa 74pulses per second. I suppose to be accurate, the parallel port will be reading twice as many pulses (A and B), but it's pretty low frequency.

The other axis has the encoder on an output ball screw shaft. Not sure what the motor rpm or the gearbox reduction is, but there's also a chain drive (that syncs both shafts), and I think from memory that it's geared down there too. The rotation is not fast, even at full speed!

J

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

More
06 Apr 2017 21:11 #90982 by bymccoy
I'm needing to fit the IO now and get started with this, so trying to figure out what the best MESA boards will be.

So far I'm thinking
- 5i25 superport
- 7i77 6 axis servo card

At the moment I have a single VFD, but will likely add either a second VFD so both motors have dedicated VFD, -or- will fit a pair of direct drive servos (maybe clearpath etc) to replace one of the AC motors, leaving the original VFD to be used for dedicated control of the remaining AC motor. Both of these motors currently have encoders, so:

Servo 1: VFD 0-10V analogue
Servo 2: -none- (shared servo control via EMC)
Encoder 1: Y axis (beam bottom target)
Encoder 2: X axis (backgauge position)
Encoder 3: Y0 axis (beam actual position)

Now the 7i77 has only a single Enable per servo, whilst the VFD drive requires either a FWD or REV enable signal. I can maybe use Servo 1 enable for FWD and hijack the Servo 2 enable for REV - however as they're shared I need an enable for the corresponding motor contactor. Now the FWD/REV need to be isolated which the 7i77 does with the enables and the field IO can handle the motor contactors (I'll probably use solid state interface relays for both).

Long term I want to add probably 6 axis to the backguage, most likely using clear path servos or generic steppers. My thought is that I can use either a 7i76 and/or another 7i77 with the original 7i77 to give me the capacity and the right IO. I can even mix servo and steppers for the backgauges, using the 7i77 for the close loop axis and the 7i76 for the step/dir axis.

I don't actually need masses of IO, as other than the limit switches for the axis, most of the machines IO will be going through a new PLC. Any IO I need but isn't on the CNC IO I can get via ModBus. I want the MESA and LinuxCNC purely for the CNC aspect and will leave the PLC to handle core machine functionality, safety, interlocks, user actuation (pedal/hand controls) etc. The CNC side will handle the stroke distance, "soft" home positions, speed of machine (via digital input with PLC or over modbus, and PLC will enforce laser guard security at positioning speeds etc), encoder inputs for axis and positionig of axis.

Is this logic sound?? Am I picking the best combination of MESA boards for price and IO needed? I can't see a board that'll give me what I need without having to use multiple boards or without committing now to the IO for the future axis...

Suggestions welcome!

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

More
06 Apr 2017 21:16 - 06 Apr 2017 21:20 #90983 by bymccoy
I should even pose another question:

If possible, how can I account for the shared VFD for the servos? Basically when Y is being positioned or moved X can't be and vice versa. I'm not having fixed homing as these axis are relative to the tooling, so I'll either measure their offset or touch the tooling etc, so there won't be a homing routine. Should also clarify, the encoders are not shared, so the position will always be tracked correctly, but it's actuation which is the issue. It's physically interlocked, with a bias to the first motor enabled.

But, I do need to enforce the logic so there's no craziness or fighting over axis in EMC!

Also, will EMC be okay with the same FWD/REV outputs being the same pins on both X and Y axis (i.e. when positioning ends, will EMC stop outputting on those pins)? The only difference being that the enables for each will be field IO.
Last edit: 06 Apr 2017 21:20 by bymccoy.

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

More
07 Apr 2017 00:35 #90984 by tommylight
I would advise not to use a separate PLC as everything can be handled by Linuxcnc as far as i know, it would require some programing but i doubt it would be hard.
7i77 has a single enable for 5 axis and a separate one for the spindle so you could use that, and forward and reverse can be sent to any output pin. Enable signals can also be sent to any output pin so they can be enabled separately for different purposes. The only diference is that field IO are not isolated from Vfield and ground, while enable outputs are isolated.
The " do not move X axis while Y is moving" can be aranged in hal with an XOR gate, same can be done for VFD if needed.
I would need to see the machine and analyse the inner workings to understand more and subsequently give more advice.
Regards,
Tom
The following user(s) said Thank You: bymccoy

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

Moderators: cncbasher
Time to create page: 0.180 seconds
Powered by Kunena Forum