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 > Visual Basic


Visual Basic Discuss Visual Basic programing.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 02-28-2005, 11:20 AM
 
Join Date: Nov 2004
Location: usa
Posts: 49
dwwright is on a distinguished road
Visual Basic Controller Project

Thanks for setting up the new VB Forum. I'm going to continue posting my work log of my visual basic controller from here.

To bring it up to date, I haven't had much time to work on it. I was last working on recompiling and converting the gcode back to a dxf file for export. I got stumped on trying to convert a ellipse, but found that other commercial programs don't import them either. The code that I'm using for the dxf also will help on parsing out the positions to move the xyz motors. I should have time in the next couple of weeks to work on it again.

Here is a screen shot:

__________________
Darren

http://www.libertystainedglass.com
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 05-06-2005, 10:27 PM
 
Join Date: Nov 2004
Location: usa
Posts: 49
dwwright is on a distinguished road
Here's the source

I've not had anytime to work on this. The vb timer doesn't give very good performance, maybe someone else will have better luck. I haven't done any documentation and it has been a while since I dug into it, if you have a question I'll do my best to answer it. The source is in VB6.
Attached Files
File Type: zip WinCNC Controller.zip‎ (402.0 KB, 6137 views)
__________________
Darren

http://www.libertystainedglass.com
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 12-05-2005, 11:43 PM
 
Join Date: Dec 2005
Location: USA
Posts: 10
cboudreau is on a distinguished road
Can I help you with this project? If so what is the issue with the timer?

By the way, I see your into stainglass. Have you made a machine that would dispence the liquid lead onto a glass using CNC?

Carl
cboudrea@pressenter.com
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 08-30-2006, 11:37 PM
 
Join Date: Aug 2006
Location: Egypt
Posts: 10
SeQueNcer is on a distinguished road
I've finished my Software which controls through parallel port...but i've problems with the timer...it give slow performance...if i made loop for sending -for ex. "255"- 1000 times without timer it talkes about 1 second ...if i used timer with 1 mms interval it takes about 17 Seconds...this means it sends 60 mms not every 1 mms ...how can i overcome this .....thanks
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 08-31-2006, 09:11 AM
 
Join Date: Dec 2005
Location: USA
Posts: 10
cboudreau is on a distinguished road
Treading

By threading the timer routine, you separate it from the main process which would be your CNC application. Isolate the timer functions in another form and create a separate process for that form. This is called multi threading, and it allows the processor to give that thread the attention needed for this process (your CNC application).

Lets use people as an example. Picture yourself standing in the middle of 6 people, who are giving you command. 5 of those people represent a diffrent process running on the computer, and the 6th person is your CNC application. You as the processor turns to each person in your circle and asks for instructions. As each person gives to an instruction to you, you complete it and turn to the next person in the circle. When you get an instruction from the CNC person, you execute it and move on to the next person.

So if the CNC person, asks you for the current system time, you give it to him or her, and then move on. By the time you get back to the CNC person, the process as a whole has actually lost ns(nano seconds). Lets say the CNC hears the time from you and it is time to move a Motor, the next command he will give you is to move the motor. You as the CPU comply and move onto the next person (process). When you get back to the CNC person again, he has a list of commands for you but is limited to only one command at time. This limit is your timing issue.

By creating another person(process) and call her Timer Girl. You will actually give your CNC application more face to face time, and therefore speed up your application. Because now you have two people working on your CNC application.

It has been a long time, since I have heard from anyone on this project, if you would like more help, can you update the Zip file and post it here please

Carl Boudreau
Developer / Architect
VB.Net , ASP.Net, VB6, ASP, MSSQL, mySQL - and more...
612-220-8720
cboudrea@pressenter.com

Last edited by cboudreau; 08-31-2006 at 09:16 AM. Reason: Typo's
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-19-2007, 12:27 PM
 
Join Date: Dec 2005
Location: USA
Posts: 10
cboudreau is on a distinguished road
Open Source Visual Basic CNC Software

Anyone working on this project?
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 07-07-2007, 01:43 PM
 
Join Date: Nov 2004
Location: usa
Posts: 49
dwwright is on a distinguished road
Originally Posted by cboudreau View Post
Can I help you with this project? If so what is the issue with the timer?

By the way, I see your into stainglass. Have you made a machine that would dispence the liquid lead onto a glass using CNC?

Carl
cboudrea@pressenter.com
Sounds like a feasible task since I use a glass design software that can output dxf files. However that would take all the fun out of the glass work for me personally, so doubt I'll pursue it.
__________________
Darren

http://www.libertystainedglass.com
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 10-08-2007, 01:43 PM
 
Join Date: Sep 2007
Location: United States of America
Posts: 32
w102acd is on a distinguished road
Higher Resolution Visual Basic Timer

I am new to this forum/site. I noticed that they had VB forums and was just poking around. I do all of my coding in VB and have just started playing around with the parallel port, stepper motors, etc.

