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! > Electronics > PIC Programing / Design


PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-20-2005, 08:18 AM
 
Join Date: Jun 2004
Location: United States
Posts: 57
musicmkr is on a distinguished road
PIC Embedded design Question

My company has me building a 3 axis mill/router for repetitive tasks milling aluminum extrusions. There are basically six different programs this thing will run for the first year of it's life so instead of running it from a PC & parallel port I am building a stand alone controller based on a PIC 18F452. The PIC will provide step/dir signals to drive the three geckos.

The reason I am doing it this way is because no one in our shop has ever used any type of CNC machine, so I want it to be simple "push button" operation. Also I want the machine to home before every operation and it's very simple to get the PIC to do this automatically, however with a PC the operator would have to tell it to home.

My first question is; has anyone on this board done anything like this before? I've been making huge progress on the ASM code but I don't want to re-invent the wheel if I don't have to. I've been on luberth's site but his project seems to be based on a trickle link from a PC, and I'm pretty sure the PIC is the motor driver itself.

Next I'm wondering if anyone has any insight as to which is the better method of Pulse Modulation. I could use software to pulse the step pins with calculated delays to determine the phase, or another method is to use timers and interrupts. But that leads to the possibility of interrupts "butting heads".

My last question is regarding two axis circular interpolation. Has anyone done this to any level of accuracy using a PIC? My application shouldn't require very precise circular interpolation, and I'll probably just have the software break down any curves into small line segments, but I was just wondering if anyone has any experience in this area.

Thanks for any insight you may have. I've asked a few of these questions on PIC boards but most of those people don't understand the importance of accurate step pulses in the CNC world.
Tweet this Post!Share on Facebook
Reply With Quote

  #2  
Old 06-20-2005, 10:02 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 15,710
Al_The_Man is on a distinguished road
Buy me a Beer?

Are you commited to PIC design? If you are open to different solutions with less leg work and need a system that runs dedicated programs and do not require graphical operator input etc, then one easy way is to look at something like this.
http://cgi.ebay.com/ws/eBayISAPI.dll...sPageName=WDVW
The programming is very easy and if the programs are not that large they could all reside in the controller, initial programing is with the free downloadable software and is done with a PC through the serial port.
All the interpolation is done for you and it offers both stepper or servo output.
Just an alternative suggestion.
Al.
__________________
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 06-20-2005, 10:15 AM
 
Join Date: Jun 2004
Location: United States
Posts: 57
musicmkr is on a distinguished road

I knew there had to be something similar to what I want to build. Even at the E-bay price it's more that I was looking to spend, and there's just something that my employer doesn't like about purchasing equipment from ebay.

Plus I've already got the PIC running a LCD with a menu interface, and it's reading the home switches and other inputs just fine.

Thanks for the suggestion though, I'll keep it in mind for future projects.
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 06-20-2005, 03:01 PM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 908
H500 is on a distinguished road

I think it would be easier to use a timer interrupt to pace your stepping pulses. The PIC is not particularly fast when doing math calculations that you need for circular interpolation. Activities such as keyboard scanning and LCD driving don't need to be done in an interrupt.

Remember that the geckos are microstepping controllers. If you have it set to 8 microsteps per step, with a 200 step motor going at 600rpm, you will need to generate stepping pulses at 16khz for each motor. Do a cycle measurement on the mplab simulator. I suspect that the PIC isn't nearly fast enough. You might want to take a look at the DSPIC.

Why not just use a 100mhz PC? You can easily get them for $20.
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 06-20-2005, 03:12 PM
 
Join Date: Aug 2004
Location: US
Posts: 2,782
ViperTX is on a distinguished road

Al, that's just the controller...how much more for the servo drivers?
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6  
Old 06-20-2005, 04:08 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 15,710
Al_The_Man is on a distinguished road
Buy me a Beer?

Originally Posted by ViperTX
Al, that's just the controller...how much more for the servo drivers?
What ever brand you want to use, step and direction or analogue.
I presume in his case with a PC, he would have to buy them anyway, unless one goes with PIC drives also, If the Galil goes for around the present listing, thats less than 10c on the dollar.
I have used this type of product for simple stand-alone systems as everything is in there for motion control as well as some I/O. The last one I did was a 30ft 3 axis line punch I used the communication program as a simple operator interface where he could home, jog and download hole punch dimensions for the whole part in one shot. All the drives were the existing DC SCR drives and motors.
Al.
__________________
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #7  
Old 06-20-2005, 05:29 PM
*Registered*
 
Join Date: Apr 2004
Location: Norway
Posts: 678
ESjaavik is on a distinguished road

As this is for your company, have you figured out how many hours you will spend.
- Making the hardware.
- Making the software.
- Debugging them both.
Multiply with your hourly pay + social costs + company admin cost.
Then add cost of junk parts while debugging.

For a hobby project, it (usually) does not matter for a number of reasons. Different reasons for each of us.
Tweet this Post!Share on Facebook
Reply With Quote

  #8  
Old 06-20-2005, 05:43 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 15,710
Al_The_Man is on a distinguished road
Buy me a Beer?

Originally Posted by ESjaavik
As this is for your company, have you figured out how many hours you will spend.
Yes, that was one of the reasons I mentioned this item, as if this is a commercial venture, I would expect a ROI to be very rapid if you could cut the development cost by getting a $3000.00 controller for $250.
Al.
__________________
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 06-21-2005, 01:06 PM
 
Join Date: Jun 2004
Location: United States
Posts: 57
musicmkr is on a distinguished road

Thanks for all the advice.

Like I said in my original post, no one in our shop has ever run a CNC machine, and many of the guys who will be operating it have never touched a computer. That's the reason I don't want to just set up an old PC to run this thing. It needs to be idiot proof or I will have a miserable next six months.

I've been working with the PIC 18F452 which runs at 40 Mhz. Even with the timer dividing factor, the timers will operate at 10 Mhz. That should be more than fast enough to pulse the geckos, even at 1/8th microstepping. My leadscrews are 5 tpi ball screws so 600 rpm would be 3000 ipm, that's much faster than I'm going to be going.

I have thrown out the idea of messing with circular interpolation, and have broken down any curves into simple line segments.
Tweet this Post!Share on Facebook
Reply With Quote

  #10  
Old 06-21-2005, 01:10 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 15,710
Al_The_Man is on a distinguished road
Buy me a Beer?

Originally Posted by musicmkr
Like I said in my original post, no one in our shop has ever run a CNC machine, and many of the guys who will be operating it have never touched a computer. That's the reason I don't want to just set up an old PC to run this thing.
Just to clarify, a PC is not required to run the unit I mentioned, only to initially write the control program, after that it is stand alone and could be initiated by a simple push button.
Al.
__________________
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 06-21-2005, 01:17 PM
drawbar's Avatar  
Join Date: Apr 2004
Location: USA
Age: 43
Posts: 90
drawbar is on a distinguished road

5 TPI @ 600 RPM = 120 inches per minute

--Brian
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 06-21-2005, 01:56 PM
 
Join Date: Jun 2004
Location: United States
Posts: 57
musicmkr is on a distinguished road

Originally Posted by drawbar
5 TPI @ 600 RPM = 120 inches per minute

--Brian
Oops! It's been a long day....
Tweet this Post!Share on Facebook
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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 02:29 PM.





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