Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

code wheel encoding using Kalman filter

Status
Not open for further replies.

ArixII

Computer
Jan 9, 2009
4
Hi,
After reading books in Kalman filtering (KF) and Control theory, I am going to do my first simulation and real experiment combined.

I chose components for a very simple system: one motor assembled to a code wheel, a sensor to read the code, a micro controller and a KF. The picture and information of physical devices and assembling I put here:

Description: the sensor is faced to the code wheel, sending a light beam to it and reading the reflection. The motor is rotating the wheel, and is under the micro controller, which is connected to the PC.

Can you please help me in these very beginning steps? I want to start simulation in Simulink, but I'm not sure how to set up the components and their relations. Please give some ideas for the plant and sensor model.

Best Regards,
Arash.
 
Replies continue below

Recommended for you

I'm afraid you are rather lost here.

The "code wheel" (I assume that you mean an incremental encoder) decoding is not at all being done in a KF.

The KF is for stabilizing the speed control loop mostly.

Your text-book says all you need to know about it. Did you not attend class?

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
Well, Skogsgurra, I'm afraid you are not right here. KF can be applied anywhere a need to reduce the observer noise exist.

Next, please consider that this application of the KF was the subject of June, 11-13, 2008 American Control Conference.

Next, please look here to understand what the concept is, before giving simple guesses (specially about the writer):

What I can learn from your post, is about your personality, but this is not what people seek, when they post to forums. Please pay attention.

Thank you anyway for typing text.
Arash.
 
What I can learn from your post, is about your personality, but this is not what people seek, when they post to forums. Please pay attention.
Welcome to the real world.
You have just disrespected one of the best resources you will probably meet in your career.
From the great height of your ego you have dismissed an engineer who is consistently rated in the top ten by about 750,000 other engineers.
Who am I to suggest that your description of your placement of detectors for quadrature further suggests your lack of attention in class. You don't understand the use or purpose of quadrature encoding.
You have just shut the door on more assistance and knowledge than you can realize.
What I can learn from your post, is about your personality, but this is not what people seek, when they post to forums. Please pay attention.

Bill
--------------------
"Why not the best?"
Jimmy Carter
 
:)
good bye from enlightenment world!

1. Your info is not new to me, I read his profile before answering.
2. Who the writer is not important in "FORUM".
3. His information about KF really is NOT up to date.
4. You are not the only forum in the world, I already registered to another one.
5. >your lack of attention in class...
another guess, consider please that it is only your "guess".
6. Be sure that your Skogsgurra will not guess for anyone again. I tried to help him.
7. The leader is one who cares more.

being a human is more important than being a good Eng.

bye, I continue in better forums (yours is "ONE of best!"...
 
Yes. I was obviously mistaken. Or, at least, you could argue that I was mistaken.

That would not have happened if you hadn't said that you were going to ENCODE the "code wheel" in a Kalman Filter, which I suppose you are not going do do.

Instead, you are going to minimise noise in the signal coming from your system. And that is a perfectly legitimate use for a KF - or most other filters.

The decoding itself can then be done in the microprocessor (you are invited to use a method I developed back in the eighties and that actually won a design contest arranged by Harris Semiconductor). It has later been picked up by MIT and they now claim to have some sort of copyright for the method. But you are welcome to use it if you write me).

We have a constant problem in these fora in that budding engineers (or students) want us to do their job. The confusion between filtering and decoding indicated that you were one of those.

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
When I read this

"As you learned from Alex Brown's tutorial, you can implement a quadrature encoder using a single track wheel, with the two photosensors offsent by 1/2 of the wheel's cell width."

above a drawing of a 2 track wheel with the dotted circles representing the photo transistors offset I was misled into thinking that the two were related.
As I understand your project, there is a gray area when the code changes from light to dark and vice versa. This is usually insignificant but not always. There are techniques for improving the resolution but in extreme cases they may be at the limit of the technology and you still need better resolution. Hence the filter.
It may be desirable to deliberately degrade your initial signal so as to better observe the effect of the filter.
May I suggest a very coarse code wheel. Maybe 8 or 16 segments. Use a very wide beam, and turn your wheel slowly.
This should give you a relatively large transition angle and easily observable gradient from off to on.
run the signal through a filter and use a dual trace scope to compare the wave form of the raw signal and the signal out of the filter. This should be easy to set up and monitor. Once the basic setup is working, start ramping up the speed and switching the detector to tracks with more segments.
If you are interested in observing the operation of the filter rather than the maximum speed you can achieve, intentionally generating a "noisy" signal can have some advantages. You may also consider using a high count code track with fine pin holes to generate marker pulses to further evaluate the performance of the filter.
I understand that the filter is predictive.
Question;
If a simple version of the filer is applied to an application such as a positioning servo, where not only are the speed and acceleration changing, but the direction and the rate of acceleration may also be changing, is it possible that the filter may actually introduce errors during changes in rates of acceleration?
I would be generating the fastest signal that I could get cleanly and using that to supply index marks to an intentionally noisy signal. For the sake of experimentation, I would consider a code wheel very large in diameter. A 12" or 16" diameter wheel should be able to supply accurate index marks for a 3" code track under test.
Good luck.


Bill
--------------------
"Why not the best?"
Jimmy Carter
 
The Kalman filter is only good for estimating ( filtering ) the state.

If a simple version of the filer is applied to an application such as a positioning servo, where not only are the speed and acceleration changing, but the direction and the rate of acceleration may also be changing, is it possible that the filter may actually introduce errors during changes in rates of acceleration?
Yes, unless the control output from the PID is used to help in estimating the state. To use the control output there must be a model of the system. This requires system identification.

The easy thing to do is to get a very high resolution encoder. I recommend 10000 lines but sometimes 100,000+ lines is required when moving slowly.

The simplest form of Kalman filter is the ??? filter. The ??? filter is a steady state Kalman filter that predicts the next state using only the current state, not the control signal. The ??? filter gearing to a production line application like a flying shear.

The problem with a full blown Kalman filter is that
1. Must have a model.
2. Must have a good estimate of system and measurement variance. These are often hard to get.
3. Updating the Kalman gains requires too much processing power.

Another good compromise is to use an observer. The improvement/effort is very high. Observers still require a model.




 
The problem with asking an engineer a question is you only get an answer for that question. I thought Gunnar was spot on in giving you an answer to your broad question.

My take on asking an engineer a question is you have to ask the right question to get the right answer. Nothing really personal or human about that, it is what it is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor