<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: High Level approach to Stepper Acceleration curve</title>
		<link>http://forums.leaflabs.com/topic.php?id=1632</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:39 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1632" rel="self" type="application/rss+xml" />

		<item>
			<title>ZotDitzMyo on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10485</link>
			<pubDate>Fri, 04 May 2012 09:29:28 +0000</pubDate>
			<dc:creator>ZotDitzMyo</dc:creator>
			<guid isPermaLink="false">10485@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;gbulmer: Thanks for the extra info. So much stuff to read now!&#60;/p&#62;
&#60;p&#62;The DMA approach is used in Application Note 2820 from ST: &#60;a&#62;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00207733.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I haven't yet looked at how easy it is to implement DMAs with LibMaple, but it surely can't be more complex than that ST application note!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10484</link>
			<pubDate>Fri, 04 May 2012 07:35:01 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10484@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ZotDitzMyo - okay, I understand now. &#60;/p&#62;
&#60;p&#62;My assumption is torque is reduced by microstepping at constant voltage, because the current has much less time to build up.&#60;br /&#62;
(see &#60;a href=&#34;http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Stepper_Motor_Speed_Limitations)&#34; rel=&#34;nofollow&#34;&#62;http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Stepper_Motor_Speed_Limitations)&#60;/a&#62;.  Hence, if there is quite a lot of friction to get started, it might become more complex than running at a constant microstepping rate. I'm not saying this will happen, just something to be aware of. That stepper driver is quite sophisticated and appears able to use higher voltage to maintain drive current, so this might be irrelevant.&#60;br /&#62;
(A few mHenry of inductance would resist current build up of even 48V for quite a long time compared to 11us)&#60;/p&#62;
&#60;p&#62;Pete Harrison presents an analysis of driving a stepper and gives a table based approach for the timer at:&#60;br /&#62;
&#60;a href=&#34;http://www.micromouseonline.com/micromouse-book/motors/stepper-driving/#axzz1ttvr0Hud&#34; rel=&#34;nofollow&#34;&#62;http://www.micromouseonline.com/micromouse-book/motors/stepper-driving/#axzz1ttvr0Hud&#60;/a&#62;&#60;br /&#62;
He gives a spreadsheet to calculate all of the timer delay values, and an example set of values.  He also outlines the code.&#60;/p&#62;
&#60;p&#62;Two problems:&#60;br /&#62;
a) losing an interrupt, or have it delayed, because of a higher-priority interrupt, and&#60;br /&#62;
b) the timer peripheral buffers some register values (including the overflow register), so you might not get the overflow register updated when expected, but at the next update event. Worth reading the manual carefully to see how the update event works. It might be convenient to use the buffering so that the new overflow value is ready when the update event triggers, and hence avoids any jitter from the ISS. Just a thought.&#60;/p&#62;
&#60;p&#62;Edit:&#60;br /&#62;
If the table is in memory, you might be able to arrange for the timer interrupt to trigger DMA to load the next timer overflow value. That would reduce the CPU overhead, and should remove any possible jitter from an ISR. It is likely harder to get the code correct!&#60;/p&#62;
&#60;p&#62;I'd start with a much more coarse microstep. i.e. 1/8th, to get the system working and make it easier to debug.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ZotDitzMyo on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10480</link>
			<pubDate>Fri, 04 May 2012 05:31:40 +0000</pubDate>
			<dc:creator>ZotDitzMyo</dc:creator>
			<guid isPermaLink="false">10480@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;gbulmer: The drive we am using is this one: &#60;a&#62;http://www.imshome.com/products/im481h.html&#60;/a&#62; datasheet:&#60;a&#62;http://www.imshome.com/downloads/manuals/IM481H_Plus.pdf&#60;/a&#62; And we use the 1/250the microstepping mode. Sorry for misplacing tha 1/X earlier :-)&#60;/p&#62;
&#60;p&#62;We are using some 1.8deg steppers (ie:200steps/rev) so that gives us 50000 microsteps/rev. For the axis I am working with, for every move command of 1, the controller sends out 90909 pulses to the drive. Since it's moving a lens in a camera tube that 1 doesn't relate to any unit I know of (mm, inches etc...)&#60;/p&#62;
&#60;p&#62;At 5000 microsteps /rev and at 90Khz that gives us a bit less than 2 revolutions/s which I can roughly confirm by looking at it.&#60;/p&#62;
&#60;p&#62;I'm not at all familiar with the current side of things, but it is powered from a 24V/5A supply that has plenty of room left. Per phase the drive specs list 0.14 to 2.1 Amps Peak and 1.5 Amps RMS.&#60;/p&#62;
&#60;p&#62;From the formulaes in the eetimes article, I get a c0 of 151028 whith a prescaler of 1. (Yes, I know it's more that 65535, working on that!) So that gives a first pulse length of 2ms, next one is 90616, then 70479 and so on until we reach 791 (11us)in 3123 increments from standstill.&#60;br /&#62;
Now, To do that I have an ISR on the timer set at co(151028) and in the ISR I change the overflow value for the next one and resume the timer. Is this safe? I saw in timer.h a reference to TIMER_ONE_PULSE which would be ideal (methinks) but is commented out...&#60;/p&#62;
&#60;p&#62;How are you guys generating acceleration ramps?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10474</link>
			<pubDate>Thu, 03 May 2012 20:15:49 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10474@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ZotDitzMyo it sounds like you have access to some impressive equipment.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;I'm using a Stepper driver that can generate 250 microsteps.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;I don't understand that. Typically the stuff I understand supports 1/4, 1/8th or maybe 1/16 microstepping. AFAIIK torque is reduced by microstepping, so I don't understand what &#34;250 microsteps&#34; might mean.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;I took some measurements and at full speed, the pulses are 11us long (90909Hz)
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Is that the microstep pulse length, or the pulses into the stepper driver? The type of motors I understand are typically 200steps/rev, so a step about 11us would be about 2.2ms/rev, or about 450 revs/second which is amazingly fast. I think 50 revs/second is pretty quick. &#60;/p&#62;
&#60;p&#62;These 200step/rev NEMA motors typically have inductance of several milliHenry, so driving enough current in to reach close to full torque in 11useconds is a bit mind boggling.&#60;/p&#62;
&#60;p&#62;I assume it is very low-mass? To get from standstill to 11us/step in 0.2 seconds is also very impressive.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10472</link>
			<pubDate>Thu, 03 May 2012 15:19:55 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">10472@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@ZotDitzMyo, I have plans for using approach described in the article in some my projects, but haven't done anything real yet, so I'm quite interested in your progress :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ZotDitzMyo on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10470</link>
			<pubDate>Thu, 03 May 2012 10:21:52 +0000</pubDate>
			<dc:creator>ZotDitzMyo</dc:creator>
			<guid isPermaLink="false">10470@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;gbulmer: I'm using a Stepper driver that can generate 250 microsteps. Since i&#38;lt;m replicating parts of an existing system, I took some measurements and at full speed, the pulses are 11us long (90909Hz). The acceleration is 454545 steps/s^2. So some calculations give me an acceleration time of 200ms from standstill to max speed. The system is strictly open-loop, with limit switches at the ends.&#60;/p&#62;
