C++ class for controlling DC motor with encoder feedback. Dependencies include LS7366LIB, MotCon, and PID.
Dependencies: LS7366LIB MotCon2 PID
Diff: Axis.h
- Revision:
- 7:d0458137d6e0
- Parent:
- 5:79dcaa63700c
- Child:
- 8:7e399d7c990d
--- a/Axis.h Thu Dec 17 19:10:55 2015 +0000 +++ b/Axis.h Thu May 19 12:41:53 2016 +0000 @@ -21,9 +21,9 @@ void axisOn(void); void zero(void); - long enc; - float co;// = 0.0; - float Tdelay;// = .01; + long enc; //used to return the data from the LS7366 encoder chip + float co; // = 0.0; + float Tdelay; // = .01; float Pk; // 120.0 for scorbot float Ik; // 55.0 for scorbot float Dk; @@ -41,9 +41,11 @@ int debug; int *ptr_limit; float totalCounts; - float motCurrent; - float mot_I_lim; + float motCurrent; //motor current read from readCurrent() function + float mot_I_lim; //max current limit int axisState; + int motInvert; + char dataFormat; //'r'=radians (default), 'd'=degrees, 'e'=encoder counts Ticker update; Ticker moveProfile;