@author: JM, ED ''' if __name__ == '__main__': pass import PyTrinamic from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM1630.TMCM_1630 import TMCM_1630 PyTrinamic.showInfo() " please select your CAN adapter " #connectionManager = ConnectionManager("--interface pcan_tmcl") connectionManager = ConnectionManager("--interface kvaser_tmcl") myInterface = connectionManager.connect() module = TMCM_1630(myInterface) """ Define motor configuration for the TMCM-1630. The configuration is based on our standard BLDC motor (QBL4208-61-04-013-1024-AT). If you use a different motor be sure you have the right configuration setup otherwise the script may not work. """ " motor configuration " module.setMotorPoles(8) module.setMaxTorque(2000) module.showMotorConfiguration()
''' Created on 24.06.2019 @author: ED ''' if __name__ == '__main__': pass import time import PyTrinamic from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM1670.TMCM_1670 import TMCM_1670 PyTrinamic.showInfo() connectionManager = ConnectionManager("--interface pcan_tmcl") #This setting is configurated for PCAN , if you want to use another Connection please change this line myInterface = connectionManager.connect() module = TMCM_1670(myInterface) """ Define all motor configurations for the the TMCM-1670. The configuration is based on our standard BLDC motor (QBL4208-61-04-013-1024-AT). If you use a different motor be sure you have the right configuration setup otherwise the script may not working. """ # motor configuration module.setMaxTorque(2000) module.showMotorConfiguration()
@author: JM ''' if __name__ == '__main__': pass import time from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.evalboards.TMC4671_eval import TMC4671_eval from PyTrinamic.evalboards.TMC6100_eval import TMC6100_eval from PyTrinamic.ic.TMC4671.TMC4671 import TMC4671 as TMC4671_IC from PyTrinamic.ic.TMC6100.TMC6100 import TMC6100 as TMC6100_IC from PyTrinamic.connections.uart_ic_interface import uart_ic_interface connectionManager = ConnectionManager() myInterface = connectionManager.connect() if isinstance(myInterface, uart_ic_interface): # Create an TMC4671 IC class which communicates directly over UART TMC4671 = TMC4671_IC(myInterface) else: # Create an TMC4671-Eval class which communicates over the Landungsbruecke via TMCL TMC4671 = TMC4671_eval(myInterface) if isinstance(myInterface, uart_ic_interface): # Create an TMC4671 IC class which communicates directly over UART TMC6100 = TMC6100_IC(myInterface) else: # Create an TMC4671-Eval class which communicates over the Landungsbruecke via TMCL TMC6100 = TMC6100_eval(myInterface)
''' Created on 17.04.2020 @author: ed ''' if __name__ == '__main__': pass from PyTrinamic.connections.ConnectionManager import ConnectionManager from modules.TMC4671_TMC6100_TOSV_REF import TMC4671_TMC6100_TOSV_REF import time connectionManager = ConnectionManager( "--interface serial_tmcl --port COM4 --data-rate 115200".split()) myInterface = connectionManager.connect() module = TMC4671_TMC6100_TOSV_REF(myInterface) " motor configuration " module.setAxisParameter(module.APs.MaxCurrent, 2000) module.showMotorConfiguration() " hall sensor configuration" module.showHallConfiguration() " PI controller configuration " module.setAxisParameter(module.APs.PressureP, 500) module.setAxisParameter(module.APs.PressureI, 1000) module.showPIConfiguration()
if __name__ == '__main__': pass import time from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM3110.TMCM_3110 import TMCM_3110 DEFAULT_MOTOR = 0 # Axis: [0;2] """ Choose the right bustype before starting the script. If no connection type is given the default connection type for this script is usb_tmcl. For further details look in our ConnectionManager and the connection interfaces. """ connectionManager = ConnectionManager(" --interface kvaser_CANopen", connectionType="CANopen") network = connectionManager.connect() node = network.addDs402Node(TMCM_3110.getEdsFile(), 1, TMCM_3110.MOTORS) module = node objMicrostepResoultion = [] objMaximumCurrent = [] objSwitchParameters = [] objModesOfOperation = [] objActualPositions = [] objTargetPositions = [] objAccelerations = [] objActualVelocities = [] objDesiredVelocities = []
@author: JM, ED ''' if __name__ == '__main__': pass import PyTrinamic, time from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM1617.TMCM_1617 import TMCM_1617 PyTrinamic.showInfo() " please select your CAN adapter " #myInterface = ConnectionManager("--interface pcan_tmcl").connect() myInterface = ConnectionManager("--interface kvaser_tmcl").connect() module = TMCM_1617(myInterface) module.showModuleInfo() motor = module.motor(0) """ Define motor configuration for the TMCM-1617. The configuration is based on our standard BLDC motor (QBL4208-61-04-013-1024-AT). If you use a different motor be sure you have the right configuration setup otherwise the script may not work. """ " motor configuration " motor.setMotorType(motor.ENUM.MOTOR_TYPE_THREE_PHASE_BLDC) motor.setMotorPolePairs(4) motor.setMaxTorque(2000)
def from_args(args=None): return ConnectionManager.from_args(ConnectionManagerMP, args)
''' Created on 06.05.2020 @author: ED ''' if __name__ == '__main__': pass import time import PyTrinamic from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM1633.TMCM_1633 import TMCM_1633 PyTrinamic.showInfo() connectionManager = ConnectionManager( "--interface kvaser_tmcl") # You can select any CAN TMCL interface here myInterface = connectionManager.connect() module = TMCM_1633(myInterface) """ Define all motor configurations for the TMCM-1633. The configuration is based on our standard BLDC motor (QBL4208-61-04-013-1024-AT). If you use a different motor be sure you have the right configuration setup otherwise the script may not working. """ # motor configuration module.setMotorPoles(8) module.setMaxTorque(4000) module.showMotorConfiguration()
8: "TMC2209", 9: "TMCC160", 10: "TMC6200", 11: "TMC2160", 12: "TMC7300", 13: "TMC2590", 18: "TMC2225", 19: "TMC6100", 14: "TMC2300", 21: "TMC6300", 22: "TMC2226", } if __name__ == "__main__": from PyTrinamic.connections.ConnectionManager import ConnectionManager cm = ConnectionManager() interface = cm.connect() LB = Landungsbruecke(interface) print("ID EEPROM content:") print("Mc: ", LB.EepromDrv.read_id_info()) print("Drv:", LB.EepromMc.read_id_info()) print("Board IDs:") print(LB.getBoardIDs()) print("Board Names:") print(LB.getBoardNames())
''' Created on 30.12.2018 @author: ED ''' if __name__ == '__main__': pass import PyTrinamic, time from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM1640.TMCM_1640 import TMCM_1640 PyTrinamic.showInfo() myInterface = ConnectionManager().connect() module = TMCM_1640(myInterface) module.showModuleInfo() motor = module.motor(0) """ Define motor configuration for the TMCM-1640. The configuration is based on our standard BLDC motor (QBL4208-61-04-013-1024-AT). If you use a different motor be sure you have the right configuration setup otherwise the script may not work. """ " motor configuration " motor.setMotorPolePairs(4) motor.setMaxTorque(2000) motor.showConfiguration()
''' Move a motor back and forth using the TMCM1370 module Created on 08.07.2020 @author: JM ''' import PyTrinamic from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM1370.TMCM_1370 import TMCM_1370 import time PyTrinamic.showInfo() connectionManager = ConnectionManager("--interface serial_tmcl") myInterface = connectionManager.connect() Module_1370 = TMCM_1370(myInterface) DEFAULT_MOTOR = 0 print("Preparing parameters") Module_1370.setMaxAcceleration(10000) print("Rotating") Module_1370.rotate(50000) time.sleep(2); print("Stopping") Module_1370.stop()
''' Move a motor back and forth using the TMCM6212 module Created on 28.02.2019 @author: JM ''' import PyTrinamic from PyTrinamic.connections.ConnectionManager import ConnectionManager from PyTrinamic.modules.TMCM6212.TMCM_6212 import TMCM_6212 import time PyTrinamic.showInfo() connectionManager = ConnectionManager( ) # If no Interface is selected , the default interface is usb_tmcl myInterface = connectionManager.connect() Module_6212 = TMCM_6212(myInterface) DEFAULT_MOTOR = 0 print("Preparing parameters") Module_6212.setMaxAcceleration(9000) print("Rotating") Module_6212.rotate(40000) time.sleep(5) print("Stopping") Module_6212.stop()