Skip to content

Meaning of the parameters

Michael Mayer edited this page Feb 2, 2019 · 3 revisions

Meaning of the parameters

Elm's page gives a basic overview about the control parameters. Let me add some detail here.

This is his schematic overview of SMC3: schematic overview of SMC3 by Elm Chan, CC-BY-3.0 Please note that the parameter numbers for the torque limit (should be P4) and Eg, the back-EMF feedback gain (should be P5) are interchanged.

Measurement units

Values are either 16 bit integer (u16/s16) or 8.8 fixed point values (u8.8/s8.8). To convert a rational number into a 8.8 fixed point value, simply multiply it by 256. The rational value 1.5 is entered and stored as the decimal value 384.

  • positions are referenced in encoder counts (which is different from encoder pules, see below)
  • speed is in counts/millisecond, which is means kHz. Normally just a 16 integer, except for the P6 parameter which is treated as u8.8
  • voltage is expressed as a fraction of the maxium motor suppy voltage. The range is [-1.0;+1.0] which corresponds to [-256:+256]. Think of it as a 8 bit PWM value plus one bit for the sign.
  • torque means the motor current. Expressed as a fraction of the stall current, similar to the voltage.
  • gains are just numbers as 8.8 fixed point.

P0 velocity limit

All speeds for J and G commands are clamped to this value. Set this to the highest speed allowed for regular use. Keep the braking distance in mind when choosing this. counts/ms (kHz), u16, mode 3.

Useful range: 1 up to the highest speed your machine can still brake safely without damaging anything, even for repeated use. Start conservative and choose wisely.

P4 torque limit

Specifies the maximum allowed motor current as a fraction of the stall current. (mode 2, 3)

Useful range is [1:240] (as u16), meaning ]0:15/16] (as u8.8).

(15/16 is the software-enforced maximum PWM duty ratio to still allow the use of boostraped motor drivers)

P5 EG compensation gain

Unit V/V/cnt/ms = 1/kHz = 1000s (strange, isn't it?), u8.8, mode 1,2,3

P5 is the 'generated voltage (expressed as a fraction of the maximum motor voltage) per encoder count per millisecond'. This is specific for every motor and depends on the decoder resolution, the supply voltage and the driver losses. The details on how to measure or calculate this value fills its own wiki-page

Useful range: Hard to tell. Depends on so many things. But easy to measure.

P6 motion speed

The top speed of ramped velocity profiles for moves with the G0 command. In contrast to the other speed values this is treated as an unsigned 8.8 allowing for very fine grained control. (mode 3)

Useful range is [0:P0*256] (as u16), meaning [0:P0] (as u8.8).

P7 acceleration

Acceleration for G0 moves in counts/(ms)^2. Again, this is an unsigned 8.8 value for fine control. (mode 3)

Ever millisecond this value is added to the desired speed. If this value is e.g. 16 (meaning 0.0625), than the speed for G0 moves ramps up at a rate of 62.5 enc/ms per second. Accelerating from zero to 10 enc/ms would take 10/(1/16) = 160 milliseconds.