I don't do Arduino, I do ATMEGAs with GCC.
Anyway, I would try to create a timer interrupt. Before starting the
timer, it is possible to set a starting value for the counters. In the
interrupt vector routine, one could set each time a new
increasing/decreasing starting value, to create ramps.
Or, alternatively, one could do something like this:
uint16_t max=100,min=0,c;
for (c=min;c<max;c++)
{
_delay_us(c);
set_your_softPWMpins();
}
At least AVR-GCC.
With arduino and java(?) i have less clue..
greetings,
bernhard
On 4/14/2010 9:49 PM, Greg Bentzinger wrote:
> Hello List;
>
> I have a simple machine that needs a single axis control to rotate a crank
> shaft 220 degrees then back. I plan to use a NEMA 34 stepper and a Gecko for
> the motion. I will mount large XL pulleys on the crank and use about a 5:1
> reduction ratio.
>
> Limit at one end of the stroke home at the other.
>
> I want to use an Arduino to run the thing, but I have not found much info in
> the area of programing accell curves for the step/dir outputs.
>
> I need to program ramp to max, move xxx steps, ramp down to a very slow speed
> for the last 30 degrees, stop and dwell then ramp to max back to home and
> stop.
>
> I have been searching the Arduino forms and most examples are for users
> actually trying to control the phase outputs of drives they have built on
> "shields". Also these users believe in "Instant acceleration" they just start
> a pulse stream with no ramp up. Floppy drive steppers turning tape flags can
> kinda get away with that, but I'm driving a load on a Nema 34 and I don't
> want to pound the crap out of the works.
>
> My plan goes like this:
>
> Digital Inputs:
>
> a} Home switch
> b} Limit switch
> c} Jog forward
> d} Jog reverse
> e} Start
> f} menu ?
>
> Digital Outputs
>
> a} Direction
> b} step
>
> Analog Input - Potentiometer as feed override 0-100%
>
> Estop will be all hardware so its not an issue.
>
> I ask here because I know a few users have been toying with the Arduino for
> use as a cheap micro PLC to work with EMC2.
>
> I'm just looking for a few lines of code that show how to insert accell /
> decell ramps into the sketch.
>
> I will end up mounting a degree wheel on the crankshaft and adding or
> subtracting steps as required for best use.
>
> Right now it is all done by hand with a lever. I expect running by hand is
> faster - but slow and steady wins the race and operator ( that would be me)
> fatigue is always a factor in actual production output.
>
>
> And because Enquiring minds will want to know... The application is a 1964
> model (San Diego) Star Lube sizer. :) With all the extra bells and whistles
> (almost), Base heater, Lube pressure system and bullet feeder.
>
> Maybe later I can build a mini Puma robot to sort them.
>
> Thanks all.
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users