Electric friction brake. An electric friction brake, often referred to as just electric brake or electric trailer brake, is a brake controlled by an electric current and can be seen on medium duty trailers like caravans/RVs and consumer-grade car trailers. It is related to the electromagnetic track brake used in railways which also use electric current to directly control the brake force.

Mechanical principle 
This describes the electrically controlled drum brake principles.

The brake is built with the brake shield (1) as a base that contains the mechanism. The brake shield is mounted on an axle/spindle using the holes in the centre.

The brake shoes (3) are the items performing the braking by pressing outwards at the drum that covers all the innards.

The brake shoes are held in place by reactor springs (2) and an adjuster (7) spring. There are also some minor clips not pictured to keep the brake shoes in place.

Braking starts with applying a current proportional to the desired brake force to the electromagnet (5) which is pulled axially towards the drum. If the wheel is rotating the drum will then pull the actuating arm (4) either to the left or to the right depending on the rotation of the wheel. The actuating arm is pivoted on the black round pin that is anchored to the brake shield. This in turn applies pressure on one of the brake shoes which comes into contact with the brake drum. The first brake shoe then tries to follow the rotation while asserting friction and thereby propagate the movement onto the second brake shoe through the adjuster which also pushes against the drum. The friction force is then caught by the stopper (Black trapezoid) mounted on the brake shield.

The braking force asserted is caused by the friction between the electromagnet and the face of the drum which depends on the current through the electromagnet (as stated before). The force applied on the brake shoes is counteracted by one of the reactor springs (which one depends on the direction of the rotation) so that when the current through the electromagnet is withdrawn the spring ensures that the actuating arm is returned to its resting position and the brake shoes are retracted from the drum.

The electric current controlling the brake force is supplied by a trailer brake controller.

Electrics 
The electric current controlling the brake through the electromagnet is provided from a brake controller which provides the control current from the towing vehicle. There are different types of brake controllers on the market, each with their own advantages and disadvantages.

The current controlling the brakes from the towing vehicle is originating in the battery/alternator of the towing vehicle via the brake controller and then transferred via wiring through the electric brake pin in the trailer connector through the trailer wiring to the electromagnet and back through the trailer wiring to the trailer connector and to the towing vehicle chassis/frame through the ground pin in the trailer connector.

To minimize interference between vehicle lighting and brakes the circuits shall be as separated as possible.

Possible electrical fault situations 
Kirchhoff's circuit laws are the basics for how to understand problems with the electrics. Electrical faults involving brakes can range from annoying to dangerous so it is important to really get it working right.

When tracing faults it is important to try to see all symptoms, since that can lead to a component that is common for all parts. And one component that really is taking a beating in most trailer electrical wiring is the ground pin of the connector since it has to handle all return current from the trailer to the towing vehicle.

A few symptoms that may occur on the trailer.
 Interference is known as 'pulsating brakes' which may occur when braking while also having the turn indicator flashing. There are different ways to minimize this problem, and it ranges from using a special pulse preventer to having a separate electric brake trailer connector with a brake circuit completely separated from the rest of the trailer wiring. Be aware that if you do a completely separate wiring the brake ground must be separated from the lighting ground. That includes the breakaway protection circuits and battery. (Think of what Kirchhoff's circuit laws says).
 Lights on the trailer changing in proportion to the brake force applied.
 Brakes that actuates when some trailer lights are turned on. Watch out for this because the brakes may only be slightly dragging as soon as the position lights are on and that can result in unnecessary wear and overheated brakes.
 Undersized wiring causes excessive voltage loss to the last magnet in the electrical loop. This magnet is therefore rendered ineffective. As a consequence, the first electric magnet locks the wheel when braking occurs.
 Uneven brake shoe adjustment can mimic a faulty magnet. Ensure both brake shoes are adjusted correctly.

Maintenance 
Since brakes are a safety feature maintenance on brakes shall be in the form of preventive maintenance which means that it shall be performed before any breakdown happens.

Maintenance shall always be symmetric on the whole axle of a trailer. If changing items on one side the same items shall be changed on the other side to ensure symmetrical braking.

Adjustment 
Adjustment of the brake is done through the adjuster (6) which basically is a screw that can be accessed when the brake is assembled. The adjustment is necessary to make sure that the brake is working as expected and not applying brake force when not expected by having too tight margins while still retaining a good responsiveness from the brake.

Wear items 
The brake shoes are wear items and need to be replaced when worn down. The magnet also has a pad that shall be inspected when the brake shoes are replaced. If the magnet pad is worn (if such exist on the brake in question) it shall also be replaced. The drum itself is also a wear item and needs to be replaced when certain wear limits have been reached to ensure that it is safe to use.

If excessive braking occurs the electromagnet itself can suffer a burn-out through overheating and need to be replaced. However the environment inside the brake drum can be very tough on electric parts. This means that the magnet itself shall be tested while the drum is removed and be replaced if needed.

References 

Vehicle braking technologies
Brakes