Components for the battery pack came in today. There's:
- 2 li-ion batteries, 3.7v 1200 mAh
- usb li-ion battery charger board (not pictured, TP4056)
- DC-DC converter board (LM2596S)
- current sensor board (ACS712)
I'll make a 7.4V battery and use the converter to step the voltage down to 5V to power the servos. The current sensor is going on the battery leads so I can track the power consumption. It outputs an analog voltage so I'll use an attiny to read that and put it on the I2C bus.
I'm not sure if the batteries have enough capacity to provide a decent amount of running time for the robot but we'll find out. At least the current sensor will give some insight into the actual power consumption of the robot.
The first working stable gait (dynamically generated) is working. The robot can now move its body in a straight line in x or y direction (one of the two) indefinitely and the legs will move to keep the robot stable at all times. Since turning was already available, we can now walk anywhere:
The lighting is terrible I know. The feet are still being lifted in a very rough manner, causing the rest of the robot to slip over the smooth table. I'm working on that...
I made some functions to allow a statically stable turning motion of the robot around its own center. Stability is preserved by moving the robot's body into a position that allows stable lifting of a foot before each transfer.
The resting positions for all feet are known. They are chosen for their high kinematic margins in all directions. (i.e. all servos set to their middle angle to allow for the most room for movement).
The turning motion is then generated with the following cycle:
Find the resting positions for each foot when the body would be turned by x radians
Look at the legs that have not been transferred yet
Move to a position to allow any of those legs to be lifted with stability
Lift the leg and transfer it to its new resting position
Turn the body by x/4 radians
Repeat steps 2 through 6 until all legs are transferred and the body has turned x radians
Move the body back to the center
The result can be seen in the following video, where x = 0.3
With a few modifications this cycle might be used to reset all legs to their resting positions by simply doing a turning motion for 0 radians. More on that later...
the video shows the robot walking a few steps while the body moves forward in a straight line.
All of the movements are generated by evaluating the model at the current time.
Basically: all feet are connected to eachother and to the center of the robot body by virtual springs. The robot center body is moved forward while the feet remain on the ground. The gaitgenerator runs the following cycle:
1. find the leg L that has the higest virtual force in the direction of movement (forwards)
2. check if L can be lifted without losing stability (i.e. toppling over)
3. if L can be lifted, move its foot upwards
4. generate the target for the foot based on the combined virtual spring forces and an extra virtual force in the movement direction
5. place the foot down at the generated position
This method of gaitgeneration is still far from finished. Next step is expanding the virtual spring model to provide an approximation of the kinematic limits of the robot.