Programming a simple walk motion for solo8?

Hi ! I have successfully managed to assemble the solo 8 . Now by modifying example_pd code of master board sdk, I have managed to get the robot up and standing . However I am finding it difficult to get walking manoeuvres up and running .

The difficulty I am facing is that each joint is having some offshoot whenever a specific joint command is passed using setpositionreference() api of master board sdk. Say for example when I pass 1 radian to both joint 1 and 2 , one would expect both joint to have same amount of turn, But that’s not seem to be the case.There is huge difference in how each joint behave to setpositionreference() function call .Another Issue is if setpositionreference is called continously with different value the motor seems to oscillate almost like the successive function calls are preventing motor from completing previous task.
Either way I created some interpolation points between the home position and standing position , with this CSV file managed to get robot stand up . But I am guessing this is not right way. Can some one guide me to correct approach on programming motion in the solo8 platform ?

Hi,
Congratulation on building your robot, we would be very happy if you share some pictures and videos!

About the controller, unlike some other motor controllers, we have no “motion control” that generally generate a smooth trajectory from the current position to the desired position. Instead, you have a Proportional Derivative (PD) feedback controller. It is up to the user to generate a trajectory and send sampled points at a high frequency (100 to 1000Hz) to the motors.

If you only give a far away target, the controller will try to reduce the tracking error quite violently (exponential convergence).

The approach you took with interpolation and csv file is a good first step.

I would advise you to generate trajectory in position AND velocity sampled at 500 or 1000Hz, then in a loop clocked at the sample frequency, use setpositionreference() and setvelocityference() functions to send a point on your trajectory.

About oscillation, you might need to play with the PD gains (Kp Kd). Kp will correspond to the stiffness of the controller and Kd to the damping.

I hope this help.
Best,
Thomas.

Thank you Thomas for the inputs !! will follow a similar approach.

Hi! @thomas.flayols following your suggestion . I made the following approach .
->I successfully ran a pybullet simulation getting the walking gait .
->recorded the joint trajectories and sampled it to the recommended freq.
->Generated a CSV file out of it and fed it to the controller

The end result is good when observing the robot in air .The robot walking gait is good when hanging.
The issue occurs when , I place the robot on the ground . The robot is collapsing.

I believe the torque is very less i the motors . Is there a way to increase torque through the code ?

Hello Shyam,

To increase the stiffness, you will need to crank up Kp (and Kd for stability). This will reduce the tracking error. Go slowly, as very high gains can be dangerous for the robot. Also check that you don’t have a max current limit too low in the interface. Is your code available on a repo? Also a video could help.

Best,
Thomas.

@thomas.flayols Thanks for the suggestion. I did try changing the IQ_sat to 12,but the performance is the same . can you tell me where to change the current settings ?
can you share with me, your email id ? I will send a video for your reference .

I have also added a gdrive link for your reference.

first_walk

Hi! @thomas.flayols As you have suggested , Have managed to increase torque . I set
I_q_sat=12
kp=20
kd=0.1

This had proper position control with good torque , albeit minor oscillation.

However when again tried it today . I could get good initial torque , but under load the torque reduces and intermittently increases. This behaviour was not observed yesterday . Is there any part of code , where I can experiment ?

Hello @siva_uchiha
Good to know you managed to setup the gains.

I have no clear idea on what is causing the torque variation. Maybe you could record the robot data and share the plots here? You could log:
measurement of position, velocity and current as well as reference position and velocity.

Best, Thomas.

Hi! The mistake was on my side , was using a different example file as reference(using position reference() rather than current reference()). I think there is still issue with the structure and have to organise the low level control code base . currently focused on it .

I also noticed that current reference gives more torque than position reference for same kp and kd values.

hello @siva_uchiha
will it be possible for you to share your joint trajectories?

Keval

I actually used data extracted from the kino dynamic planner and scripts from quadruped experiences. From there extrapolated it to generate a walking trajectory. I suggest you can look into champ and adopt that controller for walking. I actually got shifted from this project, so I no longer have access to the old files.

Yours SIncerely,
S.Shyam