Config Files
pinky.yaml
Location: FPGA, /home/root/pinky.yaml
Github: https://github.com/Roboy/roboy_plexus/blob/roboy3/config/pinky.yaml
Function
list all busses connected to the Core Board (FPGA breakout board)
map bus_id to global_id (system-wide unique) for all motors
define conversion factors from meter to encoder ticks
set spinning direction of M2
define joint position offset for 1DOF magnetic sensors (2x per elbow, 2x per knee)
Updating motor ids
Once the motor board is exchange, one needs to update the pinky.yaml with the new id written on the motorboard (133 on the photo).
Find out
global_id
of the non-functional motor either through Node-Red’sSystem Check
UI or using the/roboy/pinky/middleware/SystemCheck
ROS service:rosservice call /roboy/pinky/middleware/SystemCheck "motorIDs: [suspected_id1, suspected_id2]"
Note the
bus_id
written by hand on the broken motorboardNote the
bus_id
written by hand on the new functional motorboardSSH to the FPGA
ssh root@192.168.1.196
Open pinky.yaml
vim pinky.yaml
Go to
icebus
sectionFind out the
(X,Y)
position in the motor’s 2D list where you need to update:using the broken
global_id
from step 1in
motor_ids_global
2D list findX
andY
coordinate of theglobal_id
using the broken
bus_id
from step 2using comments in
motor_ids_global
find outX
coordinate by the body part namefind out
Y
coordinate by the brokenbus_id
in thebud_ids
array
Replace
icebus -> bus_ids[X][Y]
with the new motorboardbus_id
from step 3
cardsflow.xml
model.urdf
motor_config.yaml
controller.yaml
Link: https://github.com/Roboy/roboy3_models/blob/caspr/upper_body/config/controller.yaml
Example:
Kp: P gain for PD controller
Kd: D gain for PD controller
dt: time step of doing integration inside forward_kinematic function
Note: These parameters can be changed at runtime if debug:=true when starting kindyn
Control workflow
Input: current_joints, target_joints
Output: direct tendon length for each motor
Workflow
Compute the error on joint space
joint_error = target_joints - current_joints
Apply PD controller on joint_error, with Kp and Kd
joint_command = Kp * joint_error + Kd * (joint_error - last_joint_error) / delta_t
Transform it to the command on tendon space
l_command = L * joint_command // L is the Jacobian matrix
Doing one step forward kinematic to get the final command with parameter dt
Note: Need to do inversion since we need both q_next and l_next; without inversion, we can not convert directly l_next to q_next since it is an ill-posed mapping.
Send l_next to roboy_plexus
Â