Skip to main content
NewEpisode 3a is out: Carry the conversation onWatch →

This part is for members

Membership opens soon. Leave your email and we'll tell you the day it does. Founding members get the launch price.

Keep watching the free parts
Motion modes · 25b

PV and PT: one ramp

25a was PP mode; this one is the two simpler profile modes. Running example: the same CANopen master selects PV and writes 0x60FF = 600 rpm (6000 rpm/s both ways), then switches to PT and writes 0x6071 = 200; the pvpt25 bench runs the bus build and records every call of linear_trajectory_planning. Nine stops: both modes share one generated ramp with one memory, traj_now, moved by slope × dt each tick and landing on the command when it would pass it (tick 0 steps 1310.72 counts/s, tick 999 lands on 600: 100 ms); PV starts from the measured speed after a disable, reads Target_velocity every tick (no bit-4 edge) and commands 0 under halt or an unreleased brake; it picks the rate by size alone, |target| > |last planner speed| means acceleration, otherwise deceleration (at 1000 rpm/s, 600 → 300 takes 300 ms); so a reversal to −600 uses deceleration only on tick 2000 and crosses 0 at tick 3000 (100 ms, not the 600 ms 0x6084 asks for), and a halt does the same, a real bug: the patched copy from fix/pv-reversal-deceleration crosses 0 at 599.9 ms; velocity reached uses the measured speed, within 10 rpm for 20 ms: the motor enters the window at tick 981, reached at tick 1182, statusword 0x0237 → 0x0637; PV quick stop uses Quick_stop_deceleration, 0 in 3 ticks, disabled at tick 2370; PT's 200 is per mille of rated current, a 1.838 A q current, ramped at the default Torque_slope of 1 A/s straight into idq_tar_A[1], done at tick 18382, with no speed loop: the unloaded motor reaches about 6930 rpm and only the 7200 rpm overspeed check stops it (→ episode 20); torque reached compares the planner output and sets at tick 18381, but the statusword table has no PT row, so the master never sees it; the patched copy from fix/pt-target-reached-statusword shows 0x0237 → 0x0637; a PT halt ramps to 0 at the same 1 A/s and a PT quick stop disables on the same tick (the coast after it is worked out from the code). Your turn: 0x6087 = 1000‰/s is 9.19 A/s, 0.2 s.

Up next25c · Homing: finding a known position→