Skip to main content
Bumped by Community user
added 16 characters in body
Source Link

TLDR; looking for algorithms to control a motor. I have a near-random torque, a battery current that can destroy my motor driver, and I aim for a stable output speed regardless of torque. My inputs are current as reported by the motor driver, and a rotary encoder.

Google led me to PID (proportional, integral, derivative) motor control. That doesn't stop drawing too much current when the motor stalls/starts. Looking at internet examples, PID also seems more suited for predictable or more tunable loads. I'm trying to avoid reinvent the wheel. Is there some algorithm/library that handles this? Should this be a hardware/electrical safety?

Background

I'm building a mechanical walker robot for an art show along with two master students. They're a bit behind and I'm helping out with the code (approved by their profs). I can code but I lack insight in the control algorithms that I can implement.

The walker has 6 segments. Each segment has 2 legs. The legs are moved with a linkage system, all tied together with a central drive to keep all legs in sync.

I have:

  • arduino nano
  • 500W 24V brushed DC motor
  • BTS7960 43A motor controller dual H-bridge
    • L- and R- current sense readout of the controller
  • Rotary encoder
  • RC transceiver with a pressure sensitive trigger
  • Li-Ion battery packs that can supply 60A
  • A 6 meter (20ft) 12-legged walker with variable torque between -3 and 10Nm
    • As the legs go round, there is a function (from simulation and measurements) to get the expected torque for a certain leg position on a flat surface. As soon as we hit a bump in the road, the balance shifts and we have no idea. I guess I should consider torque to be random.
  • Walking speed that is +-1000rpm (30:1 gear reduction in drive shaft to legs)

My goals:

  • more or less constant speed, regardless of torque
  • don't burn the controller/motor
    • current protection for startup/stall ?

Current status:

  • motor spins depending on RC trigger (no load)
  • rotary encoder signal is coming in
  • current sense is still troublesome, but I found a video. Hope to have that working soon
  • copy-pasted implementation of PID, but without load this doesn't do much

Any advice is appreciated, especially if I'm doing something stupid. It's a broad topic to quickly wrap my head around.

TLDR; looking for algorithms to control a motor. I have a near-random torque, a battery current that can destroy my motor driver, and I aim for a stable output speed regardless of torque. My inputs are current as reported by the motor driver, and a rotary encoder.

Google led me to PID (proportional, integral, derivative) motor control. That doesn't stop drawing too much current when the motor stalls/starts. Looking at internet examples, PID also seems more suited for predictable or more tunable loads. I'm trying to avoid reinvent the wheel. Is there some algorithm/library that handles this? Should this be a hardware/electrical safety?

Background

I'm building a mechanical walker robot for an art show along with two master students. They're a bit behind and I'm helping out with the code (approved by their profs). I can code but I lack insight in the control algorithms that I can implement.

The walker has 6 segments. Each segment has 2 legs. The legs are moved with a linkage system, all tied together with a central drive to keep all legs in sync.

I have:

  • 500W 24V brushed DC motor
  • BTS7960 43A motor controller dual H-bridge
    • L- and R- current sense readout of the controller
  • Rotary encoder
  • RC transceiver with a pressure sensitive trigger
  • Li-Ion battery packs that can supply 60A
  • A 6 meter (20ft) 12-legged walker with variable torque between -3 and 10Nm
    • As the legs go round, there is a function (from simulation and measurements) to get the expected torque for a certain leg position on a flat surface. As soon as we hit a bump in the road, the balance shifts and we have no idea. I guess I should consider torque to be random.
  • Walking speed that is +-1000rpm (30:1 gear reduction in drive shaft to legs)

My goals:

  • more or less constant speed, regardless of torque
  • don't burn the controller/motor
    • current protection for startup/stall ?

Current status:

  • motor spins depending on RC trigger (no load)
  • rotary encoder signal is coming in
  • current sense is still troublesome, but I found a video. Hope to have that working soon
  • copy-pasted implementation of PID, but without load this doesn't do much

Any advice is appreciated, especially if I'm doing something stupid. It's a broad topic to quickly wrap my head around.

