![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Gecko Drives Discuss all Gecko drives here and get direct support! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I've had pretty good success with my 320s and mach3, but I'm working on something that needs to be more self-contained than a full pc setup. I'd like to use steppers and the G250X or G203V on this project. I was debating on using on the new 32bit micro controllers that runs the .net micro frame work, which would have a SD card for file, a stop button and a go button. All I need to do is move, I don't need to do any creative tool offset calculations. My questions have to do with how the geckos and motion controllers work. For the geckos, I believe I need to set the direction by making the pin high or low, then I need to send a step pulse(s). From what I can see, there would be at least two ways to do this. I could send high signal, wait 2 uS, send low signal, and then loop for total number of steps until the required number of steps is reached. So in simple pseudo example. //Constants STEPS_PER_INCH_X = 100 STEPS_PER_INCH_Y = 100 PULSE_WIDTH = 2us //Variables Current_X = 0 Destination_X = 2 StepsNeeded = DifferenceCurrentandDestination(Current_X, Destination_X); //If value is negative, set direction negative if (DirectionNegative) { Dir_Pin_X = Low; } else { Dir_Pin_X = High; } for (int i = 1; i <= StepsNeeded; i++) { Step_Pin_X = High; thread.sleep(PULSE_WIDTH); Step_Pin_X = Low; } Or, would I use a PWM feature, that's turned off when a certain amount of time has passed? loop = true while (loop = true) { X_Time = FindTimeNeededToMove(Current_X, Destination_X); Dir_Pin_X = FindDirectionNeededToMove(Current_X, Destination_X); if (X_Time > 0) { PWM_Pin_X = On; else { PWM_Pin_X = Off; } Y_Time = FindTimeNeededToMove(Current_X, Destination_X); Dir_Pin_Y = FindDirectionNeededToMove(Current_X, Destination_X); if (Y_Time > 0) { PWM_Pin_Y = On; else { PWM_Pin_Y = Off; } } Looping constantly to generate the mock PWM is processor intensive, but it appears to be more accurate than a time based system. My concern with the mock PWM is with the clock time required to calculate the pulses. If I use a single micro controller, I don't believe it will be able to move more than one axis with the current mock code. The time based system has an advantage there, I could calculate the time needed for each axis to travel the required distances and turn the PWM off as they meet the destination requirement. I'm concerned that the time based system may not cycle fast enough to turn the PWM off before it's exceeded the travel distance. Or do I have it completely wrong and it works some other way entirely? Thanks, Last edited by Deviant; 12-10-2011 at 07:58 PM. Reason: Typo's |
![]() |
| 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 |
| Anilam 1400M contoller | wes111 | General CNC (Mill and Lathe) Control Software (NC) | 1 | 02-16-2012 08:57 AM |
| Contoller PC | oknups | Tormach PCNC | 14 | 02-04-2012 01:31 AM |
| Need help with serial for CNC 88HS contoller on VMC 3016L | shane.mccook | Fadal | 2 | 07-10-2010 09:26 PM |
| L298/L297 contoller need help | sixpence | General Electronics Discussion | 4 | 04-29-2007 09:11 AM |
| anilam contoller | barnesy | General CNC (Mill and Lathe) Control Software (NC) | 9 | 06-29-2006 04:30 PM |