I ran into a similar problem and found that there is a much higher resolution timer in vb than just the "timer" function. I was able to get 500 steps per second using this timer a ULN2003A and some Vexta 12V stepper motors. I was.am trying to build a translating XY table using 1/4-20 all thread. This will result in 7.5 inches per minute. Not bad. Not sure what limits this, but beyond ~600 the steppers really start losing steps and are not reliable anymore. If the limiter is the computer than it might be increased for a faster computer. I am using a very old 500 MHz AMD for this and have not tried any other.

The functions are queryperformancefrequency and queryperformancecounter. These functions use the actual speed of the processor as the timer. I've heard that they are accurate to ~5 microseconds!!!!

I have been able to plot things using an etch a sketch very quickly using this method and simply a X,Y coordinate linear interpolation strategy which works alright for the spacial resolution of an etch a sketch. I would post a picture, but my etch a sketch has since broken. Also taking a picture of an etch a sketch is like taking a picture of yourself in the mirror. All your going to see is a nice reflection of my camera and hand.

Not sure if anyone is still watching this thread!!!! If so hope this helps. I can post a better description later if anyone would like it.
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 10-08-2007, 03:21 PM
 
Join Date: Dec 2005
Location: USA
Posts: 10
cboudreau is on a distinguished road
I am watching this thread. And I am interested in continuing the WinCNC application, although I'd like to see it done in VB.Net2005.
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 12-09-2007, 01:09 PM
 
Join Date: Apr 2007
Location: canada
Posts: 7
innova is on a distinguished road
Gentlemen, I am trying to port my dos based app to a VBA app run within Autocad and I am currently up against the timer issue. Would the new dual core processors help out here? One core devoted to the stepper control thread and the other left to take care of Windows needs? I would hate to run out and buy one only to find out it doesn't work that way. Thanks
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 12-10-2007, 04:57 PM
 
Join Date: Dec 2005
Location: USA
Posts: 10
cboudreau is on a distinguished road
Dual core processors is faster but the timer issue is software based not hardware bas

Of course a Dual Core is faster, and if you need validation to ask Mrs. Santa for a New Computer, then your answer is yes “You have to have it.”

But unfortunately, the timer issue is a software operating system issue, and not hardware. I don’t think you can isolate the AutoCAD application to use only one processor would go against the foundation of the hardware architecture.

The fundamental issue if the time is based on the OS. The operating system can still only do one process at a time. A dual core only gives the OS to double the process speed because it duals out the work load to two processors in stead on just one. The OS was not designed to be a PLC, there fore there was no separate timer control built into the OS. Although it looks like things are running at the same time, it is only an illusion, much like to see in an old movie projector, The projector like the OS simply flashes still pictures in your eyes so fast that they seem to be animated. But in reality they are just single pictures or single processors. So if we could speed our brains up to the speed of the computer we would see one process at a time, like we would see one image at a time in the old movie projectors.

The timer is inaccurate because, depending on how many processes are running will determine when the timer process will run. It isn’t, but if the timer process was the only thing running then you could say it is accurate, but if there are 50-60 processes running the timer process runs every 61 times.

Carl Boudreau
Senior Developer VB.Net, VB, ASP.net VB, VBA




Originally Posted by innova View Post
Gentlemen, I am trying to port my dos based app to a VBA app run within Autocad and I am currently up against the timer issue. Would the new dual core processors help out here? One core devoted to the stepper control thread and the other left to take care of Windows needs? I would hate to run out and buy one only to find out it doesn't work that way. Thanks
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 02-14-2008, 03:13 PM
 
Join Date: Feb 2008
Location: usa
Posts: 2
pikovv is on a distinguished road
problems with function Move_Steppers

Dear Mr. Darren Wright,

I hope you can help me in reviving this project. I am quite experienced in VB but am quite a newbie in CNC and motor control. I hope you can explain to me a couple of things in the function Move_Steppers (in the "main" form):
1. Why did you choose CreateWaitableTimer approach for timing control? It appears that its nanosecond resolution is an overkill for this since this function needs to be called 50,000 times a second at most for a regular microstepper controller. So, we only need 20 ms resolution which is attainable with regular VB timer. There is also a more precise ActiveX timer available at http://www.easycode.cat/English/ActiveX.htm which is easy to use in VB.
2. To increment time between the motor steps you are using mySleeper.SleepTime to evoke GoToSleep in the CSleeper. During each increment, you are switching between the STEP and STOP states while the joystick is kept activated. During the STOP state, you send 0 to the step line but keep the value for the direction line.
Then, at the end of the function, you send 0s to all lines but just briefly (probably a few nanosecs) until the function is called again and output is set to the next state. Is this nanosec-long zeroing of outputs between states important?

Thank you,
Victor
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Taig Mill, US Digital MS23, Controller??? marjamar Taig Mills & Lathes 3 02-07-2007 10:16 AM
Open Source CNC Controller Specification gregmary DIY-CNC Router Table Machines 28 12-04-2005 10:58 PM
Visual Basic Controller - pulse width? dwwright Visual Basic 16 08-03-2005 12:57 PM
New Visual Basic forum CNCadmin Visual Basic 1 02-27-2005 08:36 PM
Some basic controller questions Mwilhelm10 General Electronics Discussion 1 10-09-2003 01:45 PM




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