![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Visual Basic Discuss Visual Basic programing. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| 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.
__________________ Darren http://www.libertystainedglass.com |
|
#3
| |||
| |||
| 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 |
|
#4
| |||
| |||
| 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 |
|
#5
| |||
| |||
| 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 |
| Sponsored Links |
|
#6
| |||
| |||
| Open Source Visual Basic CNC Software Anyone working on this project? |
|
#7
| |||
| |||
__________________ Darren http://www.libertystainedglass.com |
|
#8
| |||
| |||
| 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. |
|
#9
| |||
| |||
| 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. |
|
#10
| |||
| |||
| 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 |
| Sponsored Links |
|
#11
| |||
| |||
| 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
|
|
#12
| |||
| |||
| 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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |