Help with 0-5v motor control signal

Hi, i am new to Arduino and the forum. I have a project that has to get up and going by this weekend. I appreciate any and all help offered up.

I have a motor that needs to drive a carriage along a track. Currently there is a drive roller attached to a short drive shaft directly attached to the motor, no gearing or pulleys. I have a pot wired up as described in the webpage below, this controls the max speed only. When the motor starts to spin the roller slips due to the high torque and weight of the carriage. I beleave I need to ramp the speed up to control/prevent the slippage. This motor has already torn up two $28 drive rollers.

I am looking for a way to create an adjustable time, ramp up signal from say 100ms to maybe 1s. Is this possible with an Arduino pro mini 5v or Uno R3, or any Arduino? This controller will only have one purpose. From my research everyone is using ether pwm or some other motor controller which doesn’t work for my situation.

Motor webpage:
BLWS23MDA - Brushless Motors with Integrated Speed Controllers that needs to drive a carriage along a track

Once again thank you for all the help
David

To obtain a 0 to 5V continuously variable (analog) signal from an Arduino you low pass filter PWM.

Thanks for the link, it was very informative.

After reading, it looks like i should be able to use a Pro Micro 5v/16MHz or RedStick and a MCP4725 to have a more linear output?

I have no experience with either, but the DAC looks pretty nice.

Yes, the mcp4725 will work along with any 5 volt Arduino. The Uno is always a good starter unit. If space is an issue go with the Nano so you don’t have to mess with a separate usb to serial converter.

Avoid the 3.3 volt based processors since you need a 0-5 vdc signal for the drive.

You might need to gear the motor down too to give you better control

Thanks for the feed back.

I ended up ordering the Pro Micro 5v/16MHz which has the usb built in. I am worried about the space. The power supply, crestron controller wiring and max speed pot all live in a outdoor rated enclosure along with a dome camera mounted on the cover. Everything is quite tight already.

I agree, gear reduction would be nice, considering that the motor has a max rpm of 4,000 which works out to well over 700’/min. Only problem with gear reduction is i would have to modify extensively or purchase a $700 gear reducer. McMaster Carr has them with ratios from 3:1 - 50:1. Only other thing i can think of is to use a smaller roller which i ordered after i saw your suggestion for the reducer. The smallest roller i can find will reduce the max speed to around 520’/min. Should be a much more usable speed range.

As far as the programming goes, would i have a PWM that increases from low duty cycle to high duty cycle on the output to the DAC?

There is no PWM involved.

The output to the DAC is a 12 bit value written over the I2C interface. The library will do all the work for you, you just state the desired output voltage, 0 to 5 volts as a number equal to 0 at 0 volts, 4095 at 5 volts.

Ok. I haven’t looked at the library yet. The parts are sitting on my front porch and i plan on getting familiar with everything when i get home from work.

Anything you suggest i read before starting?

Use the example program contained within the library. Once the library is loaded and you open the IDE, click on
File->Examples-> and scroll down until you see the heading "Examples from custom libraries" the look for "Adafruit MCP4725" and select the sinewave or triangle wave demo. This will load the example, compile and download and you have a working example of how to use the library which really isn't at all difficult.

Now that I've typed all this, it's probably better to just post this, clearer than the demos in the library:

#include <Wire.h>
#include <Adafruit_MCP4725.h>

Adafruit_MCP4725 dac;

void setup(void) {
  Serial.begin(9600);
  Serial.println("Hello!");

  // For MCP4725A1 the address is 0x62 (default) or 0x63 (ADDR pin tied to VCC)
  // For MCP4725A0 the address is 0x60 or 0x61
  // For MCP4725A2 the address is 0x64 or 0x65

  dac.begin(0x62);
}

void loop(void) {

  dac.setVoltage(4095, false);    // output 5.0 volts
  delay(1000);
  dac.setVoltage(3276, false);    // output 4.0 volts
  delay(1000);
  dac.setVoltage(2457, false);    // output 3.0 volts
  delay(1000);
  dac.setVoltage(1683, false);    // output 2.0 volts
  delay(1000);
  dac.setVoltage(819, false);     // output 1.0 volt
  delay(1000);
  dac.setVoltage(0, false);       // output 0.0 volts
  delay(1000);
}

Thanks for all the help.

I just re-read this post and had forgotten you really wanted a ramp output with the 0-5 vdc dac.

Below is a linear ramp routine that will provide an output speed that can change smoothly from zero to your desired speed. Hopefully the code is self-explanatory but I don't know what your programming abilities are so if you need it explained in detail, please ask. Actually, it would be better to state what you want your speed output to the drive to do and I can show you how to make that happen rather than explaining the code.

#include <Wire.h>
#include <Adafruit_MCP4725.h>

Adafruit_MCP4725 dac;

unsigned long rampTime = 5 * 1E6;   // this is a 5 second ramp (in microseconds) 
const int dacCounts = 4095;         // assumes 12 bit resolution
unsigned long updateInterval = rampTime / dacCounts;

unsigned long startTime;
unsigned long currentTime;

int rampedOutput;
int rawOutput;

void setup(void) {
  // For MCP4725A1 the address is 0x62 (default) or 0x63 (ADDR pin tied to VCC)
  // For MCP4725A0 the address is 0x60 or 0x61
  // For MCP4725A2 the address is 0x64 or 0x65
  dac.begin(0x62);
}

void loop(void) {

  rawOutput = 4095;
  while ( updateRamp() );
  rawOutput = 0;
  while ( updateRamp() );

}

int updateRamp()
{
  // check for nothing to do
  if (rawOutput == rampedOutput )
    return false;

  currentTime = micros();
  if (currentTime - startTime > updateInterval) {
    startTime = currentTime;
    if (rawOutput > rampedOutput && rampedOutput < dacCounts)
      dac.setVoltage(++rampedOutput, false);
    if (rawOutput < rampedOutput && rampedOutput > 0)
      dac.setVoltage(--rampedOutput, false);
  }
  return true;
}

The project is to use a motor to drive a carriage with a camera, up and down a track. Inputs are a 3 position momentary switch DPDT with forward, off, and reverse, potentiometer for max speed and a potentiometer for ramp/acceleration. The motor has a built in controller that requires 0-5v input for speed, and switch to ground for direction.

Current hardware:

Motor:

ProMicro:
https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/all

MCP4725:
https://learn.sparkfun.com/tutorials/mcp4725-digital-to-analog-converter-hookup-guide?_ga=2.158139642.1362260243.1544850897-1529817061.1514069200

When forward is pressed the direction is set and the motor ramps up to full speed.
When forward is released the motor ramps down to 0.
When reverse is pressed the direction is set and the motor ramps up to full speed.
When reverse is released the motor ramps down to 0.
The max speed should be able to be controlled with a voltage devider at the MCP4725 vcc?
The ramp/acceleration should be controlled by a potentiometer.

What is the purpose of your post? Are you asking for help? If so, what have you done so far? Anything wired? Any software working?