Skip to content

Converter::velocityFloatToChip doesn't convert to µsteps / t #9

@LewisSmartMachine

Description

@LewisSmartMachine

When comparing two methods for writing to the VMAX register, I found different outputs between
int32_t Converter::velocityFloatToChip(float velocity_real);
and
int32_t Converter::velocityRealToChip(int32_t velocity_real);

(microsteps_per_real_position_unit = 51200, seconds_per_real_velocity_unit = 60, clock_frequency_mhz = 12)

velocityFloatToChip returns 85333 when passed velocity_real = 100 when it should return 119304
This is consistent with retuning the microsteps per second rather than [0..(2^23)-512 microsteps/t] for the register
Passing the result of velocityFloatToChip to velocityHzToChip before returning should solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions