I want to create an EV3 robot similar to this:
I've glanced at the mentioned papers. To me it seems that some simpler equations to govern the motors will work also.
I have 9 segments, articulated by 8 motors (two intelligent bricks daisy-chained).
I want the angles of the segments to be proportional to a sine. Doing some calculations in some graphing software, this should be sufficient to have the snake move in a wave.
However, there seems to be no robust, reliable way to set an angle on an EV3 motor. I have a MoveTo myblock, where I use the motor first as angle sensor, calculate the difference to the desired angle and then set the motor "on" for that amount. I also tried setting the power proportional to the difference. But I do not succeed is setting the angle accurate enough, it starts drifting or overshoots. I can't synchronize all the segments that way.
Is it feasible to attempt this in the graphic programming language that comes with the ev3 software or do I need to look to something more advanced?
Any hints would be appreciated.
Edit: Made some headway, rather than putting the motor "On" for a number of degrees, I simply place the motor "On" with a power proportional to the error between the measured angle and desired angle. Works good enough for now. This is the P in a PID-controller, adding an integration and derivative part might help. The problem I'm currently facing is the weight distribution, the segment that is the head of the snake doesn't have a motor and hence is much lighter. I need to find a better set of factors to multiply the errors with for each motor. I'm confident I'll succeed in this by trial and error whenever I find the time.