<?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: Encoder Selection to SPI or not to...</title>
		<link>http://forums.leaflabs.com/topic.php?id=814</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:09:50 +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=814" rel="self" type="application/rss+xml" />

		<item>
			<title>josiah47 on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-5208</link>
			<pubDate>Tue, 14 Jun 2011 13:33:04 +0000</pubDate>
			<dc:creator>josiah47</dc:creator>
			<guid isPermaLink="false">5208@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Okay finally got my Maple in, also my encoder and the cable to go with it, well... the line driver cable, apparently it does something to the output signal? does anyone know if I should remove the line driver or keep it, apparently it helps remove noise, but is it then possible to hook directly up to the Maple or not? Any direction would be appreciated.&#60;/p&#62;
&#60;p&#62;trevden: im guessing your code isn't using the built in quadrature decoders? you have any more info on using these including code?&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>trevden on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-5050</link>
			<pubDate>Wed, 08 Jun 2011 02:37:02 +0000</pubDate>
			<dc:creator>trevden</dc:creator>
			<guid isPermaLink="false">5050@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I've used one of these on the Maple, it works great with the 5V tolerant pins and a 5V supply, connected up directly.&#60;/p&#62;
&#60;p&#62;I didn't know at the time that the STM32 has native quadrature decoders -- that is clearly the correct solution -- but here's the interrupt-driven code I was playing with:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/trevyn/opencvtest4/blob/master/mapleocvt4/mapleocvt4.pde&#34; rel=&#34;nofollow&#34;&#62;https://github.com/trevyn/opencvtest4/blob/master/mapleocvt4/mapleocvt4.pde&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It mostly works, though I suspect it has a small amount of drift due to missed steps.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josiah47 on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-5048</link>
			<pubDate>Tue, 07 Jun 2011 18:08:56 +0000</pubDate>
			<dc:creator>josiah47</dc:creator>
			<guid isPermaLink="false">5048@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I haven't heard back from CUI yet but I look at the training module again and it looks to be like a 5V TTL signal, if its okay to interpret it like that since they show 0V to 5V still need a better answer.&#60;br /&#62;
I guess ing using D6,7,8 would be capable of taking the 5V anyway but is this recommended or should I use other pins? or step it down first?&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://dkc1.digikey.com/us/en/tod/CUI/AMTEncoders_NoAudio/AMTEncoders_NoAudio.html&#34; rel=&#34;nofollow&#34;&#62;http://dkc1.digikey.com/us/en/tod/CUI/AMTEncoders_NoAudio/AMTEncoders_NoAudio.html&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josiah47 on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4987</link>
			<pubDate>Mon, 06 Jun 2011 06:57:37 +0000</pubDate>
			<dc:creator>josiah47</dc:creator>
			<guid isPermaLink="false">4987@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Here is the datasheet for the cable it give you the Pin outs&#60;br /&#62;
&#60;a href=&#34;http://products.cui.com/getPDF.aspx?fileID=3753&#34; rel=&#34;nofollow&#34;&#62;http://products.cui.com/getPDF.aspx?fileID=3753&#60;/a&#62;&#60;br /&#62;
I am emailing them for more info on the output
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4976</link>
			<pubDate>Sat, 04 Jun 2011 19:46:08 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">4976@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;josiah47,&#60;/p&#62;
&#60;p&#62;It looks like drinkdhmo worked out the timer register settings for a 4x quadrature decode.&#60;/p&#62;
&#60;p&#62;I would double check that timer4 is 5V tolerant on the Maple.&#60;/p&#62;
&#60;p&#62;Hook up just the encoder to a 5V supply and check that the A and B channels are giving a square wave output when the encoder is rotated with an oscope.&#60;/p&#62;
&#60;p&#62;It won't matter if the A and B channels are reversed during initial setup. The counter just counts down instead of up.&#60;/p&#62;
&#60;p&#62;A quick and dirty program to set up a timer like drinkdhmo did.  (Using the new timer naming convention if needed ?) drinkdhmo called out the pin numbers for timer4, so I would use that one. (5V tolerant on Maple?)&#60;/p&#62;
&#60;p&#62;A serial print every 50mS of the value of 'cnt', should print the value of the encoder automatically when the encoder is rotated if the hardware quadrature capture/decoding is working OK.&#60;/p&#62;
&#60;p&#62;Edit additions: Consider powering the encoder from a separate external 5V supply. Tie the encoder and Maple GND's together of course.&#60;br /&#62;
If 'CNT' isn't already declared in the timer code somewhere, use a large signed integer. You may not have to worry about counter rollover depending on how long it takes to balance the tool.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4975</link>
			<pubDate>Sat, 04 Jun 2011 19:36:27 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4975@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;josiah47 - That looks like a very nifty solution.&#60;/p&#62;
