cancel
Showing results for 
Search instead for 
Did you mean: 

MCSDK How to achieve working position control application ? [and some bugs ? ]

MJost
Associate

MCSDK : 5.y.2

Cube Ide 1.7

CubeMX 6.30

Board: B-G431-ESC1

Motor Maxon EC60 24V 200W

Encoder A,B,Z (48,100...2048 ppr choosable resulution) atm 48 ppr

Motordates learned with Motor Profiler.

MotorPilot : Position Control App.qml

:

Three issues all have following in common :

Building works

Motor seems to hold the position.

If i turn the encoder manually the motor tires to compensate that.

1st Issue MotorPilot send "Execute Set Position command" crashes MCU to Fault Handler:

I found out that register_interface.c at Line 381 case MC_REG_POITION_RAMP

FloatToU32 Position;

....

 MCI_ExecPositionCommand(pMCI, Position.Float_Val, Duration.Float_Val);

the union crashes the mcu to faulthandler (unaligned access ?)

I made all values to simple float and ithe mcu programm did not crash anymore,

the command was correctly transferred to mcu (found out by debugging)

2nd Issue : (the main problem)

I cannot use the positioniong at all:

Independantly of the PID Parameters the commands are not driving the door properly.

i tried an example from the app notes but it worked only sometimes.

i found sometimes the motor tried to drive a bit to left and 2 seconds later a bit to the right,

but at the end not complete rotations and not always.

Is positioning working at all ?

while (1){

 MC_ProgramPositionCommandMotor1(pos1*1.57,0.1*time1);

  HAL_Delay(2000);

  MC_ProgramPositionCommandMotor1(pos2*-1.57,0.1*time2);

  HAL_Delay(2000);

}

3rd issue :

If i configure the Encoder without Z ,

the app crashes if Z-signal is triggered eletrically (even thoug config says _ no )Z Index

1 REPLY 1
MJost
Associate

Additionally my config