This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
subdevices [2023/12/06 11:00] – [Stepper Motor] ursgraf | subdevices [2023/12/19 12:57] – [DAC] ursgraf | ||
---|---|---|---|
Line 34: | Line 34: | ||
|0x28|4|value_1|r|no|channel 1: digitized input value| | |0x28|4|value_1|r|no|channel 1: digitized input value| | ||
|..|4|..|r/ | |..|4|..|r/ | ||
- | The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses a pin on the FPGA device for each channel. | + | The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses 3 to 4 pins for the SPI depending |
==== Subtypes ==== | ==== Subtypes ==== | ||
Currently there are three subtypes of this subdevice. The subtype information can be found in the '' | Currently there are three subtypes of this subdevice. The subtype information can be found in the '' | ||
Line 49: | Line 49: | ||
|0x28|4|value_1|r/ | |0x28|4|value_1|r/ | ||
|..|4|..|r/ | |..|4|..|r/ | ||
- | The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses a pin on the FPGA device for each channel. | + | The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses 5 pins. |
==== Subtypes ==== | ==== Subtypes ==== | ||
Currently there is one subtype of this subdevice. The subtype information can be found in the '' | Currently there is one subtype of this subdevice. The subtype information can be found in the '' | ||
Line 308: | Line 308: | ||
===== Stepper Motor ===== | ===== Stepper Motor ===== | ||
- | Used to control stepper motors | + | Used to control stepper motors. You can set several configuration parameters |
- | Changes in direction, step type, phase mode and start speed are only taken into account | + | Changes in direction, step type, phase mode and start speed are only taking place when the motor is stopped. |
+ | Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because prescalers | ||
- | Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because prescalers | + | ==== Modes of Operation ==== |
+ | === Step Mode === | ||
+ | The motor moves through the specified number of steps. It uses a ramp to accelerate up and down. Changes in the configuration, | ||
+ | |||
+ | === Speed Mode === | ||
+ | The motor ramps up to a preset speed. When the stop command is issued, the speed ramps down to a standstill. Changes | ||
+ | |||
+ | === Free Running === | ||
+ | The motor is freewheeling. This means that the windings are not magnetized and the motor has no holding torque. | ||
+ | |||
+ | === General Remarks === | ||
+ | It is not recommended to change from step mode to fix speed mode. It is better to stop the engine first and then change the mode. However, when changing from one of these two modes to free running mode, the motor will simply come to a stop without any braking effect (all windings will be non-magnetized). When resetting the module, the motor keeps the current step (the windings | ||
+ | |||
+ | ==== Configuration ==== | ||
+ | Setting the bit 0 in the configuration register | ||
^Offset^Size [byte] ^Name^r/ | ^Offset^Size [byte] ^Name^r/ | ||
Line 331: | Line 346: | ||
|0xll+4|4|top_1|r/ | |0xll+4|4|top_1|r/ | ||
|..|4|..|r/ | |..|4|..|r/ | ||
- | |0xnn|4|acc_0|r/ | + | |0xnn|4|acc_0|r/ |
- | |0xnn+4|4|acc_1|r/ | + | |0xnn+4|4|acc_1|r/ |
|..|4|..|r/ | |..|4|..|r/ | ||
- | |0xoo|4|stepps_todo_0|r/ | + | |0xoo|4|dest_steps_0|r/ |
- | |0xoo+4|4|stepps_todo_1|r/ | + | |0xoo+4|4|dest_steps_1|r/ |
|..|4|..|r/ | |..|4|..|r/ | ||
- | |0xpp|4|stepps_done_0|r|no|motor 0: number of steps have done| | + | |0xpp|4|curr_steps_0|r|no|motor 0: current position (number of steps)| |
- | |0xpp+4|4|stepps_done_1|r|no|motor 1: number of steps have done| | + | |0xpp+4|4|curr_steps_1|r|no|motor 1: current position (number of steps)| |
|..|4|..|r|no|..| | |..|4|..|r|no|..| | ||
=== Motor Configuration Register === | === Motor Configuration Register === | ||
| 31 | ... | 06 | 05 | 04..03 | 02 | 01 | 00 | | | 31 | ... | 06 | 05 | 04..03 | 02 | 01 | 00 | | ||
- | | | | Reset Stepcounter | + | | | | Reset Step Counter |
- | + | ||
- | __Direction: | + | |
- | __Full Step:__ 1 => full steps; 0=> half steps\\ | + | |
- | __Two Phase:__ 1 => two phase operation; 0=> one phase operation. Is only required in full step mode.\\ | + | |
- | __Run Mode:__ 00 => no holding torque; 01 => stepping mode; 10 => fixed speed; 11 => reserved\\ | + | |
- | __Start:__ if set to 1 the motor will start until stopped by a 0 or the number of steps is reached (only in stepping mode)\\ | + | |
- | __Reset Stepcounter: | + | |
- | + | ||
- | === Mode Description === | + | |
- | __Gererell: | + | |
- | *It is not recommended to change from STEP MODE to FIX SPEED mode. It is better to stop the engine first and then change the mode. | + | |
- | *However, when changing from one of these two modes to DISABELD mode, the motor will simply coast to a stop without any braking effect (all windings will be non-magnetized). | + | |
- | *When resetting the modules, the motor keeps the current step (The windings are still magnetized). | + | |
- | *Attention: The acceleration is divided by two within the module. Since the motor accelerates with each trigger edge. Therefore the LSB is not considered by the acceleration. | + | |
- | *An interrupt is triggered when the motor has completed the shutdown and changes normally to the stop state. | + | |
- | __DISABELD (RESERVED):__ | + | * Direction: 1 => CW; 0=> CCW |
- | *The motor is freewheeling here. This means that the motor has no holding torque | + | * Full Step: 1 => full step; 0=> half step |
+ | * Two Phase: 1 => two phase operation, 0 => one phase operation. Only required in full step mode. | ||
+ | * Run Mode: 00 => free running, | ||
+ | * Start: if set to 1 the motor will start. Writing a ' | ||
+ | * Reset Step Counter: A ' | ||
- | __STEP MODE:__ | + | The motor configuration |
- | *The motor moves through the specified number of steps. It uses a ramp to accelerate up and down. | + | |
- | *Changes in the configuration, prescaler and steps registers are only applied when the motor is at standstill. | + | |
- | *The module sends a signal | + | |
- | __FIX SPEED:__ | + | === Prescaler === |
- | *The motor ramps up to a preset speed. | + | When a motor is started |
- | *Changes in acceleration and starting | + | The acceleration is calculated by the base clock of the submodule divided by 2 times the prescaler value. The acceleration |
=== Interrupt === | === Interrupt === | ||
- | An interrupt is always triggered | + | An interrupt is asserted |
=== Output Signals === | === Output Signals === | ||
- | This subdevice uses 4 pins on the FPGA. They are called A, | + | This subdevice uses 4 pins per channel |
- | **Unipolar: | + | **Unipolar: |
- | **Bipolar: | + | **Bipolar: |
===== Interrupt Multiplexer ===== | ===== Interrupt Multiplexer ===== | ||
Line 384: | Line 385: | ||
^Offset^Size [byte] ^Name^r/ | ^Offset^Size [byte] ^Name^r/ | ||
- | |0x20|4|irq_line_0|r/ | + | |0x20|4|irq_line_0|r/ |
- | |0x24|4|irq_line_1|r/ | + | |0x24|4|irq_line_1|r/ |
|..|4|..|r/ | |..|4|..|r/ | ||
Line 395: | Line 396: | ||
1 => first signal (LSB) of the input vector.\\ | 1 => first signal (LSB) of the input vector.\\ | ||
2 => second signal of the input vector.\\ | 2 => second signal of the input vector.\\ | ||
- | ... (and so on) | + | ... |