&#60;p&#62;What level of feedback do you want on connecting it to Maple?&#60;/p&#62;
&#60;p&#62;Is there another datasheet? &#60;/p&#62;
&#60;p&#62;I found  plenty of mechanical data, but I all I could see about the electronics is:&#60;br /&#62;
output phase difference: 90° (A ch leads B ch in CW direction viewed from front)&#60;br /&#62;
output current: 5 mA max.&#60;br /&#62;
output waveform: TTL voltage square wave&#60;br /&#62;
output signals:  A, B, Z1 phase (A, B, C line driver available with CUI-10XE-10)&#60;br /&#62;
current consumption: 6 mA typ., 10 mA max.&#60;br /&#62;
supply voltage: 3.6 ~ 5.5 V dc&#60;/p&#62;
&#60;p&#62;and a &#34;Pin-Out&#34; with the key of the signals available on the connector. Is there some marking on the device to get an unambiguous pin mapping? &#60;/p&#62;
&#60;p&#62;That datasheet is a bit sparse. For example, I'd like to see clear diagram about the timing of the index signal wrt. the quadrature signals.&#60;/p&#62;
&#60;p&#62;I assume it means TTL level square wave will be at least 2.0V for high e.g. &#60;a href=&#34;http://www.interfacebus.com/voltage_threshold.html&#34; rel=&#34;nofollow&#34;&#62;http://www.interfacebus.com/voltage_threshold.html&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Have you got access to an oscilloscope? A TTL square wave should be okay to feed into a Maple, but I'd check it before I'd connect it. With a bit more detail on the electrical signals, I'd feel happier.&#60;/p&#62;
&#60;p&#62;I'd be tempted to isolate it from a microcontroller using something like an optical isolator/optical coupler, e.g.&#60;br /&#62;
&#60;a href=&#34;http://uk.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&#38;amp;binCount=973&#38;amp;Ne=4294957561&#38;amp;N=4294767559+4294571109&#34; rel=&#34;nofollow&#34;&#62;http://uk.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&#38;amp;binCount=973&#38;amp;Ne=4294957561&#38;amp;N=4294767559+4294571109&#60;/a&#62;&#60;br /&#62;
It sounds from your application like it will be in an industrial setting, so isolation seems like a good idea anyway.&#60;/p&#62;
&#60;p&#62;I'd put a resistor (say 1K) into each signal line to reduce the chances of damaging anything by shorting connections (I can be clumsy some days :-)&#60;/p&#62;
&#60;p&#62;Once you have 'friendly' signals, at a voltage level that can't harm a microcontroller, then you could feed them into a few pins.&#60;/p&#62;
&#60;p&#62;You could be feed the two quadrature signals into input capture inputs of a timer. Use the timer to track the quadrature signal. The index could feed into another timer, or just use it as an interrupt.&#60;/p&#62;
&#60;p&#62;For initial experiments, you could just use a loop which does digitalRead to check each pin state and micros() to time it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josiah47 on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4974</link>
			<pubDate>Sat, 04 Jun 2011 17:51:17 +0000</pubDate>
			<dc:creator>josiah47</dc:creator>
			<guid isPermaLink="false">4974@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I think I have found the encoder I would like to use, but would like some feedback on connecting it to the Maple&#60;br /&#62;
&#60;a href=&#34;http://www.amtencoder.com/LinkClick.aspx?fileticket=Jat4EDtyVjw%3d&#38;amp;tabid=215&#34; rel=&#34;nofollow&#34;&#62;http://www.amtencoder.com/LinkClick.aspx?fileticket=Jat4EDtyVjw%3d&#38;amp;tabid=215&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Anyone care to help?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4933</link>
			<pubDate>Thu, 02 Jun 2011 06:09:56 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4933@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;These may be too delicate for your purposes, but very popular encoders in the micromouse community are from Austria Microsystems:&#60;br /&#62;
&#60;a href=&#34;http://www.austriamicrosystems.com/eng/Products/Magnetic-Encoders/Rotary-Encoders&#34; rel=&#34;nofollow&#34;&#62;http://www.austriamicrosystems.com/eng/Products/Magnetic-Encoders/Rotary-Encoders&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;They have some with 12 bit resolution and speeds upto 30,000rpm.&#60;/p&#62;
&#60;p&#62;Each of the STM32F general (TIM2, TIM3 or TIM4) or advanced (TIM1) timers can implement a quadrature decoder in hardware, so it could interface more directly to the data stream, rather than via SPI. (Edit: The RET6 part has two more quadrature capable timers.)&#60;/p&#62;
&#60;p&#62;A few of the Austria Microsystems parts expose the underlying sine/cosine analogue signals directly, so in theory you could run a digital to analogue conversion directly using a Maple.&#60;/p&#62;
&#60;p&#62;I'd be concerned that an industrial environment (which I infer from &#34;tool balancing machine&#34;) might be too electrically, and magnetically, noisy to get 12-bit resolution. Also, vibration on the driving shaft may cause too much distortion on the signal to be able to compensate.&#60;/p&#62;
&#60;p&#62;Can you either use a gearbox to drive the tool, or a gearbox to drive the sensing mechanism? Assuming you want better than 5*360 degree resolution, i.e. 1800 position/revolution, direct sensing is a challenge, but by running the sensor at a much higher speed through a gearbox, that sort of resolution might become easier. &#60;/p&#62;
&#60;p&#62;Tim Foden's micromouse uses a simple printed sensor (about a dozen black/white segments) attached directly to the wheel, and uses analogue sensing.&#60;br /&#62;
&#60;a href=&#34;http://www.micromouseonline.com/blog/2010/12/05/robotic-2010&#34; rel=&#34;nofollow&#34;&#62;http://www.micromouseonline.com/blog/2010/12/05/robotic-2010&#60;/a&#62;&#60;br /&#62;
I believe it gets a resolution around a couple of degrees. A &#38;gt; 10x gearbox might get close to &#38;gt; 1800 steps/revolution resolution. A problem with optical approaches is ambient light pollution, but using infrared and some container or shield might be enough.&#60;/p&#62;
&#60;p&#62;If you have facilities to rigidly mount multiple optical sensors, resolution can be increased by using more sensors.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4885</link>
			<pubDate>Mon, 30 May 2011 12:32:27 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">4885@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Assuming that you choose this absolute encoder, I read the max position update capability as 20,833Hz disregarding any SPI communications overhead on the MCU side. A 1250rpm shaft rotation speed is 20.83 rev/sec or 7500 deg/sec. The max position update of the absolute encoder would be 2.78 samples per degree, below your 5 samples per degree requirement.&#60;/p&#62;
