cancel
Showing results for 
Search instead for 
Did you mean: 

L6470 dynamic speed adjustment

flavio2
Associate II
Posted on October 05, 2011 at 14:24

Dear all

Im' working with the L6470 using MOVE commands. Now I have a question about speed adjustment on-the-fly. It seems not possible to change speed during a move command is under execution. I really need this function. Is there any possibility to work around this problem. In the datasheet, there is nothing written, that the speed adjustment during move commands is not possible... I know there is a RUN command with speed change on the fly. But in my project I can not use this command because of very accurate positioning.

Thanks for any help

Flavio Perucchi
3 REPLIES 3
Enrico Poli
ST Employee
Posted on October 07, 2011 at 11:44

Dear Mr. Perucchi,

It is not possible to change the speed on-the-fly using the Move command, you should use a combination of GoTo and Run commands instead.

The speed change can be implemented using the following sequence:

  1. Get the current SPEED, DIR and MOT_STATUS values

  2. Check if the motor is already reaching the target position (MOT_STATUS = deceleration)

  3. Set the new maximum speed value

  4. Send a Run command with direction and speed equal to the current values of step 1

  5. Wait for the end of Run command (the BUSY line is released)

  6. Send the GoTo command

Following (and attached) a script for the L6470 Evaluation Software implementing the procedure:

TARGETPOS = 1267836

SPEEDA = 0x41

SPEEDB = 0x21

# Initialize the ABS_POS and the MAX_SPEED values

ResetPos(0)

SetParam(0, ''MAX_SPEED'', SPEEDA)

# Positioning...

GoTo(0, TARGETPOS)

Delay(2000)

# I changed my mind

curr_speed = GetParam(0, ''SPEED'')

curr_status_val = GetParam(0, ''STATUS'')

curr_dir = (curr_status_val & 0x00000010) >> 4

curr_motstatus = (curr_status_val & 0x00000060) >> 5

if (curr_motstatus == 2):

    print ''Deceleration in progress, do not change the speed''

else:

    SetParam(0, ''MAX_SPEED'', SPEEDB)

    Run(0, curr_dir, curr_speed)

    WaitBUSY()

    # Positioning with the new speed

    GoTo(0, TARGETPOS)

Delay(2000)

GetParam(0, ''SPEED'')

Best Regards

Enrico Poli

flavio2
Associate II
Posted on October 07, 2011 at 14:25

Dear Mr. Polli

Thank you for your quick response. The sequence looks good, but there is just one more problem. In my application it is required to change speed in just a few milliseconds. There is a time window of about 80-100ms to change speed. In a first test, it was not possible to change velocity in this short time. I'll try to optimize my SPI communication. Is there any other hint, to achieve a speed change each 80ms?

Thank you for your help

Flavio Perucchi
Enrico Poli
ST Employee
Posted on October 19, 2011 at 14:29

Dear Mr. Perucchi,

The timing limit is related to the USB-to-SPI conversion performed by the communication boards. In particular a latency of tens of milliseconds could be present between two successive commands of the script (this is a limit of the USB drivers and it is also due to the OS).

In your final application the communication should be faster according to your SPI clock frequency.

Best Regards

Enrico Poli