Thread: Raspberry Pi
Hybrid View
-
20-09-2012 #1
I've been up to my ears in the ARM Coretex Tech Ref manual for the last few days and I think I have the hang...
The snag with accel decel is terminal velocity on a movement which very much depends on it's intersection angle with the next movement.
You don't want to be forever slowing to zero.
You don't want to work that sucker out inside the interrupt.
You have to be able to brake and recover when you hit the PAUSE button.
Looking at it I have a notion that I save the movements with a target max velocity and a desired terminal velocity, I can figure out accelerations and decelerations starting from current speed on the fly using a look-up table. If I bung in a Gig or two of Micro SD card memory I should be able to store the entire cut and simply exchange status data with the host computer while cutting. I think the USB connection becomes a weak link when the motors start turning. Also it would be nice simply to unplug the lap top and take it with me if I wanted to cut "lights out".
I am starting with TIM2 set as a down counter with interrupt on update and a big fat delay in the reload register. That way I can figure out what the delay should be, see how far the timer has got and write the counter register directly with what remains.
The interrupt looks at a status byte and decides what to do. That way my base program can simply tinker with the status byte and everything happens automatically.
Two interrupts per step, one of variable length to control the speed, one of set length, just enough to trigger the step after the DIR and STEP lines have had a chance to settle.
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Similar Threads
-
cnc print a raspberry
By george uk in forum General DiscussionReplies: 7Last Post: 13-06-2014, 01:13 PM -
Raspberry Pi as a PC + Mach3 .. very possible
By Fivetide in forum General ElectronicsReplies: 2Last Post: 05-09-2012, 11:18 PM
Bookmarks