I was looking through this thread from the beginning, and WAAAAYYY back in Post#9 I found that WeldingRod had suggested this...
You could set the legs up to go to fixed positions one at a time. Or, if your insanity knob is broken off, you could make it self leveling ;-)
WeldingRod are you physic or sumfin? I think the insanity knob has been turned way past 10 to maybe 15, or 25.
The current plan is for the Arduino to extend/retract, raise/lower the outriggers. To do this without breaking anything I'll need at least a fully retracted limit switch for outrigger extension. I think I can get by with just timing the extend, I'll just have to find the maximum safe extension time. I'll use the fully retracted limit switch so that the outrigger will always be starting its' extension from a known position. I'll need a full up limit and a full down limit for the outrigger raise/lower ram so I don't break anything on it. That's 3 limit switches per outrigger or 12 total for all the outriggers. When you add in the I/O for the lights and communicating with the radio this is WAAAAYYY beyond an Arduino Nano, probably need to go with a Mega.
I'll start the auto leveling sequence by leveling the back of the machine. I was going to start at the lowest corner, but then I realized the rear axle is fixed, while the front axle pivots. If the lowest corner is at the front of the machine and I try to correct the roll angle, then the machine has to pivot on ONE of the rear tires - putting a lot of stress on things. I know, this is a MODEL and the stress will be minimal - but still... Anyhew, lower the high side rear outrigger until the roll angle changes, then lower the low side rear outrigger until the roll angle changes. At that point both the rear outrigger pads are on the ground. Continue to lower the low side outrigger until the roll angle is 0° or at least crose-enuf, or until we hit the outrigger max down limit - which-ever comes first. The low side outrigger will also need to be slowly extended as it is being lowered to keep the pad in approximately the same spot. The end of the outrigger swings in arc as it is lowered which will try to pull the pad closer to the machine - can't have that. (We gots an Arduino, it can keep track of such trivia so we don't have to worry about it.)
Next we lower the front outriggers until they touch the ground. I was planning on lowering one at a time until I saw a change in the roll angle, but with both the rear outriggers planted firmly on the ground I don't think it's going to want to roll much, won't know until I get a test rig built. It'll probably be best to look for a slight change in pitch angle, the outrigger will be lifting the machine after all. Do this for both sides up front.
Once both front outriggers are on the ground we determine from the pitch angle if we're nose up or nose down. If we're nose up then lower and extend both of the rear outriggers until the pitch angle is crose-enuf to 0°. If we're nose down, then do that to the front outriggers instead. We may have to do some correction to the roll angle as we are correcting the pitch angle, but that's for later when we decide to get elegant with this instead of just hitting it with a 2x4 to make it work. Same for alerting the operator that it's too far out of whack to do an auto-level without some help.
I need to do some more digging into the 6050 IMU that I'll be using for the pitch and roll sensor. I need to find out when it initializes, whether it's on power-up, or if it's on command. I think that the pitch, roll, and yaw angle offsets are determined on initialization - and all angles are based on those offsets. I seem to remember one video where the unit was initialized and then yawed 90°, the IMU was showing what was actually a pitch angle as a roll angle, and vice-versa. If it initializes on command then I'm golden as I intend to keep this thing brain-dead until I tell it to level. If it initializes on power-up then I'll have to do what the quad-copter guys do and correct the pitch and roll angles based on the yaw angle.
Meanwhile back at the ranch, I need to figure out what I'm going to use for limit switches, and where I'm going find room to put them. I'm going to need to get plenty of inspirsation from Mick thebass, and the rctractorguy. Mick does Bruder conversions, check out his YouTube channel.
https://www.youtube.com/channel/UCbTqmHlFmasSVFomeuu0hsQ He has no problems putting 10 pounds into a 5 pound sack.
The rctractorguy converts 1/32 scale die-cast tractors and equipment to RC, and that's more like putting 25 pounds in a 5 pound sack. This is his channel.
https://www.youtube.com/c/rctractorguyI wanna be just like those guys when I grow up, right down to the cool accents.
Don
I know, I know,,, No pictures so this didn't really happen, but there's been a LOT of skull-sweat involved, does that count?