&#60;p&#62;I don't know what encoder you will ultimately choose, but based on your samples per degree requirements it doesn't look like the absolute position one will meet your needs.&#60;/p&#62;
&#60;p&#62;If the machine holds a well regulated speed when in operation, it may be simpler to pick off an interrupt once per shaft rotation and drop into the time domain inside the MCU for working your samples per degree.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josiah47 on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4884</link>
			<pubDate>Mon, 30 May 2011 11:20:03 +0000</pubDate>
			<dc:creator>josiah47</dc:creator>
			<guid isPermaLink="false">4884@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;the system is only going to be running max 1250rpm, This is for a tool balancing machine that will just match up vibration data to the current degree, take about 5 samples for each degree average and return to PC,
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josiah47 on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4883</link>
			<pubDate>Mon, 30 May 2011 11:04:33 +0000</pubDate>
			<dc:creator>josiah47</dc:creator>
			<guid isPermaLink="false">4883@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I just need an encoder that will be easy to interface with and be able to keep track of at least 360 degrees and an index, any suggestions?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4882</link>
			<pubDate>Mon, 30 May 2011 09:58:38 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">4882@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi josiah47,&#60;/p&#62;
&#60;p&#62;Interesting encoders. The first I have seen of capacitive type.&#60;br /&#62;
I don't know the details of your application, so I can only generalize.&#60;/p&#62;
&#60;p&#62;If you are using these as a feedback device for a high speed servo motor, the inherent delays in these encoders would preclude their use in that application for me.&#60;/p&#62;
&#60;p&#62;If they are being used as feedback for say, a rotation counter of a manual or slow open loop motor driven system, they could be worth consideration.&#60;/p&#62;
&#60;p&#62;Of course, the absolute positioning is only for one rotation of the encoder. You will still have to handle rollover and derive encoder (shaft) rotation speed in your code. The delay inherent in the SPI absolute position communications deserve a good analysis, so it does not turn into a 'gotcha' further into the project.&#60;/p&#62;
&#60;p&#62;Isn't there a channel or two of quadrature decoding available on the STM32's?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josiah47 on "Encoder Selection to SPI or not to..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=814#post-4880</link>
			<pubDate>Mon, 30 May 2011 07:35:55 +0000</pubDate>
			<dc:creator>josiah47</dc:creator>
			<guid isPermaLink="false">4880@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Good morning everyone,&#60;/p&#62;
&#60;p&#62;Wondering what would be a better choice this one&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://products.cui.com/adtemplate.asp?invky=475963&#38;amp;brand=motion-control&#38;amp;catky=112362&#38;amp;subcatky1=994183&#38;amp;subcatky2=957942&#38;amp;subcatky3=&#34; rel=&#34;nofollow&#34;&#62;http://products.cui.com/adtemplate.asp?invky=475963&#38;amp;brand=motion-control&#38;amp;catky=112362&#38;amp;subcatky1=994183&#38;amp;subcatky2=957942&#38;amp;subcatky3=&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;or this one&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://products.cui.com/adtemplate.asp?invky=333508&#38;amp;brand=motion-control&#38;amp;catky=112362&#38;amp;subcatky1=994182&#38;amp;subcatky2=997829&#38;amp;subcatky3=&#34; rel=&#34;nofollow&#34;&#62;http://products.cui.com/adtemplate.asp?invky=333508&#38;amp;brand=motion-control&#38;amp;catky=112362&#38;amp;subcatky1=994182&#38;amp;subcatky2=997829&#38;amp;subcatky3=&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I am guessing anyone would choose the first one since its Absolute, and it can talk over SPI where as the second is incremental so I would need to do the quadrature processing myself on the Maple, correct or am I wrong here? either way I would like some feedback on what you guys recommend and what one would be easier to code for. Any one currently using any SPI encoder feedback on the Maples?&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
