If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Rotary Encoder (Not)
12 posts
• Page 1 of 2 • 1, 2
Rotary Encoder (Not)
Yesterday I was looking at an old Arduino project, where I'd used a rotary encoder as input. I could well be mistaken but I don't think I've ever seen such a thing referred to in Flowstone?
And indeed why would you! (ALERT! - this project should be filed under 'Largely Pointless'). (But mostly harmless too ). Well, it's Jan 1st innit !
It's the 'incremental' type of rotary encoder which, if you've never played with these things, is the type that has 2 switches inside, which open & close phased 90deg from each other, from which in software you can determine the direction of travel.
So this morning, with nothing better to do, I set about simulating this in Ruby. I realised that there was little point in actually having a circular knob, since mouse control is going to be linear anyway. Click & drag. Here y'go ...
Obviously there are many other ways of achieving this, it's ultimately just a slider control, without any slider graphics! But the 2-bit thing is quite fun. I put the LEDs on so that you can see the switch action.
I'll get my coat ... 2021 can only get better!
H
And indeed why would you! (ALERT! - this project should be filed under 'Largely Pointless'). (But mostly harmless too ). Well, it's Jan 1st innit !
It's the 'incremental' type of rotary encoder which, if you've never played with these things, is the type that has 2 switches inside, which open & close phased 90deg from each other, from which in software you can determine the direction of travel.
So this morning, with nothing better to do, I set about simulating this in Ruby. I realised that there was little point in actually having a circular knob, since mouse control is going to be linear anyway. Click & drag. Here y'go ...
Obviously there are many other ways of achieving this, it's ultimately just a slider control, without any slider graphics! But the 2-bit thing is quite fun. I put the LEDs on so that you can see the switch action.
I'll get my coat ... 2021 can only get better!
H
-
HughBanton - Posts: 265
- Joined: Sat Apr 12, 2008 3:10 pm
- Location: Evesham, Worcestershire
Re: Rotary Encoder (Not)
Yeah ... but it is pretty cool
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: Rotary Encoder (Not)
Using FlowStone links to draw the quadrature timing diagram is the icing on the cake!
Bizarrely enough, I was paid to (kind of)!
Seriously: In my last job, I worked on the graphical interface for a microcontroller programming application (the name of which caused me endless confusion!) The program allows you to simulate the microcontroller code on a PC, complete with a virtual 3D model of the hardware you'll be connecting to its pins. It was part of my job to design the built-in modelled components - switches, buttons, motors, servos, LED displays, and... rotary encoders (complete with virtual quadrature outputs like yours for connection to virtual microcontroller inputs). Like a lot of that work, the algorithm behind it may well have been prototyped using my favourite interactive speed-coding system... FlowStone.
Au contraire...
(...though the "little point" part may still apply - I'm not sure that anyone, myself included, has ever used this ancient cryptic [and buggy] device for anything useful! )
HughBanton wrote:And indeed why would you!
Bizarrely enough, I was paid to (kind of)!
Seriously: In my last job, I worked on the graphical interface for a microcontroller programming application (the name of which caused me endless confusion!) The program allows you to simulate the microcontroller code on a PC, complete with a virtual 3D model of the hardware you'll be connecting to its pins. It was part of my job to design the built-in modelled components - switches, buttons, motors, servos, LED displays, and... rotary encoders (complete with virtual quadrature outputs like yours for connection to virtual microcontroller inputs). Like a lot of that work, the algorithm behind it may well have been prototyped using my favourite interactive speed-coding system... FlowStone.
HughBanton wrote:...little point in actually having a circular knob, since mouse control is going to be linear anyway. Click & drag.
Au contraire...
(...though the "little point" part may still apply - I'm not sure that anyone, myself included, has ever used this ancient cryptic [and buggy] device for anything useful! )
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Rotary Encoder (Not)
HughBanton wrote:I realised that there was little point in actually having a circular knob, since mouse control is going to be linear anyway.
Then again, a mouse is just a 2D rotary encoder.
I keep a pair of oven mitts next to my computer so I don't get a concussion from slapping my forehead while I'm reading the responses to my questions.
- deraudrl
- Posts: 239
- Joined: Thu Nov 28, 2019 9:12 pm
- Location: SoCal
Re: Rotary Encoder (Not)
Great fun guys!
Dare I suggest that the next step could be to make the sensitivity to the mouse dynamic?
Move it fast and the value changes faster, slow and you get finer control. Not really suitable for trog’s excellent endeavour though, but possibly nicer than shift-drag for finer control. Maybe…
Dare I suggest that the next step could be to make the sensitivity to the mouse dynamic?
Move it fast and the value changes faster, slow and you get finer control. Not really suitable for trog’s excellent endeavour though, but possibly nicer than shift-drag for finer control. Maybe…
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Rotary Encoder (Not)
Happy new year guys.
Here's one that I made a few years ago when I first started learning Ruby. If i were to redo this it would probably be totally different now . . but it works.
Credit has to go to Tulamide for his 'Circular mouse Check' tutorial which was the inspiration for this . . Thanks T.
Here's one that I made a few years ago when I first started learning Ruby. If i were to redo this it would probably be totally different now . . but it works.
Credit has to go to Tulamide for his 'Circular mouse Check' tutorial which was the inspiration for this . . Thanks T.
-
DaveyBoy - Posts: 131
- Joined: Wed May 11, 2016 9:18 pm
- Location: Leeds UK
Re: Rotary Encoder (Not)
DaveyBoy wrote:...but it works.
Much more reliably than my clunky old thing - nice! Definitely one of those cases where the Ruby makes it easier to fathom what's going on, I think - I gave up trying to reverse-engineer wherever the hell mine was flipping out!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Rotary Encoder (Not)
DaveyBoy wrote:Credit has to go to Tulamide for his 'Circular mouse Check' tutorial which was the inspiration for this . . Thanks T.
You're welcome! I'm more than happy to see, that some of my examples really do inspire! Just for the record, here's the example: http://www.dsprobotics.com/support/viewtopic.php?f=3&t=3837
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Rotary Encoder (Not)
trogluddite wrote:Using FlowStone links to draw the quadrature timing diagram is the icing on the cake!
Next time I'll put candles on it
Anyway that's given me a great idea for April 1st. But shhh, whatever you do don't tell anyone ...
H
-
HughBanton - Posts: 265
- Joined: Sat Apr 12, 2008 3:10 pm
- Location: Evesham, Worcestershire
Re: Rotary Encoder (Not)
Spogg wrote:Great fun guys!
Dare I suggest that the next step could be to make the sensitivity to the mouse dynamic?
Move it fast and the value changes faster, slow and you get finer control. Not really suitable for trog’s excellent endeavour though, but possibly nicer than shift-drag for finer control. Maybe…
Yes, interesting idea. It needs to be born in mind that the '2-bit' rotary-encoder emulation I did here is essentially 'fake code' (is that a thing??) in that I've converted a regular counter into rotary-encoder-binary, and then converted that back again into a regular counter. See attached - the fake (blue) button & the regular (green) button methods, both do the same. I always said it was pointless!
However I've made a couple of modifications to both, one makes them automatically more sensitive when the mouse is closest to the center. A sort-of improvement, but Spogg's velocity plan would be better . Might yield a useful incremental tool.
H
-
HughBanton - Posts: 265
- Joined: Sat Apr 12, 2008 3:10 pm
- Location: Evesham, Worcestershire
12 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: Google [Bot] and 62 guests