Current/Force Sensing

Every one of Marty's motors is a Smart Servo, that means it can provide feedback about its position, and the amount of electrical current going through the motor. In an electric motor, more current = more force, so this gives us a way to see how much force is on a joint!

In MartyBlocks

The motor current can be used as a sensor in MartyBlocks, look under the sensing blocks section:

Scratch Acc 1

Select a joint from the dropdown list in the Current block, and click the checkbox to display it.

Then, try asking Marty to move, and look at how the value changes.

Reacting to force

We can use the current input to get Marty to react when they sense a force. For example this code will raise Marty's arm, and then dance when you press it:

Scratch Currentsense 1

Note that we have to use a Hold block to get Marty to hold their joints in position - by default Marty is poseable when not moving - so will just let you move their arm.

Task Runner