TMCM-171 in stand allone

TMCM-171 in stand allone

Postby Theissentraining » 26 Oct 2010, 16:14

Hello,

I am goining to start a new topic:
The motor i am using is the DB87L01-S from NANOTEC

I want to use the module in stand allone mode with:
Analog input for speed on connection A1
Digital input turn right on connection O1
Digital input turn left on connection O2

I got so far:
SGP 77, 0, 1
SGP 253, 0, 8
SGP 250, 0, 12
SGP 249, 0, 0
SAP 159, 0, 0
SAP 128, 0, 1
SAP 11, 0, 0
SAP 147, 0, 1
SAP 6, 0, 500

LOOP: GIO 9, 0 // Get the state of digital input #0
JC NZ, L2 //Conditional jump to "SmallWay" if input #0 is high (not zero)
GIO 9, 1 // Get the state of digital input #1
JC NZ, L1 //Conditional jump to "SmallWay" if input #1 is high (not zero)
L1: SAP 157, 0, 50000 // set max. speed
JA END
L2: SAP 157, 0, -50000 // set max. reverse speed
JA END

END: JA LOOP //Jump to "Loop"
STOP

But I cant find a way to make the program scan for a different direction.
In other words: How can i make the program jump between L1 and L2 in the same LOOP?
Does the module understand plain c?
Like If and else statements?

With these settings the module turns hot and wil go in TEMP error. when it cools down, motor starts automaticly.

Thanks in advance
Theissentraining
User
User
 
Posts: 5
Joined: 26 Oct 2010, 14:35

Re: TMCM-171 in stand allone

Postby M.Jankowiak (TRINAMIC) » 27 Oct 2010, 09:32

Are the motor and the module connected correctly and using correct parameter (e.g. encoder steps)? Use the "Demo Software Basic Control TMCM-170" . If the motor is rotating right the position counter have to increase and decrease while left rotating.
User avatar
M.Jankowiak (TRINAMIC)
Site Admin
 
Posts: 42
Joined: 13 Nov 2008, 14:26
Location: Hamburg

Re: TMCM-171 in stand allone

Postby Theissentraining » 27 Oct 2010, 09:54

Yes everything is connected correctly.
The heating problem is fixed, i mis connected the Hall sensors.

The motor is running perfectly and is ajustable in speed.
My problem is that i am not sure witch connections that i have to make for turning the motor left and right.
For example:

When input Dir+ is high, then the motor schould turn left
When input Dir- is high, then the motor schould turn right.

The module inputs are given by the in hous develloped PCB

New question:
The GIO function, i got it here of the forum so i don't under stand it.
In the TMCL direct mode there is no function like that for the TMCM-171. but there is for the TMCM-100?????

We are Theissen Training systems.
http://www.theissentraining.de ( Belgium dep.)
We devellop military training devices.
I need this to work as soon as possible, when i do i can perform some tests and if we are satisfied, then we are talking about 100 pieces / year.
Theissentraining
User
User
 
Posts: 5
Joined: 26 Oct 2010, 14:35

Re: TMCM-171 in stand allone

Postby Olav Kahlbaum (TRINAMIC) » 28 Oct 2010, 08:42

Programming in TMCL is like programming in assembly language. So it is no problem to jumps between all the labels you are using. The GIO command is a command for reading the additional inputs of a module. Unfortunately it can't be seen in the direct mode of the TMCL-IDE for the TMCM-171. This is a mistake in the TMCL-IDE which will be fixed as soon as possible. The GIO command is defined as GIO <input>, <bank> where <input> defines the input number (it is not the pin number of the connector, as some inputs are on different connectors) and <bank> defines if aninput is to be read in digital mode or (if possible for that input) analog mode.

Using the GIO command, the inputs can be queried as follows:

GIO 0, 0 reads the DIRIN input in digital mode (pin 8 of the I/O connnector, returns 0 when low, 1 when high)
GIO 0, 1 reads the DIRIN input in analog mode (returns 0..1023).

GIO 1, 0 reads the analog input 1 in digital mode (AIN1, pin 9 of the I/O connector, returns 0 or 1).
GIO 1, 1 reads the analog input 1 (AIN1 pin 9 of the I/O connector, returns 0..1023).