&#60;p&#62;siy: Funny you should mention that article, I found it yesterday morning and I'm presently trying to implement it. Luckily I could get some help on the math part (not my forte!). If I unserstood it properly, I only need one timer, calculate the initial OutputCompare value from the slope, install an ISR and iterate from there right? :-)&#60;/p&#62;
&#60;p&#62;other interresting artcles I found are: &#60;a&#62;http://www.ti.com/lit/an/slva488/slva488.pdf&#60;/a&#62;&#60;br /&#62;
&#60;a&#62;http://fab.cba.mit.edu/classes/MIT/961.09/projects/i0/doc8017.pdf&#60;/a&#62;&#60;br /&#62;
&#60;a&#62;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00207733.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'm quite new to all this micro controller business and like most people started with the sugar-coated Arduino but ran out of steam on this project. I started out naively thinking that it would be a piece of cake to just send pulses to an already made driver! I'm not even dealing with the limit switches yet!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10463</link>
			<pubDate>Thu, 03 May 2012 02:38:42 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">10463@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@ZotDitzMyo, are you trying to implement algorithm described here: &#60;a href=&#34;http://www.eetimes.com/design/embedded/4006438/Generate-stepper-motor-speed-profiles-in-real-time&#34; rel=&#34;nofollow&#34;&#62;http://www.eetimes.com/design/embedded/4006438/Generate-stepper-motor-speed-profiles-in-real-time&#60;/a&#62; ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10457</link>
			<pubDate>Wed, 02 May 2012 14:06:45 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10457@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ZotDitzMyo - would you give a bit more detail please?&#60;/p&#62;
&#60;p&#62;How fast (how many steps per second) will the motor be driven?&#60;br /&#62;
How fast will it be accelerated?&#60;/p&#62;
&#60;p&#62;Is there an external stepper driver?&#60;br /&#62;
Is there any feedback, e.g. current measurement, from the motor?&#60;br /&#62;
Will it use 'microstepping'?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ZotDitzMyo on "High Level approach to Stepper Acceleration curve"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1632#post-10446</link>
			<pubDate>Tue, 01 May 2012 14:59:27 +0000</pubDate>
			<dc:creator>ZotDitzMyo</dc:creator>
			<guid isPermaLink="false">10446@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;   I'm currently trying to drive a stepper controller at 90KHz. I also need to ramp-up and down the speed. I tried earlier with an Arduino but was VERY limited in terms of speed. With the maple I can just use timer interrupts to generate the signal.&#60;br /&#62;
    What I'd like is to get some validation of my approach before investing  too much time in it. I currently set up two timers, one which generates the ticks for stepping, another at a fixed frequency that adjusts the frequency of the first one:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
HardwareTimer timer(1);&#60;br /&#62;
HardwareTimer ramp(2);&#60;/p&#62;
&#60;p&#62;  timer.pause();&#60;br /&#62;
  timer.setPrescaleFactor( 1 ); //72MHz&#60;br /&#62;
  timer.setOverflow( 791 ); //90.907 KHz&#60;br /&#62;
  timer.setChannel1Mode( TIMER_OUTPUT_COMPARE );&#60;br /&#62;
  timer.setCompare( TIMER_CH1, 1 );&#60;br /&#62;
  timer.attachCompare1Interrupt( handler );&#60;br /&#62;
  timer.refresh();&#60;br /&#62;
  timer.resume();&#60;/p&#62;
&#60;p&#62;  ramp.pause();&#60;br /&#62;
  ramp.setPeriod( 1000 ); //1ms&#60;br /&#62;
  ramp.setChannel1Mode( TIMER_OUTPUT_COMPARE );&#60;br /&#62;
  ramp.setCompare( TIMER_CH1, 1 );&#60;br /&#62;
  ramp.attachCompare1Interrupt( ramp_handler );&#60;br /&#62;
  ramp.refresh();&#60;br /&#62;
  ramp.resume();&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Now in handler() I just generate a pulse on the step pin and increment a global step counter so I can know when to stop, and in ramp_handler() I change timer.setOverflow() from 65535 to 791 to accelerate, and the inverse to decelerate.&#60;/p&#62;
&#60;p&#62;Does that approach make any sense? Is there a better way of doing this?&#60;/p&#62;
&#60;p&#62;Thank you!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
