Hi all

Is it possible to select 1 of 4 non linear voltage outputs from a linear input to control a dc motor ?

Boggy

Hi all

Is it possible to select 1 of 4 non linear voltage outputs from a linear input to control a dc motor ?

Boggy

That question is way to vague to make any sense of. Please describe what it is that you want to do.

Hi

I am controlling a dc motor via a linear potentiometer I would like to know if it possible to have possibly 4

nonlinear curves that could be switched in to alter the motor speed ?

Boggy

You're still losing me. Try to write more than just one or two sentences. Describe what you want to do, not how you think it would be done.

What does it mean to "switch in a nonlinear curve"

From what I can make of your question, my guess is that you should use a look up table to get your none linear function to convert a liner pot input to a none linear output.

You can then use something like two switches to select what one of four look up tables you use.

But this is just a guess from your vague words.

If you mean can you map a linear input to one of several different non-linear outputs then of course you can.

If you have a formula for the non-linearity (e.g. log(input) or input^2 or whatever) you can use that to calculate the output values or if not you can simply use a lookup table. How you switch between the different formulae/tables is up to you.

Steve

Let me guess. The pot gives a linear output. But you want an Arduino to modify this, applying some non-linear function, to produce a pwm signal to control the motor. Ideally one of up to 4 non-linear functions that you can select as desired.

If I'm right, then the answer is yes, Arduino can do this. You will need either a formula or a list of turning points that describe the shape of each of the non-linear functions.

Bear in mind that the pwm output of most Arduino has a resolution of only 8 bits (256 discrete values). It may be possible to increase this to 10 bits. The analog input of most Arduino (for reading the pot) is also 10 bits.

Hi,

Please excuse me as this is my first post !

Thank you PaulRB , slipstick and Grumpy _Mike that is exactly what I want to do. I am very new to Arduino

and have just got the control of the motor working via a linear potentiometer an arduino uno with pwm

outputs controlling a mosfet

Boggy

Great! And the non-linear functions you would like to use are....?

4 curves , the first curve a sharp increase above the linear smoothing off to high point , second curve the inverse of the first , the third an S and the fourth an inverse of the third .

If this does not make sense I will draw

Boggy

BoggyM:

4 curves , the first curve a sharp increase above the linear smoothing off to high point , second curve the inverse of the first , the third an S and the fourth an inverse of the third .

If this does not make sense I will draw

Boggy

And how do you wish to traverse these curves? Time wise or from some external stepping mechanism?

If time, what increments and over what time span? Then what to do when the limit has been reached?

Paul

If using lookup tables, to be selected using a multi position switch or multiple switches if first option not possible.

Using the linear potentiometer to vary speed

Boggy

OK so just make the look up tables, each one will take 256 bytes so put them in program memory. The liner one needs no look up table so just transfer the pot input after reducing it to 8 bits. This is simply done with two shifts to the right:-

```
output value = analogRead(pot) >> 2;
```

Hi Mike

So it can be done and doesn't sound too difficult for a newbie like myself.

Could the tables be selected with one multiposition switch ?

Boggy

BoggyM:

Could the tables be selected with one multiposition switch ?

Why wouldn't they be? Read the switch and then a few if statements or even a switch case to decide which table to read from.

If you can't imagine that then you will probably want to back up, put this idea down for a bit, and get some of the basics under your belt. Trying to dive into the deep end of coding can be a very frustrating prospect.

BoggyM:

...to control a dc motor...

What motor, and what do you want to control.

Just converting pot angle to PWM value might not give the result you're after.

I assume you want to control motor speed.

Does your motor produce any RPM feedback signal (rotary encoder, reflection sensor).

Leo..

Hi

Its a very basic 12 volt motor no feedback.

I have the motor running with linear speed control but want to vary acceleration in different circumstances .

The initial question was to find out if this was feasible . Now I know it is , I have a lot of reading to do and parts to

order , as I eventually want the control to be wireless

Many thanks for the help , I'm sure I will have more questions as this project develops .

Boggy

Its a very basic 12 volt motor no feedback

It is not possible to accurately control the rotational velocity or acceleration without feedback. You will need a good motor driver, a shaft encoder, a mathematical model or lookup table for the velocity/acceleration profile, and a PID controller.

I have the motor running with linear speed control but want to vary acceleration in different circumstances .

Are you sure you mean acceleration and not speed?

Acceleration is the rate of change of speed and is tough to program, especially when the rage of speeds you can get is limited. When you are at a constant full speed the acceleration is zero.

Hi Mike yes sorry I do mean speed.

Research goes on but very slowly being a newbie

Boggy