CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2)


LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 08-24-2010, 12:01 PM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road
EMC with Arduino for USB I/O?

I'm looking to build a custom keypad which would have a large number of keys, some of which I'd like to include status lights which would reflect the state of the machine (such as the G20/G21 for inch vs mm mode).

Basically, I will have too many I/O lines for simplistic use of the parallel port, and I'd prefer to avoid something like a Mesa card, mainly for cost reasons.

I've built a bunch of things using the Arduino boards before, and I'm curious whether anyone has gotten one to talk with EMC. If there is a way to send discrete messages ("G20 is enabled") between the two systems, then I can easily figure out how to wire up the keypad with the Arduino.

Has anyone done or seen anything along these lines?
Reply With Quote

  #2   Ban this user!
Old 08-24-2010, 04:27 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

look here:
http://axis.unpy.net/01198594294
Reply With Quote

  #3   Ban this user!
Old 08-24-2010, 08:42 PM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

Thanks Chester. That worked--well, I was able to turn an LED on and off using the test control panel. I don't really understand the parts well yet, or how they fit together, but at least they seem to fit! From experience I know it's easy to spend hours trying to get Plug A to fit into Socket B so it is always nice to see "hello world." Now the real work begins....
Reply With Quote

  #4   Ban this user!
Old 10-12-2010, 11:56 AM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

Since my last post I've managed to get things working pretty well. I ended up starting over pretty much from scratch compared to the example chester88 posted, cribbing together bits from various tutorials and asking stupid questions on the EMC lists and IRC channel.

This video shows an Arduino being used as both an MPG with an encoder and a remote DRO with a 20x4 LCD. Cost of the whole setup is a little under $100 so far.

YouTube - Integrating an Arduino with EMC
Next step is to design and etch up a board to support a full keypad. I have 10 I/O lines to work with, which would give me room for a 25-key matrix. If I can squeeze all that in, it will make a pretty nice unit. As it continues to mature a bit more I will post sources for anyone who wants to see how it all goes together.
Reply With Quote

  #5   Ban this user!
Old 10-12-2010, 01:03 PM
 
Join Date: Jun 2005
Location: norway
Posts: 53
henrikw is on a distinguished road

Nice! I'd love to see a finished product. Maybe as a kit
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-18-2010, 06:35 PM
 
Join Date: May 2006
Location: United States
Posts: 117
lumberjack_jeff is on a distinguished road

seconded. A kit for a usb pendant/remote DRO would be really cool.
Reply With Quote

  #7   Ban this user!
Old 11-12-2010, 05:23 PM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

OK, so here's the latest:

YouTube - Arduino EMC Pendant II
This adds a 25-key keypad to the mix, which I wasn't sure if the Arduino could cope with on top of the encoder and LCD. So far, so good. 25 keys is a pretty healthy number, and unless your machine has an ATC or some other sophisticated systems, should be enough to cover around 95% of what you'd want on a hardware interface. As it is now, I have these:

- XYZA axis selection
- Jog rate selection (4 positions)
- Spindle speed and feed rate override select (uses the encoder)
- X and Y continuous jog
- Coolant on/off
- Axis home (homes the selected X/Y/Z/A axis)
- Cycle start, stop, pause, and single block mode


If anybody has some suggestions for what they'd like to have, I'm all ears. I'm considering getting some quotes for proper membrane keypads to see how much it would cost to do say 50-100 of them, versus a PCB with switches and a printed overlay. Obviously there are going to be some differences between a router table, milling machine, and lathe, so whatever I do, you're probably going to end up with a few labels stuck on top of it. Either way, the hardware config will be hackable to allow you to get it to do what you want.
Reply With Quote

  #8   Ban this user!
Old 11-19-2010, 03:45 AM
 
Join Date: Aug 2003
Location: Bergen, NORWAY
Posts: 8
Gunnar is on a distinguished road
Smile

Hi sansbury!

