Open TheDoctor2017 opened 1 year ago
Did you try setting ramp_up_sp and ramp_down_sp?
Did you try setting ramp_up_sp and ramp_down_sp?
That's the problem, I don't know how. What is the full syntax of the command?
I figured it out. If anyone else runs across this, here is sample code:
lm = LargeMotor(OUTPUT_B) lm.ramp_up_sp = 2000
Now every time the motor is started it will ramp.
Important! The ramp_up_sp command must come AFTER any tank pairing assignments. For example, this works:
lm = LargeMotor(OUTPUT_A) rm = LargeMotor(OUTPUT_D) tank_pair = MoveTank(OUTPUT_A, OUTPUT_D) lm.ramp_up_sp = 1000 rm.ramp_up_sp = 1000
But this does not:
lm = LargeMotor(OUTPUT_A) rm = LargeMotor(OUTPUT_D) lm.ramp_up_sp = 1000 rm.ramp_up_sp = 1000 tank_pair = MoveTank(OUTPUT_A, OUTPUT_D)
The second code will not generate any errors, but there will be no ramping.
I am trying to add ramping to my builds. I know it is supported by the Lego software, but I want Python practice so I am using ev3dev. I can't find anything in the basic motor commands. I did find this: https://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/stable/motors.html But it appears to require a custom class, which is beyond my programming knowledge. Is there anyone out there in ev3dev land that understands how this works that could give me a code example or any other method to support ramping on the motors to avoid the sharp jerk at initial start? Thanks in advance!