What's new
What's new

DPRNT to control Arduino based rotary over serial.

D Farms

Aluminum
Joined
Dec 11, 2018
I was searching around on eBay and came across an interesting little trunnion table, link below. I had seen similar units, but they all used belt drive reductions, which from experience will not have enough reduction, and will likely be chatter with any real cutting, not to mention the belt is exposed. This unit however uses a harmonic drive to get a 50:1 reduction, with essentially zero detectable backlash. on top of that, it actually back drives the stepper motor. Harmonic drives are also sometimes called wave strain drives or flex spline drives. Anyways, the trunnion uses a couple of nema 23 steppers, and the holding torque is fantastic, even with a cheap stepper driver. For simplicity I'm using an arduino based controller that runs grbl 1.1f, and a couple of 5-30v inductive switches, links below. The controller can be controlled by sending gcode over the rx and tx pins, aka rs-232. The trunnion unit itself is very beefy for what it is, and has what look to be waterproof seals around all the bearings, so with a bit more sealing on the motors it can probably handle coolant usage.

I was looking on ebay and it looks like there is a smaller single shear unit for about $550, I might buy one of those for my plasma table haha.

I use fusion 360 for all of my CAM, and one of the big draws is it can do multiaxis toolpaths. The second biggest draw, for me at least, is the post processors can be edited. The third thing being the new machine simulation, I was able to use the haas provided model for the CM-1(we have an OM2 at work, but its the same mechanically), and modeled up the trunnion and configured it to behave correctly to simulate indexing.

I modified The pre-ngc 5 axis post and configured it to work with the way I have the trunnion mounted in the machine, then I also modified the output of a and b gcodes for indexing operations appear as shown below.
Standard Post: G0 A0. B90.
Eventual Modified Post: DPRNT[G0 A0. B90.]

Im avoiding altering the grbl firmware for now, just editing parameters, so the gcodes the haas will be sending over serial will actually be X and Z codes for the A and B axiis. Ultimately its not necessary to change the firmware to accept a and b codes, however I want to make it right so its more readable, and there's a few other things I want to change as well.
Current modified post: DPRNT[G0 X0. Z90.]

Things still to work out:

I've done some reading on the Haas DPRNT command, and its very limited. Only A-Z, and +, -, can be put out. The grbl controller has special commands the use the $ symbol, for example to home, or send out positional data over serial. If I edit the firmware I can probably change that and use standard gcodes instead like g28 and g102.

I hooked everything up and the trunnion didn't move(womp womp), so I'm in the process of diagnosing why that is, starting with testing the output of the haas itself. I had one of the pixie wizards hook up the output to his signal analyzer, and he said it was basically outputting noise, so I'm not sure if there's a parameter that needs to be changed, but the control seemed happy with the code I had input in MDI and I made sure the macro parameter was enabled. The code: DPRNT[G0 X90 Z0].

The other issue is the controller doesn't have specific pin or button to home the axiis, for now I have an offline controller, and with it I can run programs from an sd card, i have a program to home the machine using the illegal $H command lol.


Link to buy on ebay, although I got mine through aliexpress for cheaper. CNC Rotary axis Harmonic Gearbox Dividing Head 5th 4th Axis 50:1 reduction ratio | eBay

single shear head: CNC 4th 5th A B Rotary Axis Harmonic Drive Reducer Dividing Head SpeedRatio 50:1 | eBay

Strain wave gearing - Wikipedia

3 Axis GRBL 1.1f USB Port CNC Engraving Machine Control Board CNC Router Engraver Milling Machine Controller board - - Amazon.com
Amazon.com: XJS DC 4.8-30V 500mA NPN NO 3-Wire 4mm Inductive Proximity Sensor Switch SN04-N : Industrial & Scientific
 

mhajicek

Titanium
Joined
May 11, 2017
Location
Minneapolis, MN, USA
In the past I've controlled a Haas rotary with the external control box through Dprint. Setup the Mastercam post to output the Dprint lines. Worked fine, if a little slow.

Don't know much about making an Arduino go though.
 

D Farms

Aluminum
Joined
Dec 11, 2018
I only need to send one line of code to index it, so I cant imagine it will be that slow. at any rate it will be faster and easier than running a separate program on the rotary via sd card and manually commanding it through lines.
 

countryguy

Hot Rolled
Joined
Jul 29, 2014
Location
Mich, USA
Pixie wizards.. LOL That made me crack up! And relative to noise, remember the movie Contact? J Foster, They found some pretty neat data in that noise. I always think of the line "Are you sure your know how to use that thing?".

