Skip to content

Commit

Permalink
Final changes before releasing v1.6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-giguere committed Sep 27, 2019
1 parent 2353263 commit 2ac644a
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 29 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ To set up the MachineMotion Python Library on your computer, follow the steps be

- Download the version of the library that you require on [GitHub](https://github.com/VentionCo/mm-python-api/releases)


- Controllers with software v1.2.11 and earlier are compatible with the Python API v1.6.8 and earlier
- Controllers with software v1.12.0+ are compatible with the Python API v2.0+

- Install Python on your computer. The MachineMotion library supports both Python 2.7 and Python 3.6.

- If installing on Windows, make sure to add Python.exe to the PATH environment variable as shown in *Figure 2* and *Figure 3*.
Expand Down
24 changes: 12 additions & 12 deletions __documentation/api/machine_motion_python_api--v1.6.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ sys.exit(0)
```

---
### emitCombinedAbsoluteMove(axes, positions)
### emitCombinedAxesAbsoluteMove(axes, positions)

> Send an absolute move command to the MachineMotion controller. Moves multiple axis simultaneously.
Expand All @@ -614,7 +614,7 @@ sys.exit(0)
> none
#### Reference Example
> example--emitCombinedAbsoluteMove.py
> example--emitCombinedAxesAbsoluteMove.py
```python
from _MachineMotion_1_6_8 import *
Expand All @@ -641,11 +641,11 @@ mm.emitAcceleration(1000)
print ("Application Message: Acceleration configured \n")

# Homing axis 1
mm.emitHome(1)
print ("Application Message: Axis 1 is at home \n")
mm.emitHomeAll()
print ("Application Message: Axes at home \n")

# Move the axis 1 to position 100 mm
mm.emitCombinedAbsoluteMove([1, 2, 3], [100, 200, 100])
mm.emitCombinedAxesAbsoluteMove([1, 2, 3], [50, 100, 50])
print ("Application Message: Motion on-going ... \n")

mm.waitForMotionCompletion()
Expand Down Expand Up @@ -699,13 +699,13 @@ print ("Application Message: Speed configured \n")
mm.emitAcceleration(1000)
print ("Application Message: Acceleration configured \n")

# Homing axis 1
mm.emitHome(1)
print ("Application Message: Axis 1 at home \n")
# Homing all axes
mm.emitHomeAll()
print ("Application Message: Axes at home \n")

# Move the axis one to position 100 mm
mm.emitRelativeMove(1, "positive", 100)
print ("Application Message: Move on-going ... \n")
mm.emitCombinedAxisRelativeMove([1, 2, 3], ["positive", "positive", "positive"], [100, 200, 300])
print ("Application Message: Multi-axis move on-going ... \n")

mm.waitForMotionCompletion()
print ("Application Message: Motion completed \n")
Expand All @@ -716,7 +716,7 @@ sys.exit(0)
```

---
### emitCombinedAxisRelativeMove(axes, directions, distances)
### emitCombinedAxesRelativeMove(axes, directions, distances)

> Send a relative move command to the MachineMotion controller. Moves multiple axis simultaneously.
Expand All @@ -733,7 +733,7 @@ sys.exit(0)
> none
#### Reference Example
> example--emitCombinedRelativeMove.py
> example--emitCombinedAxesRelativeMove.py
```python
from _MachineMotion_1_6_8 import *
Expand Down
38 changes: 35 additions & 3 deletions examples/_MachineMotion_1_6_8.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def emitAbsoluteMove(self, axis, position):
#
def emitCombinedAxesAbsoluteMove(self, axes, positions):
if (not isinstance(axes, list) or not isinstance(positions, list)):
raise TypeError("Axes and Postions must be lists")
raise TypeError("All parameters must be lists")

global motion_completed

Expand Down Expand Up @@ -580,8 +580,8 @@ def emitRelativeMove(self, axis, direction, distance):
# @status
#
def emitCombinedAxisRelativeMove(self, axes, directions, distances):
if (not isinstance(axes, list) or not isinstance(directions, list) or isinstance(distances, list)):
raise TypeError("Axes and Postions must be lists")
if (not isinstance(axes, list) or not isinstance(directions, list) or not isinstance(distances, list)):
raise TypeError("All parameters must be lists")

global motion_completed

Expand Down Expand Up @@ -691,6 +691,38 @@ def configAxis(self, axis, _u_step, _mech_gain):
else:
pass
# print "Argument error, {configAxis(self, axis, u_step, mech_gain)}, {u_step} argument is invalid"

#
# Function to reverse the positive direction of an axis, also reverse the home and end-of-travel sensor port
# @param axis --- Description: Axis on which the setting applies --- Type: string or number.
# @param data --- Description: normal or reverse axis direction --- Type: dictionary.
# @status
#
def emitSetAxisDirection(self, axis, direction):

# Checking input parameters
if (direction != "normal" and direction != "reverse"):
raise ValueError('direction parameter must be either "normal" or "reversed"')

if (axis != 1 and axis != 2 and axis !=3):
raise ValueError('axis must either be 1, 2 or 3')

if(axis == 1):
if(direction == "normal"):
self.myGCode.__emit__("M92 " + self.myGCode.__getTrueAxis__(axis) + str(self.myAxis1_steps_mm))
elif (direction == "reverse"):
self.myGCode.__emit__("M92 " + self.myGCode.__getTrueAxis__(axis) + "-" + str(self.myAxis1_steps_mm))
elif(axis == 2):
if(direction == "normal"):
self.myGCode.__emit__("M92 " + self.myGCode.__getTrueAxis__(axis) + str(self.myAxis2_steps_mm))
elif (direction == "reverse"):
self.myGCode.__emit__("M92 " + self.myGCode.__getTrueAxis__(axis) + "-" + str(self.myAxis2_steps_mm))
elif(axis == 3):
if(direction == "normal"):
self.myGCode.__emit__("M92 " + self.myGCode.__getTrueAxis__(axis) + str(self.myAxis3_steps_mm))
elif (direction == "reverse"):
self.myGCode.__emit__("M92 " + self.myGCode.__getTrueAxis__(axis) + "-" + str(self.myAxis3_steps_mm))

#
# Function to save/persist data in the MachineMotion Controller (key - data pair)
# @param key --- Description: key is a string that identifies the data to save for future retrieval. --- Type: string or number.
Expand Down
Binary file added examples/_MachineMotion_1_6_8.pyc
Binary file not shown.
12 changes: 12 additions & 0 deletions examples/example--emitAbsoluteMove.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ def debug(data):
mm.waitForMotionCompletion()
print ("Application Message: Motion completed \n")

mm.setAxisDirection(1, "reverse")
print ("Application Message: Axis 1 direction reverse \n")

# Homing axis 1
mm.emitHome(1)
print ("Application Message: Axis 1 is at home \n")

# Move the axis 1 to position 100 mm
mm.emitAbsoluteMove(1, 100)
print ("Application Message: Motion on-going ... \n")


print ("Application Message: Program terminating ... \n")
time.sleep(1)
sys.exit(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Author: Francois Giguere
## Version: 1.6.8
## Email: info@vention.cc
## Status: ready to test
## Status: tested
##################################################

from _MachineMotion_1_6_8 import *
Expand All @@ -31,11 +31,11 @@ def debug(data):
print ("Application Message: Acceleration configured \n")

# Homing axis 1
mm.emitHome(1)
print ("Application Message: Axis 1 is at home \n")
mm.emitHomeAll()
print ("Application Message: Axes at home \n")

# Move the axis 1 to position 100 mm
mm.emitCombinedAbsoluteMove([1, 2, 3], [100, 200, 100])
mm.emitCombinedAxesAbsoluteMove([1, 2, 3], [50, 100, 50])
print ("Application Message: Motion on-going ... \n")

mm.waitForMotionCompletion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Author: Francois Giguere
## Version: 1.6.8
## Email: info@vention.cc
## Status: ready to test
## Status: tested
##################################################

from _MachineMotion_1_6_8 import *
Expand All @@ -30,12 +30,12 @@ def debug(data):
mm.emitAcceleration(1000)
print ("Application Message: Acceleration configured \n")

# Homing axis 1
mm.emitHome(1)
print ("Application Message: Axis 1 at home \n")
# Homing all axes
mm.emitHomeAll()
print ("Application Message: Axes at home \n")

# Move the axis one to position 100 mm
mm.emitCombinedRelativeMove([1,2,3], ["positive","positive","positive"], [100, 200, 300])
mm.emitCombinedAxisRelativeMove([1, 2, 3], ["positive", "positive", "positive"], [100, 200, 300])
print ("Application Message: Multi-axis move on-going ... \n")

mm.waitForMotionCompletion()
Expand Down
63 changes: 63 additions & 0 deletions examples/example--emitSetAxisDirection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
##################################################
## Axis Direction
##################################################
## Author: Francois Giguere
## Version: 1.6.8
## Email: info@vention.cc
## Status: tested
##################################################

from _MachineMotion_1_6_8 import *

# Define a callback to process controller gCode responses if desired. This is mostly used for debugging purposes.
def debug(data):
pass

print ("Application Message: MachineMotion Program Starting \n")

mm = MachineMotion(debug, DEFAULT_IP_ADDRESS.usb_windows)
print ("Application Message: MachineMotion Controller Connected \n")

# Configure the axis number 1, 8 uSteps and 150 mm / turn for a timing belt
mm.configAxis(1, MICRO_STEPS.ustep_8, MECH_GAIN.timing_belt_150mm_turn)
print ("Application Message: MachineMotion Axis 1 Configured \n")

# Configuring the travel speed to 10000 mm / min
mm.emitSpeed(10000)
print ("Application Message: Speed configured \n")

# Configuring the travel speed to 1000 mm / second^2
mm.emitAcceleration(1000)
print ("Application Message: Acceleration configured \n")

# Homing axis 1
mm.emitHome(1)
print ("Application Message: Axis 1 is at home \n")

# Move the axis 1 to position 100 mm
mm.emitAbsoluteMove(1, 100)
print ("Application Message: Motion on-going ... \n")

mm.waitForMotionCompletion()
print ("Application Message: Motion completed \n")


mm.emitSetAxisDirection(1, "reverse")
print ("Application Message: Axis direction set for axis 1 \n")

# Homing axis 1
mm.emitHome(1)
print ("Application Message: Axis 1 is at home \n")

# Move the axis 1 to position 100 mm
mm.emitAbsoluteMove(1, 100)
print ("Application Message: Motion on-going ... \n")

mm.waitForMotionCompletion()
print ("Application Message: Motion completed \n")

print ("Application Message: Program terminating ... \n")
time.sleep(1)
sys.exit(0)


2 changes: 1 addition & 1 deletion examples/example--saveData_getData.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Author: Francois Giguere
## Version: 1.6.8
## Email: info@vention.cc
## Status: released
## Status: tested
##################################################

from _MachineMotion_1_6_8 import *
Expand Down
4 changes: 2 additions & 2 deletions examples/example--setPosition.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Author: Francois Giguere
## Version: 1.6.8
## Email: info@vention.cc
## Status: rdy for test
## Status: tested
##################################################

from _MachineMotion_1_6_8 import *
Expand All @@ -26,7 +26,7 @@ def debug(data):
mm.setPosition(1, 100)
print ("Application Message: Position set to 100 mm on axis 1\n")

mm.moveRelative(1, "negative", 50)
mm.emitRelativeMove(1, "negative", 50)
print ("Application Message: Moving in the negative direction ... \n")

mm.waitForMotionCompletion()
Expand Down
5 changes: 3 additions & 2 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Version 1.6.8

Date: September 24<sup>th</sup>, 2019
- Date: September 27<sup>th</sup>, 2019
- Released by: Francois Giguere

## Compatibility

### Interface Changes
- No Interface changes in this release

#### Obsoleted Interfaces
- none

#### New Interfaces
- setPosition
- setAxisDirection
- emitCombinedAxisRelativeMove
- emitCombinedAxesAbsoluteMove

Expand Down

0 comments on commit 2ac644a

Please sign in to comment.