OE - Pi
1.1
|
SmartDrive: this class provides motor control functions. More...
Public Member Functions | |
def | __init__ |
Initialize the class with the i2c address of your SmartDrive. More... | |
def | command |
Writes a specified command on the command register of the SmartDrive. More... | |
def | GetBattVoltage |
Reads the battery voltage. More... | |
def | ReadTachometerPosition |
Function not supported. More... | |
def | SmartDrive_Run_Unlimited |
Turns the specified motor(s) forever. More... | |
def | SmartDrive_Stop |
Stops the specified motor(s) More... | |
def | SmartDrive_Run_Seconds |
Turns the specified motor(s) for a given amount of seconds. More... | |
def | SmartDrive_WaitUntilTimeDone |
Waits until the specified time for the motor(s) to run is completed. More... | |
def | SmartDrive_IsTimeDone |
Checks to ensure the specified time for the motor(s) to run is completed. More... | |
def | SmartDrive_Run_Degrees |
Turns the specified motor(s) for given relative tacheometer count. More... | |
def | SmartDrive_Run_Rotations |
Turns the specified motor(s) for given relative tacheometer count. More... | |
def | SmartDrive_Run_Tacho |
Turns the specified motor(s) for given absolute tacheometer count. More... | |
def | SmartDrive_WaitUntilTachoDone |
Waits until the specified tacheomter count for the motor(s) to run is reached. More... | |
def | SmartDrive_IsTachoDone |
Checks to ensure the specified tacheomter count for the motor(s) to run is reached. More... | |
def | SetPerformanceParameters |
Writes user specified values to the PID control registers. More... | |
def | ReadPerformanceParameters |
Reads the values of the PID control registers. More... | |
Public Member Functions inherited from OpenElectrons_i2c.OpenElectrons_i2c | |
def | __init__ |
Initialize the class with the i2c address of your device. More... | |
def | errMsg |
Prints an error message if a read error is detected. More... | |
def | writeByte |
Write a byte to your i2c device at a given location. More... | |
def | readByte |
Read an unsigned byte from your i2c device at a given location. More... | |
def | simpleWriteByte |
Write a byte to your i2c device at a given location. More... | |
def | simpleReadByte |
Read an unsigned byte from your i2c device at a given location. More... | |
def | readByteSigned |
Read a signed byte from your i2c device at a given location. More... | |
def | readArray |
Read a byte array from your i2c device starting at a given location. More... | |
def | writeArray |
Write a byte array from your i2c device starting at a given location. More... | |
def | readString |
Read a string from your i2c device starting at a given location. More... | |
def | readIntegerBE |
Read an unsigned 16 bit integer from your i2c device from a given location. More... | |
def | readInteger |
Read an unsigned 16 bit integer from your i2c device from a given location. More... | |
def | readIntegerSignedBE |
Read a signed 16 bit integer from your i2c device from a given location. More... | |
def | readIntegerSigned |
Read a signed 16 bit integer from your i2c device from a given location. More... | |
def | readLongBE |
Read an unsigned 32bit integer from your i2c device from a given location. More... | |
def | readLong |
Read an unsigned 32bit integer from your i2c device from a given location. More... | |
def | readLongSignedBE |
Read a signed 32bit integer from your i2c device from a given location. More... | |
def | readLongSigned |
Read a signed 32bit integer from your i2c device from a given location. More... | |
def | GetFirmwareVersion |
Read the firmware version of the i2c device. More... | |
def | GetVendorName |
Read the vendor name of the i2c device. More... | |
def | GetDeviceId |
Read the i2c device id. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from OpenElectrons_i2c.OpenElectrons_i2c | |
def | pi_rev |
def | which_bus |
Public Attributes inherited from OpenElectrons_i2c.OpenElectrons_i2c | |
address | |
bus | |
SmartDrive: this class provides motor control functions.
def SmartDrive.SmartDrive.__init__ | ( | self, | |
SmartDrive_address = SmartDrive_ADDRESS |
|||
) |
Initialize the class with the i2c address of your SmartDrive.
self | The object pointer. |
SmartDrive_address | Address of your SmartDrive. |
def SmartDrive.SmartDrive.command | ( | self, | |
cmd | |||
) |
Writes a specified command on the command register of the SmartDrive.
self | The object pointer. |
cmd | The command you wish the SmartDrive to execute. |
def SmartDrive.SmartDrive.GetBattVoltage | ( | self | ) |
Reads the battery voltage.
Multiplier constant not yet verified
self | The object pointer. |
def SmartDrive.SmartDrive.ReadPerformanceParameters | ( | self | ) |
Reads the values of the PID control registers.
self | The object pointer. |
def SmartDrive.SmartDrive.ReadTachometerPosition | ( | self, | |
motor_number | |||
) |
Function not supported.
May support function in the future. def GetMotorCurrent(self, motor_number): try: Reads the tacheometer position of the specified motor
self | The object pointer. |
motor_number | Number of the motor you wish to read. |
def SmartDrive.SmartDrive.SetPerformanceParameters | ( | self, | |
Kp_tacho, | |||
Ki_tacho, | |||
Kd_tacho, | |||
Kp_speed, | |||
Ki_speed, | |||
Kd_speed, | |||
passcount, | |||
tolerance | |||
) |
Writes user specified values to the PID control registers.
self | The object pointer. |
Kp_tacho | Proportional-gain of the tacheometer position of the motor. |
Ki_tacho | Integral-gain of the tacheometer position of the motor. |
Kd_tacho | Derivative-gain of the tacheometer position of the motor. |
Kp_speed | Proportional-gain of the speed of the motor. |
Ki_speed | Integral-gain of the speed of the motor. |
Kd_speed | Derivative-gain of the speed of the motor. |
def SmartDrive.SmartDrive.SmartDrive_IsTachoDone | ( | self, | |
motor_number | |||
) |
Checks to ensure the specified tacheomter count for the motor(s) to run is reached.
self | The object pointer. |
motor_number | Number of the motor(s) to check. |
def SmartDrive.SmartDrive.SmartDrive_IsTimeDone | ( | self, | |
motor_number | |||
) |
Checks to ensure the specified time for the motor(s) to run is completed.
self | The object pointer. |
motor_number | Number of the motor(s) to check. |
def SmartDrive.SmartDrive.SmartDrive_Run_Degrees | ( | self, | |
motor_number, | |||
direction, | |||
speed, | |||
degrees, | |||
wait_for_completion, | |||
next_action | |||
) |
Turns the specified motor(s) for given relative tacheometer count.
self | The object pointer. |
motor_number | Number of the motor(s) you wish to turn. |
direction | The direction you wish to turn the motor(s). |
speed | The speed at which you wish to turn the motor(s). |
degrees | The relative tacheometer count you wish to turn the motor(s). |
wait_for_completion | Tells the program when to handle the next line of code. |
next_action | How you wish to stop the motor(s). |
def SmartDrive.SmartDrive.SmartDrive_Run_Rotations | ( | self, | |
motor_number, | |||
direction, | |||
speed, | |||
rotations, | |||
wait_for_completion, | |||
next_action | |||
) |
Turns the specified motor(s) for given relative tacheometer count.
self | The object pointer. |
motor_number | Number of the motor(s) you wish to turn. |
direction | The direction you wish to turn the motor(s). |
speed | The speed at which you wish to turn the motor(s). |
rotations | The relative amount of rotations you wish to turn the motor(s). |
wait_for_completion | Tells the program when to handle the next line of code. |
next_action | How you wish to stop the motor(s). |
def SmartDrive.SmartDrive.SmartDrive_Run_Seconds | ( | self, | |
motor_number, | |||
direction, | |||
speed, | |||
duration, | |||
wait_for_completion, | |||
next_action | |||
) |
Turns the specified motor(s) for a given amount of seconds.
self | The object pointer. |
motor_number | Number of the motor(s) you wish to turn. |
direction | The direction you wish to turn the motor(s). |
speed | The speed at which you wish to turn the motor(s). |
duration | The time in seconds you wish to turn the motor(s). |
wait_for_completion | Tells the program when to handle the next line of code. |
next_action | How you wish to stop the motor(s). |
def SmartDrive.SmartDrive.SmartDrive_Run_Tacho | ( | self, | |
motor_number, | |||
speed, | |||
tacho_count, | |||
wait_for_completion, | |||
next_action | |||
) |
Turns the specified motor(s) for given absolute tacheometer count.
self | The object pointer. |
motor_number | Number of the motor(s) you wish to turn. |
direction | The direction you wish to turn the motor(s). |
speed | The speed at which you wish to turn the motor(s). |
tacho_count | The absolute tacheometer count you wish to turn the motor(s). |
wait_for_completion | Tells the program when to handle the next line of code. |
next_action | How you wish to stop the motor(s). |
def SmartDrive.SmartDrive.SmartDrive_Run_Unlimited | ( | self, | |
motor_number, | |||
direction, | |||
speed | |||
) |
Turns the specified motor(s) forever.
self | The object pointer. |
motor_number | Number of the motor(s) you wish to turn. |
direction | The direction you wish to turn the motor(s). |
speed | The speed at which you wish to turn the motor(s). |
def SmartDrive.SmartDrive.SmartDrive_Stop | ( | self, | |
motor_number, | |||
next_action | |||
) |
Stops the specified motor(s)
self | The object pointer. |
motor_number | Number of the motor(s) you wish to turn. |
next_action | How you wish to stop the motor(s). |
def SmartDrive.SmartDrive.SmartDrive_WaitUntilTachoDone | ( | self, | |
motor_number | |||
) |
Waits until the specified tacheomter count for the motor(s) to run is reached.
self | The object pointer. |
motor_number | Number of the motor(s) to wait for. |
def SmartDrive.SmartDrive.SmartDrive_WaitUntilTimeDone | ( | self, | |
motor_number | |||
) |
Waits until the specified time for the motor(s) to run is completed.
self | The object pointer. |
motor_number | Number of the motor(s) to wait for. |