TMCM-171 Torque Control and Initialization

TMCM-171 Torque Control and Initialization

Postby listrik » 11 Apr 2012, 12:00

I have just bought my first 171 controller.

1. How do I start the encoder based commutation sync as described in the manual, chapter 5.2, Mode 2?

2. I want to control the motor torque only, using analog input 2. The motor is a synchrounous 4 pole motor with a 1024 pulse encoder.
I gues the basic procedure is:
- read Ain2
- subtract 512 to get a -512 to +512 torque setpoint
- write it to where?
- How is pure torque control selected?
listrik
User
User
 
Posts: 4
Joined: 11 Apr 2012, 11:44

Re: TMCM-171 Torque Control and Initialization

Postby Olav Kahlbaum (TRINAMIC) » 17 Apr 2012, 08:11

1. When all parameters are set up according to the motor and encoder you are using the encoder based commutation can be initalized using SAP 160, 0, 0. With GAP 160, 0 you can then check if initialization has already finished: it returns 1 then.

Please see the TMCM-170/171 programming manual on how to set the commutation and PID parameters.

2. The analog input can be read using GIO 1,1 or GIO 2,1 or GIO 3,1 (depending on which of the three analogue inputs you are using). GAP 154, 0 can also be used to read analogue input #1. The TMCM-171 doesn't have a real torque mode, but for simulating it you could write the value to parameter 6 (max. current, must always be positive) and depending on the direction write a high positive or negative speed value to parameter 3.
User avatar
Olav Kahlbaum (TRINAMIC)
Site Admin
 
Posts: 3410
Joined: 11 Aug 2006, 08:02

Re: TMCM-171 Torque Control and Initialization

Postby listrik » 17 May 2012, 18:19

I can't do the startup run 249/mode = 4.
The motor will run 2 turns and then stop.
Debugger shows that the program stays in the LOOP loop permanently.
The fault LED on the board is ON while the 2 turns are executed and OFF after that.
My encoder pulse scheme is a bit different to that mentioned in the hardware manual, chapter 5.3, which might be the reason for failure.

My parameter list is:

//Initialization
SGP 253, 0, 12 //Motor poles 3 phases * 4 poles
SGP 250, 0, 1024 //Encoder Steps
SGP 251, 0, 1 //Direction 0=CW 1=CCW. "1" because encoder is mounted
//on drive side of motor turnin in opposite direction
SGP 252, 0, 2 //N-Channel Polarity. <<<<<<<<<This might be the problem
SGP 249, 0, 4 //4=Encoder with Index-Chan with first init
SAP 160, 0, 0 //Do init run

LOOP:
GAP 160, 0 //if done, result will be = 1
JC NZ, Done //Jump Conditional if A2 is Not Zero
Ja Loop

Done:
SAP 6, 0, 20 //Current [mA]= Alimit * Div = 0..24A * 5,1 (bei Sinus) 4A * 5,1 = 20
SAP 128, 0, 0 //Standalone Mode 0=Normal 1=Use AI
SAP 11, 0, 0 //Acceleration 0=no ramp else RPM/S2
SAP 147, 0, 1 //Disable PID 1=Disable
SAP 159, 0, 0 //Commutation 0=Block 1=Sine
ROR 0, 1000 //Target speed

MainLoop:
GAP 0, 0 //Dummy read
JA MainLoop //Jump to MainLoop
Attachments
Encoder.jpg
Encoder.jpg (7.37 KiB) Viewed 974 times
listrik
User
User
 
Posts: 4
Joined: 11 Apr 2012, 11:44

Re: TMCM-171 Torque Control and Initialization

Postby Olav Kahlbaum (TRINAMIC) » 21 May 2012, 08:09

I also think that your setting for global parameter 252 might be the problem. Please try SGP 252, 0, 7 as in your drawing it looks as all encoder signals are high during encoder null event. Or if this should not work try SGP 252, 0, 0.
User avatar
Olav Kahlbaum (TRINAMIC)
Site Admin
 
Posts: 3410
Joined: 11 Aug 2006, 08:02

Re: TMCM-171 Torque Control and Initialization

Postby listrik » 21 May 2012, 15:52

Neither SGP 252, 0, 7 nor SGP 252, 0, 0 will work. The motor doese 2 turns and then stops.
Are the other paramweters in the correct order and sensible?
listrik
User
User
 
Posts: 4
Joined: 11 Apr 2012, 11:44

Re: TMCM-171 Torque Control and Initialization

Postby Olav Kahlbaum (TRINAMIC) » 22 May 2012, 08:16

Maybe it is better to use mode 3 instead of mode 4 (SGP 249, 0, 3). The other point is if SGP 251, 0, 1 is really correct or if SGP 251, 0, 0 has to be used here. Did you also try the motor with hall sensor based commutation?
Are the encoder signals levels correct? Please try turning the encoder manually and check if the position register gets changed then.
User avatar
Olav Kahlbaum (TRINAMIC)
Site Admin
 
Posts: 3410
Joined: 11 Aug 2006, 08:02

Re: TMCM-171 Torque Control and Initialization

Postby listrik » 22 May 2012, 16:23

SGP 251, 0, 1 is correct, I have checked the encoder position display. A right rotation of the motor increases the counter.

I can' test the motor with hall sensors because my motor doesn't have any. However, I have connected the hall sensor part of another motor, leaving the power wires connected to my motor. When I turn the hall sensored motor manually, the sensorless motor will follow that rotation.

After raising the encoder voltage to 5.5V, I finally got initialization mode 4 running.
With SGP 249, 0, 4 and SAP 160, 0, 0; the motor now turns one turn at maximum, oscillates slightly two or three times and then stops under high current. I can hardly turn the shaft by hand.
There is now noticeable difference between modes SGP 249, 0, 3 and SGP 249, 0, 4

The ROR command doesn't have the expected effect.....

My current parameter list is:

//Initialization
SGP 253, 0, 12 //Motor poles 3 phases * 4 poles
SGP 250, 0, 1024 //Encoder Steps
SGP 251, 0, 1 //Direction 0=CW 1=CCW. "1" because encoder is mounted on drive side of motor turning in opposite direction
SGP 252, 0, 7 //N-Channel Polarity
SGP 249, 0, 4 //4=Encoder with Index-Chan with first init
SAP 160, 0, 0 //Do init run

LOOP:
GAP 160, 0 //if done, result will be = 1
JC NZ, Done //Jump Conditional if Not Zero
Ja Loop

Done:
SAP 6, 0, 20 //Current [mA]= Alimit * Div = 0..24A * 5,1 (Sinus Mode) 4A * 5,1 = 20
SAP 128, 0, 0 //Standalone Mode 0=Normal 1=Use AI
SAP 11, 0, 0 //Acceleration 0=no ramp else RPM/Sec/Sec
SAP 147, 0, 0 //PID 0=Enable 1=Disable
SAP 159, 0, 1 //Commutation 0=Block 1=Sine
ROR 0, 300 //Target speed 300 RPM

MainLoop:
GAP 0, 0 //Dummy read
JA MainLoop //Jump to MainLoop
listrik
User
User
 
Posts: 4
Joined: 11 Apr 2012, 11:44


Return to Modules for BLDC Motors

Who is online

Users browsing this forum: No registered users and 1 guest

cron