Stepper Motor Speed Ramping

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm playing with Chuck's code...

https://www.avrfreaks.net/index.p...

...to drive a 200 step/rev stepper, being driven with an 8-step microstepping driver, feeding a 12:1 reduction drive.

I'm seeing some odd behaviour where the motor only stops on the first movement, after that it just keeps going. This behaviour depends on the initial timing settings.

I *think* there's an overflow issue somewhere but I'd like to go back to the original work by David Austin. I've found the original article but not his original code.

Does anyone have a copy of the original source code?

PS
I've ported to Codevision but that shouldn't be a problem.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sure you are not exceeding the maximum pull in rate?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I *think* there's an overflow issue somewhere but I'd like to go back to the original work by David Austin. I've found the original article but not his original code.

Does anyone have a copy of the original source code?


Google search results: http://www.embedded.com/design/e...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"content cannot be found" What a crap site!

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:
"content cannot be found" What a crap site!

Couldn't have put it better myself.

jayjay1974 wrote:
Sure you are not exceeding the maximum pull in rate?

I'm fairly certain I'm OK. I start *very* slowly. The motor has plenty of torque, I'm driving it with plenty of current, and it's only loaded with the drive system (which is enough to prevent overshoot).

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But that isn't 'ramping'. A step or partial step has three parts. The armature is sitting at a tooth. The magnetic field changes, and the armature starts accelerating to the next tooth. In about 1 ms it is lined up with the new tooth, but its momentum takes it past the tooth and it decelerates and is pulled back in line with the tooth. This deceleration back to zero takes about the same time as the acceleration (no surprising violation of physics rules here), but it sorts of rattles back and forth for about a ms, so you can step step step with ANY amt of time between steps until you get up to about 3ms per step. To accelerate up thru this 3ms barrier, we need to have knowledge of the f=ma that is being spun. The motors have a certain amt of f, and for a given amt of m, you get a certain amt of a. So a 1 pound wheel wont spin up as fast as a half pound wheel. The Real Tricky part is to know when to chnge the magnetic field ahead to the next step pattern. This needs to happen just as the armature gets to the new tooth... about 1ms for the first step. If its pulled around to the 2nd tooth right here, it is still accelerating, and will get to this tooth in .5ms for example. Then it gets to the 3rd tooth in .25ms. The. the next .125ms. Now its really cruising along faster then the 3ms per step rate. But there's no way to stop without losing track of which step we are on without reversing the process. And of course, the load cant change without messing up the timing calcs. Messy.

Imagecraft compiler user