mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-03-22 01:31:21 +03:00
add some code to 3steppersLB
This commit is contained in:
@@ -32,8 +32,8 @@
|
||||
|
||||
// limiting values
|
||||
#define MICROSTEPSMAX (512)
|
||||
// (STEPS per second per 10ms)
|
||||
#define ACCELMAXSTEPS (100)
|
||||
// (STEPS per second^2)
|
||||
#define ACCELMAXSTEPS (1000)
|
||||
// max speed IN STEPS!
|
||||
#define MAXMAXSPD (10000)
|
||||
// max encoder steps per rev
|
||||
@@ -49,8 +49,9 @@ blocksizeASH_SIZE_REG ((uint32_t)0x1FFFF7CC)
|
||||
// motor flags
|
||||
typedef struct{
|
||||
uint8_t reverse : 1; // reversing motor rotation
|
||||
uint8_t encreverse : 1; // reversing encoder rotation
|
||||
uint8_t encreverse : 1; // reversing encoder rotation TODO: configure encoder's timer to downcounting
|
||||
uint8_t haveencoder : 1; // have encoder
|
||||
uint8_t donthold : 1; // clear power @ stop (don't hold motor when stopped)
|
||||
} motflags_t;
|
||||
|
||||
/*
|
||||
@@ -61,11 +62,14 @@ typedef struct __attribute__((packed, aligned(4))){
|
||||
uint16_t CANspeed; // default CAN speed
|
||||
uint16_t CANID; // identifier
|
||||
uint16_t microsteps[MOTORSNO]; // microsteps amount per step
|
||||
uint16_t accel[MOTORSNO]; // acceleration/deceleration (dv microsteps/s per 10ms)
|
||||
uint16_t maxspd[MOTORSNO]; // max motor speed (microsteps per second)
|
||||
uint16_t accel[MOTORSNO]; // acceleration/deceleration (steps/s^2)
|
||||
uint16_t maxspd[MOTORSNO]; // max motor speed (steps per second)
|
||||
uint32_t maxsteps[MOTORSNO]; // maximal amount of steps
|
||||
uint16_t encrev[MOTORSNO]; // encoders' counts per revolution
|
||||
uint16_t encperstepmin[MOTORSNO]; // min amount of encoder ticks per one step
|
||||
uint16_t encperstepmax[MOTORSNO]; // max amount of encoder ticks per one step
|
||||
motflags_t motflags[MOTORSNO]; // motor's flags
|
||||
uint8_t ESW_reaction[MOTORSNO]; // end-switches reaction (esw_react)
|
||||
} user_conf;
|
||||
|
||||
extern user_conf the_conf; // global user config (read from FLASH to RAM)
|
||||
|
||||
Reference in New Issue
Block a user