aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/Source/d_output.h
diff options
context:
space:
mode:
authorJohn Hansen2011-03-13 23:36:50 +0000
committerNicolas Schodet2011-07-04 00:37:04 +0200
commitfc1e658f15bbb8d4497d189e79b43fab4b964839 (patch)
tree829ae4b3ece944522a68919cd2685d49fc06c341 /AT91SAM7S256/Source/d_output.h
parentd8a6b2de30e139a676593aac5feb9eb47479dce2 (diff)
Added position regulation mode (Nicolas Schodet)
git-svn-id: https://mindboards.svn.sourceforge.net/svnroot/mindboards/lms_nbcnxc/branches/version_131@37 c9361245-7fe8-9947-84e8-057757c4e366
Diffstat (limited to 'AT91SAM7S256/Source/d_output.h')
-rw-r--r--AT91SAM7S256/Source/d_output.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/AT91SAM7S256/Source/d_output.h b/AT91SAM7S256/Source/d_output.h
index ce78246..20955a6 100644
--- a/AT91SAM7S256/Source/d_output.h
+++ b/AT91SAM7S256/Source/d_output.h
@@ -39,10 +39,17 @@
#endif
+#define DEFAULT_MAX_SPEED 80
+#define DEFAULT_MAX_ACCELERATION 20
+
+#define REGULATION_TIME 100 // Measured in 1 mS => 100 mS regulation interval
+//#define REGULATION_TIME 10 // Measured in 1 mS, regulation interval
+
//Constant reffering to RegMode parameter
#define REGSTATE_IDLE 0x00
#define REGSTATE_REGULATED 0x01
#define REGSTATE_SYNCHRONE 0x02
+#define REGSTATE_POSITION 0x04
//Constant reffering to RunState parameter
#define MOTOR_RUN_STATE_IDLE 0x00
@@ -51,9 +58,8 @@
#define MOTOR_RUN_STATE_RAMPDOWN 0x40
#define MOTOR_RUN_STATE_HOLD 0x60
-
-#define RAMP_TIME_INTERVAL 25 // Measured in 1 mS => 25 mS interval
-#define REGULATION_TIME 100 // Measured in 1 mS => 100 mS regulation interval
+// Constants related to Regulation Options
+#define REGOPTION_NO_SATURATION 0x01 // Do not limit intermediary regulation results
enum
{
@@ -76,12 +82,16 @@ void dOutputResetTachoLimit(UBYTE MotorNr);
void dOutputResetBlockTachoLimit(UBYTE MotorNr);
void dOutputResetRotationCaptureCount(UBYTE MotorNr);
void dOutputSetPIDParameters(UBYTE MotorNr, UBYTE NewRegPParameter, UBYTE NewRegIParameter, UBYTE NewRegDParameter);
+void dOutputSetMax(UBYTE MotorNr, SBYTE NewMaxSpeed, SBYTE NewMaxAcceleration);
+void dOutputSetRegulationTime(UBYTE NewRegulationTime);
+void dOutputSetRegulationOptions(UBYTE NewRegulationOptions);
void dOutputRegulateMotor(UBYTE MotorNr);
void dOutputCalculateRampUpParameter(UBYTE MotorNr, ULONG NewTachoLimit);
void dOutputRampDownFunction(UBYTE MotorNr);
void dOutputRampUpFunction(UBYTE MotorNr);
void dOutputTachoLimitControl(UBYTE MotorNr);
+void dOutputAbsolutePositionRegulation(UBYTE MotorNr);
void dOutputCalculateMotorPosition(UBYTE MotorNr);
void dOutputSyncMotorPosition(UBYTE MotorOne, UBYTE MotorTwo);
void dOutputMotorReachedTachoLimit(UBYTE MotorNr);