TLDR; looking for algorithms to control a motor. I have a near-random torque, a battery current that can destroy my motor driver, and I aim for a stable output speed regardless of torque. My inputs are current as reported by the motor driver, and a rotary encoder.

Google led me to PID (proportional, integral, derivative) motor control. That doesn't stop drawing too much current when the motor stalls/starts. Looking at internet examples, PID also seems more suited for predictable or more tunable loads. I'm trying to avoid reinvent the wheel. Is there some algorithm/library that handles this? Should this be a hardware/electrical safety?

Background

I'm building a mechanical walker robot for an art show along with two master students. They're a bit behind and I'm helping out with the code (approved by their profs). I can code but I lack insight in the control algorithms that I can implement.

The walker has 6 segments. Each segment has 2 legs. The legs are moved with a linkage system, all tied together with a central drive to keep all legs in sync.

I have:

  • arduino nano
  • 500W 24V brushed DC motor
  • BTS7960 43A motor controller dual H-bridge
    • L- and R- current sense readout of the controller
  • Rotary encoder
  • RC transceiver with a pressure sensitive trigger
  • Li-Ion battery packs that can supply 60A
  • A 6 meter (20ft) 12-legged walker with variable torque between -3 and 10Nm
    • As the legs go round, there is a function (from simulation and measurements) to get the expected torque for a certain leg position on a flat surface. As soon as we hit a bump in the road, the balance shifts and we have no idea. I guess I should consider torque to be random.
  • Walking speed that is +-1000rpm (30:1 gear reduction in drive shaft to legs)

My goals:

  • more or less constant speed, regardless of torque
  • don't burn the controller/motor
    • current protection for startup/stall ?

Current status:

  • motor spins depending on RC trigger (no load)
  • rotary encoder signal is coming in
  • current sense is still troublesome, but I found a video. Hope to have that working soon
  • copy-pasted implementation of PID, but without load this doesn't do much

Any advice is appreciated, especially if I'm doing something stupid. It's a broad topic to quickly wrap my head around.

Source Link

Closed loop motor speed algorithms

TLDR; looking for algorithms to control a motor. I have a near-random torque, a battery current that can destroy my motor driver, and I aim for a stable output speed regardless of torque. My inputs are current as reported by the motor driver, and a rotary encoder.

Google led me to PID (proportional, integral, derivative) motor control. That doesn't stop drawing too much current when the motor stalls/starts. Looking at internet examples, PID also seems more suited for predictable or more tunable loads. I'm trying to avoid reinvent the wheel. Is there some algorithm/library that handles this? Should this be a hardware/electrical safety?

Background

I'm building a mechanical walker robot for an art show along with two master students. They're a bit behind and I'm helping out with the code (approved by their profs). I can code but I lack insight in the control algorithms that I can implement.

The walker has 6 segments. Each segment has 2 legs. The legs are moved with a linkage system, all tied together with a central drive to keep all legs in sync.

I have:

  • 500W 24V brushed DC motor
  • BTS7960 43A motor controller dual H-bridge
    • L- and R- current sense readout of the controller
  • Rotary encoder
  • RC transceiver with a pressure sensitive trigger
  • Li-Ion battery packs that can supply 60A
  • A 6 meter (20ft) 12-legged walker with variable torque between -3 and 10Nm
    • As the legs go round, there is a function (from simulation and measurements) to get the expected torque for a certain leg position on a flat surface. As soon as we hit a bump in the road, the balance shifts and we have no idea. I guess I should consider torque to be random.
  • Walking speed that is +-1000rpm (30:1 gear reduction in drive shaft to legs)

My goals:

  • more or less constant speed, regardless of torque
  • don't burn the controller/motor
    • current protection for startup/stall ?

Current status:

  • motor spins depending on RC trigger (no load)
  • rotary encoder signal is coming in
  • current sense is still troublesome, but I found a video. Hope to have that working soon
  • copy-pasted implementation of PID, but without load this doesn't do much

Any advice is appreciated, especially if I'm doing something stupid. It's a broad topic to quickly wrap my head around.