Redirecting to https://www.cnczone.com/forums/haas-mills/22241-cnc-forum.html

The link I always loose and then go re-find on dprint. Some solid info in there! From a haas standpoint, what software version comes up on your CPU? Am curious. There are some oddities to rev's below 9.64

This is a cool little tool btw
Amazon.com: AirDrive Serial Logger Pro - RS232 Data Recorder with Wi-Fi and 16MB Memory : Everything Else

On the Haas 232 out, Many posts about the D connectors and the pcb and ribbon having issues. Of the 2, which did you connect up to? From the tinyurl... this came to mind and I had to search it out again... (The comments here are limited to port COM1, my term for the data input/output port. This is usually the top 25 pin female "D" connector. The location is determined by how the internal ribbon cables are connected. The second HAAS port, COM2, is used for rotary tables.)

Back to the gear and Arduino. that is the coolest tech since the Apple II imo. So many add-ons and open-source freeware that only the imagination is required.
A POC the kid and I did was via reprap for Arduino. Put a $14 Shield (motor drive) board and an SD port on the Aud. YEah.. gcode city. Had a hoot. anyway, want to pass reprap as something to peek at.

pixie wizard..... OMG Still laughing.
 

CarbideBob

Diamond
Joined
Jan 14, 2007
Location
Flushing/Flint, Michigan
In this arrangement since no motion complete signal how does the cnc program know when to continue to the next line?
Could be one degree or 359. Insert a G04 for worst case on all commands?
Is is possible to do the opposite of a DPRINT and wait on a input from the RS232 line if using only the serial port?
Bob
 

mhajicek

Titanium
Joined
May 11, 2017
Location
Minneapolis, MN, USA
In this arrangement since no motion complete signal how does the cnc program know when to continue to the next line?
Could be one degree or 359. Insert a G04 for worst case on all commands?
Is is possible to do the opposite of a DPRINT and wait on a input from the RS232 line if using only the serial port?
Bob

You could have your post calculate the expected transit time plus a safety margin and automatically output the appropriate amount of G4.
 

countryguy

Hot Rolled
Joined
Jul 29, 2014
Location
Mich, USA
In this arrangement since no motion complete signal how does the cnc program know when to continue to the next line?
Could be one degree or 359. Insert a G04 for worst case on all commands?
Is is possible to do the opposite of a DPRINT and wait on a input from the RS232 line if using only the serial port?
Bob

This was a really good Q Bob. From the page here, There are some active returns you can request. I wonder if those might offer a way?
Configuring Gerbil Grbl v1.1f * paulusjacobus/grbl Wiki * GitHub
was interested in: $10 - Status report mask:binary maybe ? - Current status


a few sources to peek at;
Opensource CNC controller written for Arduino’s (G-code interpreter GRBL) | Protoneer.co.nz

grbl/commands.md at master * gnea/grbl * GitHub
 

Stirling

Cast Iron
Joined
Dec 11, 2013
Location
Alberta canada
Following this one!!!!

