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 11-27-2010, 11:32 AM
 
Join Date: Feb 2006
Location: USA
Posts: 2,375
HimyKabibble is on a distinguished road
PIC-Based Step Generation With Linear Acceleration?

Has anyone implemented a good step pulse generator with linear acceleration on a PIC? If so, what kind of step rates can you achieve with a 20MHz PIC?

Regards,
Ray L.
Reply With Quote

  #2   Ban this user!
Old 11-30-2010, 10:10 AM
The Blight's Avatar  
Join Date: Sep 2006
Location: Denmark
Age: 27
Posts: 563
The Blight is on a distinguished road

Well it depends on many factors such as how many axis to move, how far... etc. If it is for single axis or rapid movement, then around 25khz. If you want multi axis movement, you will probably end up at around 15-20khz.

It also depends on how you program the thing. I'm doing it with assembly all the way.

PS. forgot to mention that this estimate is for a PIC18. PIC16 would use much longer time as it doesn't have a multiplication instruction.

Last edited by The Blight; 12-01-2010 at 04:34 PM.
Reply With Quote

  #3  
Old 12-04-2010, 06:54 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,251
RomanLini is on a distinguished road

You can do a steprate at 39062 Hz on a PIC 18 with the interrupt every 256 instructions.

If you are good enough to do 3axis acceleration math *and* control everything with an int of 256 instructions... Well that's a different matter.
Reply With Quote

  #4   Ban this user!
Old 12-04-2010, 12:44 PM
The Blight's Avatar  
Join Date: Sep 2006
Location: Denmark
Age: 27
Posts: 563
The Blight is on a distinguished road

So far I can do 2 axis in about 250 instructions. 3 axis takes about 400. This is with a maximum amount of steps at 2^32, and up to 2^16 steps per unit.
Reply With Quote

  #5  
Old 12-06-2010, 04:36 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,251
RomanLini is on a distinguished road

Is that with all the linear acceleration ramps running?

I did it with full 3 axis and receiving serial comms on a 18F2221 but it was tight as heck, I had to use some inline assembler and some clever old-school tricks too. It's not for the faint hearted.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-06-2010, 08:59 AM
Khalid's Avatar  
Join Date: Apr 2006
Location: Pakistan
Age: 32
Posts: 2,851
Khalid is on a distinguished road

Hi Roman,
sometime i wish if i had a knowledge like you..
__________________
http://free3dscans.blogspot.com/ http://my-woodcarving.blogspot.com/
http://my-diysolarwind.blogspot.com/
Reply With Quote

  #7   Ban this user!
Old 12-06-2010, 11:41 AM
The Blight's Avatar  
Join Date: Sep 2006
Location: Denmark
Age: 27
Posts: 563
The Blight is on a distinguished road

With acceleration on all axis at the same time. And feedrate adjustments (10-100%).

Because I'm writing everything in assembly, I can tailer the routines for a specific task.

I'm using a SD card for programs with FAT16 support.

I have been working on this project for several years now. About 2 times a year I get really inspired and work 8+ hours per day on it for a couple weeks. After that I'm pretty exhausted (it keeps me awake at night), and I end up getting so tired of it that I have to find something else to do for the next 6 months or so.

One day it will get done!

Roman, did you post your project here on the zone? I believe I have seen 2 or 3 projects of that kind.
Reply With Quote

  #8  
Old 12-10-2010, 04:16 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,251
RomanLini is on a distinguished road

Hi Khalid! I've seen your web pages, you have lots of specialist skills too!

The_Blight- Doing SD and FAT16 in assembler is pretty hardcore. And I hear you re the getting burnt out thing, I'm sure we've all done that on some jobs when after a few days you just can't stand to look at it! These days I mainly do embedded in C with some inline assembler of the speed critical parts.

Here's the link to my machine build, there's not a huge amount of info on the electronics but you may find it interesting;
http://www.cnczone.com/forums/cnc_wo...ll_router.html

I threw the PIC18 3 axis controller together in a couple of afternoons work, but then I didn't have to do SD and FAT16 with it, just some serial comms and safety routines.

I'm curious what your 2-axis controller is for? If it's for a PNP machine I have recently started a build for one myself;
http://www.cnczone.com/forums/rc_rob...p_machine.html
Reply With Quote

  #9   Ban this user!
Old 12-10-2010, 12:22 PM
The Blight's Avatar  
Join Date: Sep 2006
Location: Denmark
Age: 27
Posts: 563
The Blight is on a distinguished road

Saved your link for later reading Never seen your build before, so I will enjoy it.

About SD and FAT16, it takes quite a bit of reading to get it to work properly, but it was quite fun too. The sad thing is that I don't make many comments the first time through. So the second time I opened the thing, I had no idea what I had done. After that I made a lot of comments and files explaining whats going on. That takes as much time as the programming itself, and so this is moving along quite slowly. I'm not a programmer at all, and so everything that I know, I have thought myself. I'm pretty sure that if someone doing this for a living saw my code, they would be scratching their head and wondering what the hell I have been thinking. Hehe.

Now I'm done with all the math routines I will be using except 64-bit square root (did 24-bit but found out that it was not good enough, and had to be expanded for 64-bit and I just got tired of the thing).

It is actually a 4 axis cnc controller, with 2 spindle controllers. Its for my lathe and mill.

Nice pick'n'place project! I'm going to be following that one with great interest! I have an engraving machine for PCBs which I had an idea of using as a PNP machine, but never really got anywhere with it.

Do you still use your controller?
Reply With Quote

  #10  
Old 12-11-2010, 10:04 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,251
RomanLini is on a distinguished road

Yep my controller is the main brain inside my CNC machine, it gets used a few times a week.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 12-11-2010, 02:53 PM
The Blight's Avatar  
Join Date: Sep 2006
Location: Denmark
Age: 27
Posts: 563
The Blight is on a distinguished road

I actually noticed while reading through your topics. Quite impressive builds! Seems like you have some of the same plans as me with this project.
Reply With Quote

  #12  
Old 12-13-2010, 07:36 PM
Gold Member
 
Join Date: Mar 2003
Location: United States
Posts: 2,717
Mariss Freimanis is on a distinguished road

I use an Actel FPGA for the actual step pulse generation. A PIC24F generates 16-bit velocity commands and an SPI interface feeds them to the FPGA. The FPGA generates interrupt timing back to the PIC to have it update the FPGA with new velocity words every millisecond. This allows for a comfortable 16,000 instructions between ISR updates. The velocities (32K CW and 32K CCW) are evenly spaced because the FPGA produces a frequency directly proportional to the velocity command word.

Mariss
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Corner Step Acceleration flash319 LinuxCNC (formerly EMC2) 3 05-07-2010 06:16 PM
Need Help!- Loosing step more and more on X axis only after reducing the accl/velocity step motor Calico DIY-CNC Router Table Machines 3 04-09-2010 07:23 PM
Need Help!- Step/Direction pins should be Step FWD and Step BACK rayscott Mach Software (ArtSoft software) 6 02-09-2010 05:57 PM
Just IN- MRS Sigma: the Next Generation Miniature Linear Guide Pacific Bearing Product Announcements & Manufacturer News 0 01-20-2009 10:21 AM
Step by step cnc plasma with parts list and links. massajamesb CNC Plasma and Waterjet Machines 8 07-08-2007 10:22 PM




All times are GMT -5. The time now is 03:47 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