Education Lab / Robotics Theory Basics
MIY STUDIO · COBOT PROJECT 04
Robot Joint Control: Gravity Compensation & Holding Brakes
Building a 6-DOF Collaborative Robot from Scratch
Robot joint control turns a motor command into a measured joint movement. Day 4 explains how encoder feedback, control modes and gravity compensation work together—and how a holding brake supports a loaded axis when drive torque is lost.
WORKED EXAMPLE
2.94N·m
Gravity compensation at the joint output
1 kg payload · 0.30 m reach
Horizontal arm · q = 0°
Calculated teaching example. Actual motor selection needs the complete load model.
01 / FEEDBACK
How robot joint control works
Controller → Servo drive → Motor → Reducer → Joint
The controller sends a target. The servo drive controls motor current and runs the feedback loops supported by the selected operating mode. An encoder reports measured rotation so the system can correct errors.
The motor produces torque. Bearings, shafts and the housing carry the joint’s mechanical loads. For a first test axis, confirm electrical compatibility, communication, gear ratio and rotation direction.
Motor encoder
Measures rotation on the motor side of the reducer. Dividing by the gear ratio estimates the joint angle.
What it can miss: gearbox backlash and elastic twist between the motor and output shaft. [1]
Output encoder
Measures the joint angle at its mounting location. It can reveal an output angle error that the motor encoder cannot directly observe.
Its limit: bending farther along the link is still outside that measurement.
Two encoders need a supported control architecture. Dual-loop control also requires the correct gear ratio, signal direction and tuning. Adding a second sensor alone does not create a working dual-loop controller. [1]
02 / CONTROL MODES
Position, speed and torque: what do you command?
Start with the quantity you want the joint to follow. Each mode answers a different question.
Position control
Where should it go?
The loop reduces the difference between the target and measured position.
Example: move to 30°.
Speed control
How fast should it move?
The loop reduces the difference between the target and measured speed.
Example: rotate at 10°/s.
Torque control
How hard should it push?
The drive follows a torque command, usually through motor current.
Example: request 0.20 N·m at the motor.
Gravity compensation can work alongside position feedback. It adds an estimate of the torque needed to support the load. Position feedback then corrects the remaining error. [2]
A motor torque command is not the same as measured joint torque: the reducer’s ratio, friction, efficiency and elasticity affect torque transmission.
03 / GRAVITY COMPENSATION
Support the load with a torque model
Imagine a horizontal arm carrying a weight. Gravity tries to rotate the arm downward. The motor must apply an opposing torque to support it.
As the arm rises, the weight’s horizontal distance from the joint becomes smaller. Between 0° and 90°, the required gravity compensation torque decreases.
τcomp(q) = m g r cos q
Angle convention: q = 0° is horizontal. Upward rotation is positive. The gravity torque is −m g r cos q, so the compensating torque is positive.
m = payload mass (kg) · g = 9.81 m/s2
r = joint-to-payload distance (m) · q = joint angle
τcomp = compensation torque at the joint output (N·m)
Model used here: one rigid, massless link with a point payload; friction is ignored. A real robot model must include link masses, centers of mass and the positions of the other joints.
04 / WORKED EXAMPLE
A 1 kg payload at 0.30 m
For m = 1 kg, r = 0.30 m and g = 9.81 m/s2, the horizontal compensation torque is:
1 × 9.81 × 0.30 = 2.943 N·m
| Arm position | Calculation | Torque |
|---|---|---|
| 0° · Horizontal | 2.943 × cos 0° | 2.94 N·m |
| 60° · Raised | 2.943 × cos 60° | 1.47 N·m |
| 90° · Vertical | 2.943 × cos 90° | 0 N·m |
Why does the vertical case reach zero? The payload is directly above the joint, so gravity has no moment arm in this model. Other loads, friction and control effort are outside this calculation.
These are rounded calculations for learning, not measured results or a specification for the project motor.
05 / MOTION AND HEATING
Balanced torque does not automatically stop motion
For the same simplified joint, the torque balance is:
J α = τact − m g r cos q + τext
J is joint inertia (kg·m2); α is angular acceleration (rad/s2). τact is actuator torque at the joint output, and τext is additional external torque. All torques are in N·m.
If τact exactly matches τcomp, then J α = τext. With no external torque, acceleration is zero.
Zero acceleration ≠ zero speed
A joint that starts at rest can remain at rest in the ideal model. A joint already moving can continue at its existing speed.
Real hardware needs feedback to handle model errors. Smooth hand guiding also needs suitable damping and treatment of friction. [2]
Holding still can heat the motor
A powered motor still needs current to support a gravity load. That current causes copper loss even when the shaft is stationary.
Include the holding period in the duty cycle used for RMS torque and continuous torque sizing.
06 / HOLDING BRAKES
What supports the joint when drive torque is lost?
Active gravity compensation depends on motor torque. If the drive loses power or torque output, that support disappears.
A power-off holding brake is designed to hold its shaft when de-energized and release when powered. Confirm that operating principle for the selected product. [3]
| Check | What to establish |
|---|---|
| Holding torque | Compare the required load and rating at the same shaft. A motor-mounted brake rating cannot be compared directly with joint output torque. |
| Engage / release delay | Allow for the specified delay and define how the load is supported during transitions and drive faults. [4] |
| Permitted use | Check whether the brake is rated for stopping a moving load. A standstill holding brake may not permit repeated operational braking. [4] |
| Mechanical package | Check added motor length and rotor inertia, then allow space for wiring and service access. [3] |
A holding brake alone does not establish personnel safety. Its use must fit the manufacturer’s limits and the complete machine design. [4]
07 / TAKEAWAYS
Three ideas to carry into the first joint
- Measure the motion you care about. Motor and output encoders observe different parts of the mechanism.
- Separate load support from motion control. Gravity compensation supports the load; feedback controls the joint’s response.
- Account for both power states. Powered holding affects motor heating. Loss of drive torque requires an appropriate load-holding strategy.