Definition in file speed_cntr.h.
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | speedRampData |
Holding data used by timer interrupt for speed ramp calculation. More... | |
Defines | |
#define | A_SQ (long)(ALPHA*2*10000000000) |
#define | A_T_x100 ((long)(ALPHA*T1_FREQ*100)) |
#define | A_x20000 (int)(ALPHA*20000) |
#define | ACCEL 1 |
#define | ALPHA (2*3.14159/SPR) |
#define | DECEL 2 |
#define | FSPR 200 |
Number of (full)steps per round on stepper motor in use. | |
#define | RUN 3 |
#define | STOP 0 |
#define | T1_FREQ 460750 |
#define | T1_FREQ_148 ((int)((T1_FREQ*0.676)/100)) |
Functions | |
unsigned int | min (unsigned int x, unsigned int y) |
Find minimum value. | |
void | speed_cntr_Init_Timer1 (void) |
Init of Timer/Counter1. | |
void | speed_cntr_Move (signed int step, unsigned int accel, unsigned int decel, unsigned int speed) |
Move the stepper motor a given number of steps. | |
Variables | |
GLOBAL_FLAGS | status |
Global status flags. |
|
Definition at line 76 of file speed_cntr.h. Referenced by speed_cntr_Move(). |
|
Definition at line 74 of file speed_cntr.h. Referenced by speed_cntr_Move(). |
|
Definition at line 77 of file speed_cntr.h. Referenced by speed_cntr_Move(). |
|
Definition at line 81 of file speed_cntr.h. Referenced by speed_cntr_Move(), and speed_cntr_TIMER1_COMPA_interrupt(). |
|
Definition at line 73 of file speed_cntr.h. |
|
Definition at line 82 of file speed_cntr.h. Referenced by speed_cntr_Move(), and speed_cntr_TIMER1_COMPA_interrupt(). |
|
Number of (full)steps per round on stepper motor in use.
Definition at line 56 of file speed_cntr.h. |
|
Definition at line 83 of file speed_cntr.h. Referenced by speed_cntr_Move(), and speed_cntr_TIMER1_COMPA_interrupt(). |
|
Definition at line 80 of file speed_cntr.h. Referenced by speed_cntr_Init_Timer1(), and speed_cntr_TIMER1_COMPA_interrupt(). |
|
Frequency of timer1 in [Hz]. Modify this according to frequency used. Because of the prescaler setting, the timer1 frequency is the clock frequency divided by 8. Definition at line 53 of file speed_cntr.h. |
|
Definition at line 75 of file speed_cntr.h. Referenced by speed_cntr_Move(). |
|
Find minimum value. Returns the smallest value.
Definition at line 281 of file speed_cntr.c.
|
|
Init of Timer/Counter1. Set up Timer/Counter1 to use mode 1 CTC and enable Output Compare A Match Interrupt. Definition at line 143 of file speed_cntr.c. References speedRampData::run_state, srd, and STOP. Referenced by Init().
|
|
Move the stepper motor a given number of steps. Makes the stepper motor move the given number of steps. It accelrate with given accelration up to maximum speed and decelerate with given deceleration so it stops at the given step. If accel/decel is to small and steps to move is to few, speed might not reach the max speed limit before deceleration starts.
Number of steps before we hit max speed. Number of steps before we must start deceleration (if accel does not hit max speed). Definition at line 46 of file speed_cntr.c. References A_SQ, A_T_x100, A_x20000, ACCEL, speedRampData::accel_count, CCW, CW, DECEL, speedRampData::decel_start, speedRampData::decel_val, speedRampData::dir, speedRampData::min_delay, RUN, speedRampData::run_state, GLOBAL_FLAGS::running, srd, status, speedRampData::step_delay, T1_FREQ_148, and TRUE. Referenced by main().
|
|
Global status flags.
Definition at line 91 of file speed_cntr.h. Referenced by main(), speed_cntr_Move(), speed_cntr_TIMER1_COMPA_interrupt(), and UART_RX_interrupt(). |