Example usage of lejos.utility.KalmanFilter?

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

salamanders
New User
Posts: 5
Joined: Sun Jul 16, 2017 5:10 pm

Example usage of lejos.utility.KalmanFilter?

Postby salamanders » Mon Jul 24, 2017 11:24 pm

I read how-a-kalman-filter-works-in-pictures - which sounds exactly what I need (combine fuzzy sensor readings with semi-accurate motor control to get a decent guess of what state the robot is actually in). Does anyone have a successful example usage of lejos.utility.KalmanFilter?

Or am I barking up the wrong tree, and there are better ways of figuring out how to determine my EV3's tilt and location from wheel roll history, infrared distance sensing, and tea-leaf reading...

gyroboy-in-java-lejos-ev3 is a 2017 project, maybe better than KalmanFilters, this formula is very simple and if I'm reading it right, all that is needed to keep it upright?

User avatar
gloomyandy
leJOS Team Member
Posts: 5867
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Example usage of lejos.utility.KalmanFilter?

Postby gloomyandy » Tue Jul 25, 2017 12:25 am

I doubt if you will get an answer that helps very much with your problem. You may have noticed that the filter needs a bunch of inputs. My understanding is that these essentially model the input devices and the physical model of the movement or whatever. Coming up with the values used for these is not trivial and will vary depending upon the robot and the sensors in use. So any example may or may not be easy to apply to your problem. Having said that as someone that has watched many videos, listened to various lectures, read books and papers about the various types of kalman filters and despite all of this still does not really understand how they work or how best to configure them, I'd love to see a fully worked example, that works!

On a more practical note, perhaps if you described what it is you are trying to do, provided details of your robot, your sensors, what is going wrong and what you have tried so far, then someone may be able to help!
leJOS news https://lejosnews.wordpress.com/

salamanders
New User
Posts: 5
Joined: Sun Jul 16, 2017 5:10 pm

Re: Example usage of lejos.utility.KalmanFilter?

Postby salamanders » Tue Jul 25, 2017 11:30 pm

That is comforting to hear that even someone who has taken the time to learn about it is still unsure. :D

As for my robot: two big wheels strapped to the side of an ev3 brick, with a gyro on top, that I'd like to not fall on its face (a noob version of a gyroboy)

https://github.com/david78k/EV3/blob/ma ... .java#L151
or what looks like a more simple approach: https://github.com/BjornChristensen/Gyr ... .java#L118

Aswin
leJOS Team Member
Posts: 310
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands
Contact:

Re: Example usage of lejos.utility.KalmanFilter?

Postby Aswin » Wed Jul 26, 2017 9:55 am

Hi,

I do not think a Kalman filter approach is the best for a balancing robot. Let me try to explain.

The goal of the Kalman filter is to give the best estimation on the state of a system. In case of a balancing robot state could be the upright angle, tumbling speed and gyro drift of the robot. But having the best possible estimation of this state does not prevent your robot from tumbling over. You still would need to translate these variables into motor power. In doing so you would still need to take other factors into account, like for example the forward speed of the robot and its intended speed and direction. Basically you would still need to perform every step that a program like gyroboy does. The filter can improve the inputs for the balancing act, but it cannot replace the balancing act itself.

This brings up the question, is there any need to improve the inputs for the balancing act. Well apparently not, the gyroboy does a good job as it is. So why bother? I think it is best not to bother, don't waste computing time (and your time for that matter) to improve something that is good enough already.
My NXT blog: http://nxttime.wordpress.com/


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 4 guests