The short answer is that I don't know. The better answer is that it probably doesn't matter, since we're likely not using the exact same steppers and drivers and our mechanical systems are different. Ideally when the target is met the period should be pretty long, but not so long as to cause a significant latency on starting the next period (because the period only updates when the previous one is over).
I recommend you to first figure out your motor smoothness issues separate from balancing. Just write a stupid-simple app that lets you directly control the period using a SeekBar or similar. If you're still seeing unsmoothness, some possible causes are not using full microstepping (this is a feature of the driver) or not having enough steps / revolution on the motor. It is also possible that the motors are not providing enough torque, which causes them to skip steps under certain circumstances (e.g. sudden change in direction). On Thu, Sep 11, 2014 at 12:14 AM, Al B <[email protected]> wrote: > Hi Ytai, > > I'm putting together a balancing bot using your ShoeBot code as a > reference and I have a few questions about the Stepper::setSpeed() method. > > When mine reaches the target angle, the stp_.period is around 50. > However, the motors don't run smooth with that value and they struggle to > keep the bot in balance. > > What is the stp_.period value that yours gets once it's reached the target > angle and is balanced? stp_.period = Math.round(STEPS_FREQ / ???); > > Thanks, and best regards! > > -- > You received this message because you are subscribed to the Google Groups > "ioio-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/ioio-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "ioio-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/ioio-users. For more options, visit https://groups.google.com/d/optout.
