Skip to content

Commit

Permalink
Version 0.99
Browse files Browse the repository at this point in the history
  • Loading branch information
yet-another-fuzzi committed Feb 10, 2022
1 parent cf46d11 commit c7bfc96
Show file tree
Hide file tree
Showing 20 changed files with 42,143 additions and 47 deletions.
379 changes: 341 additions & 38 deletions Hardware/Firmware/src/ftPwrDriveFW.ino

Large diffs are not rendered by default.

9,431 changes: 9,431 additions & 0 deletions RoboPro Library/TX Library/examples/TX_M1_1000_Steps.rpp

Large diffs are not rendered by default.

32,327 changes: 32,327 additions & 0 deletions RoboPro Library/TX Library/ftPwrDriveTX.rpp

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file modified ftDuino Library/ftPwrDrive.zip
Binary file not shown.
30 changes: 27 additions & 3 deletions ftDuino Library/src/ftPwrDrive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//
// ftPwrDrive Arduino Interface
//
// 31.12.2019 V0.94 / latest version
// 01.01.2022 V0.98 / latest version
//
// (C) 2019 Christian Bergschneider & Stefan Fuss
// (C) 2022 Christian Bergschneider & Stefan Fuss
//
// PLEASE USE AT LEAST FIRMWARE 0.94 !!!
// PLEASE USE AT LEAST FIRMWARE 0.98 !!!
//
///////////////////////////////////////////////////

Expand Down Expand Up @@ -59,6 +59,11 @@
#define CMD_STOPMOVING 33 // void stopMoving( uint8_t motor ) stop motor moving
#define CMD_STOPMOVINGALL 34 // void stopMovingAll( uint8_t maskMotor ) same as StartMoving, but using uint8_t masks

#define CMD_SETINSYNC 35 // void setInSync( unit8_t motor1, uint8_t motor2, boolean OnOff) set two motors running in sync

#define CMD_HOMINGOFFSET 36 // void homingOffset( unit8_t motor1, ulong offset ) set offset to run during homing, after endstop is free again


i2cBuffer i2c;

ftPwrDrive::ftPwrDrive( uint8_t myI2CAddress ) {
Expand Down Expand Up @@ -87,6 +92,14 @@ void ftPwrDrive::setRelDistance( uint8_t motor, long distance ) {
i2c.sendData( i2cAddress, CMD_SETRELDISTANCE, motor, distance );
}

void ftPwrDrive::setRelDistanceAll( long d1, long d2, long d3, long d4 ) {
// set a relative distance to go for all motors
setRelDistance( M1, d1 );
setRelDistance( M2, d2 );
setRelDistance( M3, d3 );
setRelDistance( M4, d4 );
}

void ftPwrDrive::setAbsDistance( uint8_t motor, long distance ) {
// set a absolute distance to go
i2c.sendData( i2cAddress, CMD_SETABSDISTANCE, motor, distance );
Expand Down Expand Up @@ -258,6 +271,11 @@ boolean ftPwrDrive::isHoming( uint8_t motor ) {
return getState( motor ) & HOMING;
}

void ftPwrDrive::homingOffset( uint8_t motor, long offset ) {
// set Offset to run in homing, after endstop is free again
i2c.sendData( i2cAddress, CMD_HOMINGOFFSET, motor, offset );
}

void ftPwrDrive::wait( uint8_t motor_mask, uint16_t interval = 100 ) {
// wait until all motors in motor_mask completed their work

Expand Down Expand Up @@ -302,6 +320,12 @@ void ftPwrDrive::setAbsDistanceR( uint8_t motor, float distance ) {

}

void ftPwrDrive::setInSync( uint8_t motor1, uint8_t motor2, boolean OnOff) {
// set two motors running in sync

i2c.sendData( i2cAddress, CMD_SETINSYNC, motor1, motor2, OnOff);
}

uint8_t ftPwrDrive::motorIndex( uint8_t motor ) {
// returns the index (0..3) of a motor
switch (motor) {
Expand Down
23 changes: 17 additions & 6 deletions ftDuino Library/src/ftPwrDrive.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//
// ftPwrDrive Arduino Interface
//
// 31.12.2019 V0.94 / latest version
// 01.01.2022 V0.98 / latest version
//
// (C) 2019 Christian Bergschneider & Stefan Fuss
// (C) 2022 Christian Bergschneider & Stefan Fuss
//
// PLEASE USE AT LEAST FIRMWARE 0.94 !!!
// PLEASE USE AT LEAST FIRMWARE 0.98 !!!
//
///////////////////////////////////////////////////

Expand Down Expand Up @@ -60,17 +60,22 @@ class ftPwrDrive {
// constructor

void Watchdog( long w );
// set wartchog timer
// set watchog timer

void setMicrostepMode( uint8_t mode );
// set microstep mode - FILLSTEP, HALFSTEP, QUARTERSTEP, EIGTHSTEP, SIXTEENTHSTEP
// set microstep mode
// FILLSTEP, HALFSTEP, QUARTERSTEP, EIGTHSTEP, SIXTEENTHSTEP

uint8_t getMicrostepMode( void );
// get microstep mode - FILLSTEP, HALFSTEP, QUARTERSTEP, EIGTHSTEP, SIXTEENTHSTEP
// get microstep mode
// FILLSTEP, HALFSTEP, QUARTERSTEP, EIGTHSTEP, SIXTEENTHSTEP

void setRelDistance( uint8_t motor, long distance );
// set a distance to go, relative to actual position

void setRelDistanceAll( long d1, long d2, long d3, long d4 );
// set a absolute distance to go for all motors

void setAbsDistance( uint8_t motor, long distance );
// set a absolute distance to go

Expand Down Expand Up @@ -174,6 +179,9 @@ class ftPwrDrive {

boolean isHoming( uint8_t motor );
// check, homing is active

void homingOffset( uint8_t motor, long offset );
// set Offset to run in homing, after endstop is free again

float setGearFactor( uint8_t motor, long gear1, long gear2 );
// Sets the gear factor. Please read setRelDistanceR for details.
Expand All @@ -196,6 +204,9 @@ class ftPwrDrive {
void setAbsDistanceR( uint8_t motor, float distance );
// Sets the absolute distance in R - real units. Please read setRelDistanceR for details.

void setInSync( uint8_t motor1, uint8_t motor2, boolean OnOff);
// set two motors running in sync

private:
uint8_t i2cAddress = 32;

Expand Down

0 comments on commit c7bfc96

Please sign in to comment.