entech281 / Season_2018

0 stars 1 forks source link

Linear Axis-- Generic #40

Open dcowden opened 6 years ago

dcowden commented 6 years ago

This class composes two limit switches, an encoder ( via digital io), and a motor.
It applies a trapezoidal speed profile as it moves to the commanded positions.

The trapezoid is in terms of speed percentage. the user provides a top speed percentage, a minimum speed percentage, and a ramp down length( expressed in encoder counts).

If the requested move is > than the ramp length, we'll move at the top speed. If the requested move is less than the ramp down length, we'll ramp speed down linearly to the minimum speed at the end of the move.

A tolerance provides final control to ensure reaching the end.