Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Rottary encoder and STM32 - multi speed

Status
Not open for further replies.

Jadeit

Member level 5
Joined
Feb 10, 2017
Messages
84
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,191
I have a variable <0-10.000>
I want to use a rotary encoder 30 pulse per revolution to set it up.
Given the range of the variable, I want the variable to be a variable at least three different steps depending on the speed.
For example for low speed 1 , for midle speed 5 and high speed 50.
I think this is a classic requirement that many people have addressed in advance.

Give you an example, a library that can do it?
If not At least at what speeds of rotation to change ranges so that such a change would be fiziologically natural for him who is spinning?
With STM 32, the timer can be set to Encoder mode, but I have to solve the rotational speed measurements.
The first option is to use a second counter to measure the rotation speed. for exampe as

slave counter

Does it seem a bit like a waste of hw resources, some other smart idea?
 

In general Encoders are not read in polling strategy, it is used I/O interrupts, and depending of the rate it is needed a dedicated hardware for that, appart from the microcontroller, otherwise it will lock other tasks. Anyway, the question as posed is a bit unclear, essencially you should provide the following information:
  • Encoder type, incremental or absolute?
  • Encoder resolution in pulses.
  • Maximum rotation speed of device to be measured
  • Is there motor reduction?
 

Encoder is incremental with 30 or 60 pulse per revolution.
It is actually a "potentiometer" with knob for setting the time 0- 10.000 ms
yes, the knob rotates the operator, when it needs to set the duration of an operation.
 

I'm not sure if it is a good idea to measure rotation speed from knob; handling may vary a lot from one person to another, so the criteria you defined above may not work. Long time ago I did the ISR handler for a Knob pot used as the browser of a wide screen menu, very simple. As you know, there is a well defined pattern when it turns in CW or CCW direction, and with switch...case statements you can do it, either incrementing or decrementing a counter as long the next patern is one of another; in the case of a patterns not belonging to the current state, simply ignore it and restart the machine state.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top