Have you tried Claude AI? Microstepping advice

I am programming a stepper motor-driven rock tumbler and decided to have Claude by Anthropic help with the coding. This is my first foray into using AI to write code for me. WOW! In a conversational interface, it produced a program in C++ that looks perfect. I will let you know how it performs… In the meantime, I asked it for advice about microstepping, a topic of great interest to us here, and often very controversial.

Here is the advice it gave me in about a second:

quote
Steve (lowly human) asks:
Now I wonder if you have advice for setting the microsteps used by the stepper motor driver. I presently have it set to NO microsteps (200 steps/rev). Is that the best for an application in which the motor is working very close to its torque limit?

Claude.ai replies: (on July 2, 2024)
Thank you for the kind words! Your question about microstepping is an excellent one, especially considering your application where the motor is working close to its torque limit. Let’s analyze this:

Using full steps (no microstepping) as you currently have it set up (200 steps/rev) is often the best choice when operating near the motor’s torque limit. Here’s why:

  1. Maximum Torque: Full steps provide the maximum torque output. Each step aligns the rotor precisely with the stator’s magnetic field, resulting in the strongest holding and dynamic torque.
  2. Torque Consistency: Full steps maintain consistent torque throughout the rotation. Microstepping can lead to torque variations, especially at higher microstep resolutions.
  3. Resonance Avoidance: Full stepping is less likely to excite the motor’s natural resonance frequencies compared to microstepping, which can be crucial when operating near torque limits.
  4. Simplicity: Full stepping simplifies control and reduces computational overhead, which can be beneficial in some applications.
  5. Power Efficiency: Full stepping is generally more power-efficient than microstepping, as it uses the full current capacity of the windings.

However, there are trade-offs to consider:

  1. Smoothness: Full stepping can produce more vibration and noise compared to microstepping, especially at lower speeds.
  2. Resolution: You’re limited to 1.8° per step, which might not be sufficient for some high-precision applications.
  3. Resonance at Certain Speeds: While generally better for resonance, full stepping can still hit resonance points at specific speeds.

Advice for your application:

  1. Stick with Full Stepping: Given that you’re operating near the torque limit, full stepping is likely the best choice.
  2. Consider 1/2 Microstepping: If you need slightly smoother operation without significantly sacrificing torque, 1/2 microstepping (400 steps/rev) could be a good compromise. It still provides about 70% of the full-step torque.
  3. Avoid Higher Microstep Resolutions: 1/4, 1/8, 1/16, etc., will significantly reduce your available torque.
  4. Mechanical Considerations: Ensure your mechanical system can handle the more pronounced steps. Consider using dampers or flexible couplings if vibration is an issue.
  5. Speed Ramping: Implement proper acceleration and deceleration profiles to avoid exciting resonance frequencies when starting or stopping.
  6. Cooling: Since you’re operating near the torque limit, ensure adequate cooling for the motor and driver.
  7. Monitor Performance: Keep an eye on motor temperature and performance. If you’re consistently at the limit, you might need to consider a more powerful motor or gearing.

Remember, the best setting can depend on the specific characteristics of your motor, driver, and mechanical system. If possible, it’s always beneficial to test different configurations to find the optimal balance between torque, smoothness, and reliability for your specific application.
__________________________ unquote ___________________

I, for one, welcome our new overlords!

1 Like

The answer it gives does not seem correct though, didn’t we have a lengthy discussion about it in the bamboo board thread? Jeffe explained it very well, there even was a mic drop emote. :sweat_smile:

link?

I remember the mic drop being dropped, but can’t find it now…

1 Like

Claude is very good, but as with all of them, they are wrong sometimes and in this case I think it is incorrect about torque being “significantly reduced” with microstepping.

I have also caught it numerous times generating incorrect code.

One great application is when the code is integrated within a tester, akin to test driven development, where the test serves as the reality/correctness check. This lifts the burden of checking for correctness from the human, and the net labor amplification can be higher.

On some level, humans are error-prone too, and thorough, rigorous testing is appropriate for human-generated code, even if not using TDD per se. The difference is that human labor is expensive and depending on the application, fully bug-free code is unfortunately not always worth it from a cost-benefit perspective. But with machines writing the code and tests, that calculus undergoes a huge shift.

A lot of naturally intelligent people are wrong all the time.

Ask me how I know :stuck_out_tongue:

2 Likes

I WOULD like to know how you know:
Your joking rhetorical question is actually a huge and interesting topic! I recommend the book by Brian Christian, “The Most Human Human” in which he serves as the human to be compared to an AI in a Turing Test, where the tester asking questions only sees the typed responses of Christian and the AI. He had to think carefully about what types of mistakes a human ought to make to seem more human! The latest chatbots are being judged as human about 54% of the time, in a recent Turing Test, while humans are only correctly identified as humans about 67% of the time. Link to article about the UCSD study.

2 Likes

Because I am wrong all the time.

1 Like

Hey! That’s my job!

1 Like

No need to fight, you can both be wrong! :slightly_smiling_face:

4 Likes

But are you as confidently wrong as Chat-GPT providing a biography of Count Jaques de Tourniquet, the man who introduced the Marquis de Sade to “rope play”, and is known as the “Father of French Shibari”? (I think you probably would have had to ask for that under Chat-GPT 3 or 4, their filter/hallucination checks are getting “better”.)

2 Likes

For my part, I’m definitely capable of making mistakes. It was 2006. I’m pretty sure it was a Wednesday.

3 Likes