Andreas,
You only need to have a few "things" to develop some code that will actually make the device "dance" for you.
- Math skills. High School (Secondary School) Math is minimum. You don't need to know how to do Calculus, but it really, really helps to understand the concepts behind Calculus. One of the most fundamental aspects of Calculus is that it describes Mathematical Models through TIME.
- An understanding of Basic Motion Formulas. You need to know how to manipulate those formulas, using basic math, to produce desired results. Motion Formulas are based on TIME.
- An awareness of limitations - physical & mathematical. You have to be able to sense when you might be pushing or clearly exceeding the limits. That is, after making a calculation for your control model you have to be able to notice whether or not the result is reasonable... otherwise... you must expect "cycle-on-station" or worse, "crash & burn"!
- Imagination. This is by far the most important. The others can be acquired by simply applying yourself to learning them.
You don't need to have examples provided for you. You only need to figure out how YOU would control the motion if YOU were the Computer!
You do drive a car... don't you?
Do you have any idea at all what kind of processing your brain is doing to keep you from being killed? Think about it...
See if you can do "on purpose" what your brain does, apparently without thinking!
Build a "Mathematical Model" of your "vision".
Here's a "vision" idea...
(this is based on the idea that YOU are developing and providing the analog signal that is controlling the device.)
From the "Home Position", have your device "walk slowly" to the mid-point of the travel range then pause.
Then have the device move a short distance at a slow speed in one direction.
At the target point, have the device slow down to zero speed and stop.
Then reverse direction to a point equal distance on the other side of the start point. Again, at the target, slow down and stop.
Then reverse direction again and return to a point a little beyond the first stop point... but this time, a little faster.
Repeat the routine, back and forth, faster and faster (within reasonable limits) until you are near the physical limits.
Then reverse the routine and work towards the starting point.
When you finally stop at the starting point, have the device "walk slowly" to the "other-home".
Now... you could go through the pains, and I really mean pains, of writing code for each move. That might be OK just to see how painful it can be. But, the smarter way is to build a very small function that increments/decrements target values and speed values as you go.
Your code should end up being something as simple as...
Go Direction-W to Position-X at Speed-Y.
You should include code for accelerating as well as decelerating as you approach Position-X.
Then, after stopping, you need to determine the new Direction-W, new Position-X and new Speed-Y.
Once you get into it and get the hang-of-it, it's a kick in the A$$!
Remember, you can mentally slow this process down as slow as you need in order to handle the real-time speeds... simply put yourself into a much slower time-frame.
BTW#1
Just as your Primary School Teacher said... Check Your Work BEFORE handing it in! That is, check your math and your model carefully before you turn the damned thing on! Crash & Burn... remember?
BTW#2
The descriptions I gave are based on an open-loop model. That model can be developed with a simple understanding of basic math.
If you were to use a closed-loop model, then you would definitely need to be very familiar with the Calculus way of looking at things.
(246)