GIO 2, 0 reads the analog input 2 in digital mode (AIN2, pin 6 of the I/O connector, returns 0 or 1).
GIO 2, 1 reads the analog input 2 (AIN2 pin 6 of the I/O connector, returns 0..1023).

GIO 3, 0 reads the analog input 3 in digital mode (AIN3, pin 5 of the I/O connector, returns 0 or 1).
GIO 3, 1 reads the analog input 3 (AIN3 pin 5 of the I/O connector, returns 0..1023).

The differential step and direction inputs of the step/dir connector can also be read using the GIO command, but as digital inputs only:
GIO 8, 0 reads the step input (pins 1/2 of the step/dir connector, returns 0 or 1)
GIO 9, 0 reads the direction input (pins 3/4 of the step/dir connector, returns 0 or 1)

GIO 10, 0 reads the stop input (pin 10 of the I/O connector, returns 0 or 1).

So for controlling the direction via DIRIN one could use:
Code: Select all
      SAP 128, 0, 1      //put the module into stand-alone mode (speed control automatically via AIN1)
Loop: GIO 0, 0           //get the state of the DIRIN pin
      JC NZ, Dir1        //jump to Dir1 if the DIRIN pin is high
      SAP 157, -50000    //set negative speed for stand-alone mode if DIRIN is low
      JA End
Dir1: SAP 157, 50000     //set positive speed for stand-alone mode if DIRIN is high
End:  JA Loop


This program puts the module in stand alone mode (so that the speed will be controlled automatically via the AIN1 input) and continously checks the DIRIN input, setting the maximum speed for the stand-alone mode to a positive or a negative value according to the state of the DIRIN pin. This should make it possible to control the speed via an analogue voltage on the AIN1 pin and the direction via a digital signal on the DIRIN pin.
User avatar
Olav Kahlbaum (TRINAMIC)
Site Admin
 
Posts: 3359
Joined: 11 Aug 2006, 08:02

Re: TMCM-171 in stand allone

Postby Theissentraining » 28 Oct 2010, 09:05

Ok, thanks for the info.
I got it working Yesterday evening.

This is my code:

SGP 77, 0, 1
SGP 253, 0, 8 //Nr of poles
SGP 250, 0, 12
SGP 249, 0, 0
SAP 159, 0, 0
SAP 128, 0, 1
SAP 11, 0, 0
SAP 147, 0, 1

SAP 6, 0, 40000 //Current


LOOP: GIO 2, 1 // read the input; 2 is A2 and 1 stands for pull up resistor
JC NZ, L1 //Jump Conditional if A2 is Not Zero to L1
SAP 157, 0, -100000 // set max. speed
JA END // jump Aditional to END
L1: SAP 157, 0, 100000 // set max. reverse speed
END: JA LOOP // Jump to LOOP
STOP

But now on full speed or any speed, the motor is not strong. (I can hold it with my hand)
I was looking yesterdy for some settings to improve the motor.
-I am thinking that the module is not giving it's full current power.
-The motor needs to get to full speed as soon as possible.
-And break as soon as posible.

At some point in my testing i got the motor running at 6000 rpm. Motor nominal is 3500 rpm
Is that possible with tis module? i can't seem to do that again...

Thanks in advance
Theissentraining
User
User
 
Posts: 5
Joined: 26 Oct 2010, 14:35

Re: TMCM-171 in stand allone

Postby Theissentraining » 02 Nov 2010, 09:22

Please reply?
Theissentraining
User
User
 
Posts: 5
Joined: 26 Oct 2010, 14:35

Re: TMCM-171 in stand allone

Postby M.Jankowiak (TRINAMIC) » 02 Nov 2010, 10:42

Use an 8-Bit-Value between 0 and 250 for the current limit. 180 means 10A and 255 is reserved for resetting all parameters. For an 8-pole Motor set the encoder-steps to 24 (SGP250). If the acceleration is still to low try a value of 3000 or more please.
If this does not work properly I will testing a configuration likely yours.
User avatar
M.Jankowiak (TRINAMIC)
Site Admin
 
Posts: 42
Joined: 13 Nov 2008, 14:26
Location: Hamburg


Return to Modules for BLDC Motors

Who is online

Users browsing this forum: No registered users and 1 guest