Nice work.
This is something that i have been looking fore. One thing to implement is the connection of touch probe so you can use it for scanning, center finding and so on with the G38.2 code.
Why are you not using Z in continuous?
Reply With Quote

  #9   Ban this user!
Old 11-19-2010, 10:18 AM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

Thanks Gunnar!

The keypad design is still evolving. The main reason I didn't add continuous jog keys for the Z was that in my experience, the Z moves a lot less than X/Y. If you want to retract the Z all the way, there is always the homing function, assuming your Z homes away from the table (as is usual).

But, if you prefer, you could modify the keypad and firmware pretty easily to support a Z jog instead of tool release, coolant, or some other function you don't care about that I do

Probing is a good question. My sense was that the right place to implement this might be in the EMC GUI layer, rather than the pendant. Probing the center of a pocket is easy since there's only one way to do it, but edges have four possible ways to go, so you need at least 5 keys, unless you want to have multi-key functions (e.g. select probe function, select axis, select direction) which are harder to use and make the software more complicated.

One thing I might look into is the use of soft keys, though these also add a good deal of complexity to the software, and I'm not sure how much headroom I have at this point.
Reply With Quote

  #10   Ban this user!
Old 11-20-2010, 11:34 PM
 
Join Date: Nov 2010
Location: USA
Posts: 4
half_life is on a distinguished road

Sansbury, good job so far. I am planning on using an arduino or a teensy++ for my sensors (limits, over-current, axis encoders etc). I was wondering if you could share any of the details. For instance, are you running firmata on the arduino and grabbing the info from within EMC? Any info you can share as far as setup on the EMC side? Are you using USB serial or direct serial? In case you are curious about the teensy, it has a higher gpio count (45 in the case of the ++ model) plus speaks at usb bus speeds vs serial speeds. Did I mention that it is cheaper and easier to breadboard?
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 11-21-2010, 03:46 PM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

half_life, I did a longer write-up on my blog that goes into a bit more detail:

Arduino-EMC Integration: How it Works | Just Milling Around

I am not using Firmata, I implemented my own serial protocol. Outputs to the Arduino are seven-character fixed-length messages like "X123456" which would be interpreted as "the X axis position is now 12.3456." The Arduino outputs are shorter, only 3 chars, as they don't need to carry nearly as much information. I could probably cut the length of both in half, at the cost of making them harder for humans to work with. Given that current performance appears adequate, I'm leaving it be.

The reasons I chose the Arduino are simple: it's drop-dead easy to work with, and has a huge installed base. If somebody wants their pendant to have probing functions instead of coolant and spindle control, I want it to be easy for them to do that. Right now, I think Arduino is the best place to start with that goal in mind. The teensy or some other less-common solution, let alone something that requires an external programmer, would be great if I really wanted to extract maximum commercial value at the cost of end-user openness. For an example, the Shumatech DRO's software and schematics are open, but as best as I know, the only DROs out there using that code are Shumatech's. Given that this thing can do a lot more than a DRO, I'd rather give up some number of sales to people who DIY the whole stack and benefit from the whole community contributing code and using this platform as the basis for more intricate HMIs.
Reply With Quote

  #12   Ban this user!
Old 11-21-2010, 06:52 PM
 
Join Date: Oct 2010
Location: usa
Posts: 34
holyjewsus is on a distinguished road

Does your sourcecode/ the HAL system in general allow the arduino to also generate step and dir signals to control steppers directly from EMC?
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
My new CNC machine. Arduino controlled: aventgps Open Source CNC Machine Designs 45 05-03-2012 11:39 AM
Free Arduino online course Ron Thompson Web Deals/coupons 4 08-09-2010 12:08 PM
Arduino Resolver Converter andypugh Open Source Controller Boards 2 08-06-2010 09:21 PM
Arduino Mega driving my cnc. aventgps Videos 2 12-30-2009 01:57 AM
Need Help!- Arduino AlienCNC C control gremilRoute General Electronics Discussion 6 04-23-2008 04:02 PM




All times are GMT -5. The time now is 04:57 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361