Quadruped control

I want to design an arduino touch screen control for a 4 legged robot. Assuming it is already available I will use that one. I don’t yet have a quad or arduino touch screen, but I have ordered inexpensive versions of both.
Concept: touch screen foot position control. One side of screen has 4 sliders to control foot height. while touching a slider, the other side of screen has a field where dragging a finger causes comparable lateral foot motion, interaction similar to old fashioned laptop touch pad mouse control.

I want to design an arduino touch screen control for a 4 legged robot.

Permission granted.

UKHeliBob:
Permission granted.

Hoho!
Actually I don't know where to begin. I did change my blinking led values one time. I will have to try some reading and videos. I'm not understanding the programs that calculate the foot position,,, using lk math (or is it ik, ?) I looked at the programs and didn't see any math. Is the algorithm already part of some library?

I looked at the programs and didn't see any math

Which programs have you been looking at ?

Hi,

but I have ordered inexpensive versions of both.

Can you tell us what they are?
Can you hack into the robot to do what you want?
I suggest to are in the wrong forum section.

What hardware have you ordered and what are the specs?

Tom.... :slight_smile:

UKHeliBob:
Which programs have you been looking at ?

This page talks about some aspects of quadruped programming, however I'm not sure where he is programming the "IK" equations. The servo library doesn't have code for foot position, I don't see includes like the ones linked where the discreet maths are defined.

I haven't tried a particular program , I am hoping to find a library that's oriented for the task, I suppose I assumed there would have been already quite a bit of work done on the subject. Perhaps patent lottery is holding back the public domain, but you know , my brother works at the patent office, and they are there to protect people who are heavily invested in business plans, not research who might be responsible for a particular discovery... actually they are all very set against people who try to claim ideas without factory scale production underway. ,, I suppose I don't think I can make the better robot program, and I basically think there's a paste for me.

TomGeorge:
Hi,Can you tell us what they are?
Can you hack into the robot to do what you want?
I suggest to are in the wrong forum section.

What hardware have you ordered and what are the specs?

Tom.... :slight_smile:

I don't really know the specs, if you check Amazon for liserslicer quadruped body kit , servos not included, you should find a little blue one. Pretty common looking.

Hi,
Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom.. :slight_smile:

TomGeorge:
Hi,
Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom.. :slight_smile:

minimal

Each leg has three servos. One servo is horizontal and sweeps the leg in an arc. Two servos are in a plane perpendicular to the arc. Together those two control the position of the 'foot'. Knowing the position of the horizontal servo, the lengths of each arm, and the angles of each servo you can determine where the 'foot' is relative to the body of the quadruped.

The inverse of that (inverse kinematics) is calculating what angles get the foot in the position you want. The pivot angle is easy because there is only one angle that passes through the desired point and you only need X and Y to determine that angle. Then you just need the distance and height of that point to calculate the two angles that will position the foot there.

If you have multiple sliders you want to control at the same time you will need a multi-touch touchpad. Those are less common than the single-touch kind.

I didnt know the touchscreens were single touch. Yhat will change a lot, i will have to get a multitouch without question.

As ive said, i havent even gotten the parts, and in a perfect world i wouldnt try to design something thats already been designed, but i still dont see where a good quadruped program is yet "open source".

I by now understand the math for inverse kinetics, i would need to translate that to program math, ive heard there are program simulators to monkey with if you arent ready for equipment?

I dont know how to program the math, but since my op, ive mostly only spent time at work,, it will take a while before i manage to set at it. I might have all of my equipment by then.

I did order a second arduino board for the controller, but considering the pending touchscreen limitation, maybe i should gun for android control.

johnwasser:
Each leg has three servos. One servo is horizontal and sweeps the leg in an arc. Two servos are in a plane perpendicular to the arc. Together those two control the position of the 'foot'. Knowing the position of the horizontal servo, the lengths of each arm, and the angles of each servo you can determine where the 'foot' is relative to the body of the quadruped.

The inverse of that (inverse kinematics) is calculating what angles get the foot in the position you want. The pivot angle is easy because there is only one angle that passes through the desired point and you only need X and Y to determine that angle. Then you just need the distance and height of that point to calculate the two angles that will position the foot there.

If you have multiple sliders you want to control at the same time you will need a multi-touch touchpad. Those are less common than the single-touch kind.

I’m learning about inverse kinematics.

I’ve discovered that library <math.h> doesn’t even need to be included, it is simply part of the arduino programming. So using cosine commands (etc.) work already, no additional library (although the math in the learning page of this site does not include those code words).

So I haven’t worked the math yet, so don’t really have a clear picture, but basically remember enough about triangles to know what to do. The program will be epic. my leg isn’t moving tonight.

I have a geometry for dummies book, and some math textbooks, maybe I’ll take them to work and just do problems so that cos isn’t so alien, and visualizing the IK is a little more natural, ,

I haven’t started trying to find out about programming the touch screen, I have a second arduino board on order (10 bucks elenco from amazon), but don’t know anything about communicating the two boards.

I have considered using two buttons for foot elevation (up and down), and then because (although I bought a third servo, I want to keep the learning curve shallow) I have only two servos hooked up, I probably and to try to rig up my joystick for lateral position… I could also use buttons and the joystick to control individual legs rather than a touchscreen, by using switches or a selector switch to toggle which foot is controlled, then using an up and down button for foot height and a joystick for lateral position control.

the body would still need to constantly recenter, and the other legs would need to move to accomplish this goal, so before I start with the actual quadruped, I want to figure out the equation (algorithm?) that constantly adjusts the center of mass to the moving foots position (by readjusting all 12 servos at all times). This equation might be big, and apparently older models of the UNO can’t even do things like cosine math, I wonder if my UNO will take the abuse? perhaps the uno in charge of the controller can handle the equation, and transmit positions to the uno in charge of servo movement, meaning the onboard uno is only responsible for receiving positions and driving the servos, while the controller uno is responsible for receiving pin inputs, conducting equations, and sending servo position information.

when other pilots are programming “gaits”, how are they controlling the body’s center? is it all from an equation or are they setting up the servo positions from precalculated data over a time-scale, so at time 1, all servos are in these positions, at time 2 all servos are in these (listed) positions, etc… ???

Quadrupeds are hard. Whenever you lift a leg your base goes from a quadrilateral to a triangle. To keep from toppling over the center of gravity (CG) has to be over that triangle. That is why hexapods are much more common.

The good news is that the CG will always be between the lifted leg and the opposite leg. The dividing line is the line between the other two feet. Note that the CG will change as legs are moved.

My first guess would be to pick the direction of motion, move the body in that direction (by moving all four feet in the opposite direction) and constantly check for what foot can be moved without falling over. Move that foot as far in the direction of motion as you can. Repeat.

Good luck!

I have found that the Sunfounder Quadruped has resources that are available just online, no purchase required, that have lots of code for their quadruped.

I feel excited, because it looks like the code for inverse kinematics is pretty well laid out, setting me back into mostly copy and modify.

That touch-screen I got,, I don't know what to do, I can't get it to work at all. It just is bright white, and I read a lot of people are the same. I wonder if the pins are right,, probably not, and then it came with a pamphlet telling me to use the cd,, which it did not include. (for libraries and samples).

I might be able to use the playstation joystick to move each foot, but I don't think that sunfounder has that going on in their code, and I haven't figured the joystick out. I understand the potentiometers, but don't understand how to translate those feeds into directional motion just yet. (I understand how to affect single motors, but not foot position)