tripipy icon indicating copy to clipboard operation
tripipy copied to clipboard

Cannot change speed whilst the motor is moving.

Open AndyThirtover opened this issue 4 years ago • 1 comments

Consider:

print("Set speed to 40") mot.updateSettings({'maxrpm':40}) time.sleep(1) # in case it takes time to make a difference print("Goto 10") mot.async_goto(10) while mot.are_we_there_yet() != 0: time.sleep(0.05)

print("STOPPED - SPEED CHANGE ON THE FLY") print("Set speed to 80") mot.updateSettings({'maxrpm':80}) print("Goto 50") mot.async_goto(50)

time.sleep(5) print("Set speed to 160") mot.updateSettings({'maxrpm':160})

In the first case the speed change is safe. In the second case the speed change causes the motor to squeal but not move. There is a little movement after about 0.5 second.

It is possible that the chip has to do a pile of calculations when speed is changed and during this time it does not service the motor.

It is more probable that I've misunderstood what updateSettings actually does.

I expected to see something like: self.md.readWriteMultiple(regsettings,regactions) Where VMAX would get written to the register.

Regards

Andy

AndyThirtover avatar Jul 20 '19 12:07 AndyThirtover