I wonder if there is a way to connect this to the haas 4th/5th drives?
I got them all unlocked but no 5th trunnion :(

Really curious to the accuracy/stiffness
 

Garwood

Diamond
Joined
Oct 10, 2009
Location
Oregon
Following this one!!!!

I wonder if there is a way to connect this to the haas 4th/5th drives?
I got them all unlocked but no 5th trunnion :(

Really curious to the accuracy/stiffness

Harmonic drives are neat critters. They are backlash free, but rigidity isn't the best. It's just a couple of gear teeth on a flexible gear inside the drive that's holding everything.

It would be interesting to see that 4th/5th disassembled to see how they did the bearings, if there are any.
 

countryguy

Hot Rolled
Joined
Jul 29, 2014
Location
Mich, USA
yeah, they are. This was a cool article I read this year. Thought of it. If interested on the what&how.
Harmonic Drive | Hackaday


Harmonic drives are neat critters. They are backlash free, but rigidity isn't the best. It's just a couple of gear teeth on a flexible gear inside the drive that's holding everything.

It would be interesting to see that 4th/5th disassembled to see how they did the bearings, if there are any.
 

D Farms

Aluminum
Joined
Dec 11, 2018
This was a really good Q Bob. From the page here, There are some active returns you can request. I wonder if those might offer a way?
Configuring Gerbil Grbl v1.1f * paulusjacobus/grbl Wiki * GitHub
was interested in: $10 - Status report mask:binary maybe ? - Current status


a few sources to peek at;
Opensource CNC controller written for Arduino’s (G-code interpreter GRBL) | Protoneer.co.nz

grbl/commands.md at master * gnea/grbl * GitHub

My plan was to just put a delay long enough to move from any position to another. It would be ideal to have a feedback of the position to minimize indexing time, and if the steppers were closed loop this would force it to wait until it actually reached the position, however this trunnion moves fairly quickly, so it would not be much of an issue, and its open loop for now.

Harmonic drives are neat critters. They are backlash free, but rigidity isn't the best. It's just a couple of gear teeth on a flexible gear inside the drive that's holding everything.

It would be interesting to see that 4th/5th disassembled to see how they did the bearings, if there are any.

Ill take some pics of the guts, There must be some bearings in there.

I guess the other cool thing about this setup is it would work on a manual mill too, if that's your jam.

Following this one!!!!

I wonder if there is a way to connect this to the haas 4th/5th drives?
I got them all unlocked but no 5th trunnion :(

Really curious to the accuracy/stiffness

Its a lot stiffer than those printed diy units you see on youtube, when its powered up it feels like a mechanical lock. the flex spline is steel(hopefully heat treated)40-50mm if i recall, both were the same. I have a pocket nc, and this trunnion is significantly stiffer than the pocket nc, sometimes that table would skip just trying to loosen the er32 collet I have mounted on the table. I guess the real test would be to use a torque wrench and measure angular deflection, although all I have to compare is the pocket nc, and i dont really want to test to failure.
 

D Farms

Aluminum
Joined
Dec 11, 2018
On the Haas 232 out, Many posts about the D connectors and the pcb and ribbon having issues. Of the 2, which did you connect up to? From the tinyurl... this came to mind and I had to search it out again... (The comments here are limited to port COM1, my term for the data input/output port. This is usually the top 25 pin female "D" connector. The location is determined by how the internal ribbon cables are connected. The second HAAS port, COM2, is used for rotary tables.)

The machine is against a wall, so I plugged into what I could feel was the only one db25 connector, I found a pic of another machine on google supporting this theory. I haven't taken a look in the cabinet of this machine, because they left it locked when they transferred it off the floor, and to R&D. Is there any settings that need to be set for output over serial other than the baud rate and rs-232 settings? like do I need to enable that port somehow?
 

Stirling

Cast Iron
Joined
Dec 11, 2013
Location
Alberta canada
No unlocking needed. Typical baud rate, Parity, port#…
All that needs to match both device settings.

How do you like the pocket nc?
They look fun but Joni be wants to give me one for free :( all the owners must be jerks :p

Still waiting for your tutorial on cheap haas 5th so I can show them up :)
 

D Farms

Aluminum
Joined
Dec 11, 2018
No unlocking needed. Typical baud rate, Parity, port#…
All that needs to match both device settings.

How do you like the pocket nc?
They look fun but Joni be wants to give me one for free :( all the owners must be jerks :p

Still waiting for your tutorial on cheap haas 5th so I can show them up :)

Its a good machine to learn on, buts underpowered, not enough rpm, not the most rigid, the chips go everywhere, and the axis on mine don't home precisely. It really does open up the door for small parts though, and does teach you how to deal with 5 axis problems.
 

mhajicek

Titanium
Joined
May 11, 2017
Location
Minneapolis, MN, USA
Its a good machine to learn on, buts underpowered, not enough rpm, not the most rigid, the chips go everywhere, and the axis on mine don't home precisely. It really does open up the door for small parts though, and does teach you how to deal with 5 axis problems.

Maybe put one on the table of a Haas, and talk to it through RS232!
 

D Farms

Aluminum
Joined
Dec 11, 2018
Any update on this project?? :)

Sorry, been busy at work. I haven't been able to get the communication to work at all. I verified the Haas output over serial is working, and I was able to talk to the grbl controller over the serial rx and tx pins from a pc with a usb to serial converter. I also enabled xon/xoff in the grbl firmware, so as far i know all of the serial settings are set up right but directly connecting the haas serial rx and tx to the grbl controller board doesn't seem to work. I think an issue im having is the grbl controller is ttl serial, so I ordered one of these to try. Amazon.com: DTECH RS232 to TTL Converter 5V Serial Adapter RS-232 Female to TTL Male Port with DB9 Breakout Connector Terminal Board 3 Pin RXD TXD GND for Data Communication : Electronics

Also the macro trial randomly ended, so now I have to experiment on my HS-1 at home until I prove this out haha.
 








 
Top