1
\$\begingroup\$

I have a PWM signal being generated by a 555 timer and that is fed into a ESC for an electric skateboard.

My problem is that the PWM signal duty cycle can go from 5% to 95% in a fraction of a second.

I need a way to slowly increase the duty cycle but I don't want to used any sort of microcontrolers (arduino, pic, fpga). I want to be able to turn the throttle to max and have the the speed slow increase.

\$\endgroup\$
  • \$\begingroup\$ what regulates CTL input? \$\endgroup\$ – Sunnyskyguy EE75 Jan 15 '17 at 6:18
  • \$\begingroup\$ I know this may sound like a dumb question but what does CTL mean \$\endgroup\$ – Joaquin Valdez Jan 15 '17 at 6:32
  • \$\begingroup\$ 555 control input \$\endgroup\$ – Sunnyskyguy EE75 Jan 15 '17 at 6:33
  • \$\begingroup\$ How slow do you want it? Show us the circuit you have now. \$\endgroup\$ – Bruce Abbott Jan 15 '17 at 6:40
  • \$\begingroup\$ I'm sure it can be done but it's impossible without your circuit, I'm afraid - can you post it? \$\endgroup\$ – TonyM Jan 15 '17 at 8:46
3
\$\begingroup\$

Don't.

You can probably do something like that with a very clever combination of 555s, analog filters, extensive measurements, adding analog security measures etc. I haven't fully read Bollock's answer, but I think it nicely illustrates how much knowledge and effectively, trial and error, you'd have to put into a 555-based design. The answer doesn't even scratch real-world trouble you'll enjoy, like component tolerances (especially for larger capacitors) and the resulting behavioral deviations, potential feedback loops, and all that stuff.

It's not worth it. What you describe is the classical use case of microcontrollers, and you already seem to know that. So leave that microcontroller fear behind; any ARM chip or especially Arduino will do what you want for a fraction of the effort and cost of what you're planning to do in analog. ARM eval boards start at below 5€ (this, for example, but I'd recommend you use anything that supports mbed, so these; you're probably best off price/benefit/size-wise using something like this board).

It's really not that hard to program a microcontroller, and I firmly believe in using the right tools for the job. And adjustable PWM is a job for a microcontroller. It also makes it possible to do "smart" things like allowing for emergency breaking with a higher PWM change rate, and also, any microcontroller PWM unit that I know can do 0%–100% duty cycle, not only 5%–95%. Later on, you can combine that with things like battery temperature supervision, that can throttle your motor if the batteries get too hot (that's actually a pretty good feature if you don't like fire but don't want to oversize your batteries too much).

And most interestingly: it would allow you to actually control the speed, assuming you have a sensor for that, in a closed loop control scheme; right now, you only control the PWM, but that's not inherently identical to speed (think of riding uphill vs downhill). Imagine you could control the PWM to make sure your skateboard rides at a constant speed rather than with a constant torque! You could, again, go the classical, 1960's route of doing that with an analog control loop, and then tuning parameters until things work out, or you could just do it in microcontroller software.

\$\endgroup\$
0
\$\begingroup\$

I'm assuming the signal you want to slow is an analog voltage representing the throttle position. A center tapped potentiometer where the center tap is the output and the other ends are connected to two different voltages, for example the skate board battery + and - terminals, would be an example. That's what I have in mind when I'm writing this:

schematic for signal smoother

I credit Wikipedia for the schematic symbols that I copy and pasted to make this.

I'm guessing you want a smooth response to the throttle so the skateboard won't jerk when you change the throttle fast and make you lose your balance. A simple way to do this is a RC circuit.

An RC circuit has a time constant which is traditionally given the greek letter variable tau. That's the horizontal axis in the graph on the schematic.

tau(seconds) = resistance(ohms) * capacitance(farads)

The rate at which the output voltage changes will be proportional to the difference between the input voltage and the output voltage. This means if you jump from 0% throttle to 50% the voltage will increase half as fast as if you jumped to 100%. If you jump to 50% and your tau is 1/4 second, then after 1/4 second your pwm duty cycle will be 63.2%*50% = 31.60%. This is assuming the rest of your circuit is designed so that 100% throttle results in 100% duty cycle. You can read the graph to see what it will be at each multiple of tau.

Things get more complicated mathematically with more than an instantaneous change from one voltage to another. The differential equation is in the wiki article if you want it. Just know that the higher tau the slower the response. Too much and you'll feel like your board is sluggish and unresponsive. Too little, which is what I think you're trying to fix, and you feel like the controls are too jerky.

https://en.wikipedia.org/wiki/RC_circuit

Some things to keep in mind when picking your R and C. There are infinite combinations of R and C that will achieve the time constant you want. However too low values of C and too high values of R will lead to the unideal behavior of the rest of the circuit having too much say in your circuit's behavior. The opamps I put in there are unity gain buffers and help isolate the RC circuit. Op amps have low output impedance and high input impedance. I think the most important factor will be the input impedance which should be > 1M Ohm. You can get away with a cheap op amp here because the demands aren't high.

I suggest starting off with a 47k resistor and a 4.7uF capacitor. This will give you a tau of about .22 seconds.

47 × 103 Ω × 4.7 × 10-6 F = 0.2209 s

You can play around and decide what you like. Once you get a good default value you can replace the resistor with a variable resistor and have a knob that controls the responsiveness on the fly. Think of one end as comfortable and the other as performance. You can put a constant resistor in series with the variable one to set a minimum smoothing if you want to keep it from throwing you off if you turn the knob all the way down.

A note about the op amps. You want the positive voltage supply to be greater than your highest input voltage and your negative voltage supply to be lower than your lowest voltage. If you pick a rail to rail capable op amp then you can have them equal.

I suggest the ground on that capacitor be the lowest voltage available. This will allow an electrolytic to be used if the negative terminal is connected to ground.

\$\endgroup\$
0
\$\begingroup\$

I'm guessing your 555 circuit is similar to this:-

enter image description here

Pulse width is directly controlled by the resistance of P1, so there is no easy way to slow down the throttle response. However the NE555 has another input on pin 5 called CONT (control voltage) which can be used to modulate the pulse width by applying an external voltage.

The circuit below replaces P1 with a fixed resistance, so the 555 produces a constant pulse width of ~1.5ms. P1 is then used as a potentiometer whose DC output voltage varies from 0 to 5V. R3 reduces this voltage variation at pin 5 to make the pulse width vary from 1 to 2ms.

schematic

simulate this circuit – Schematic created using CircuitLab

R3 and C2 form a low pass filter which prevents the voltage on pin 5 from changing quickly and so slows down the effect of varying the pot voltage. You can increase or decrease the value of C2 to slow down or speed up the throttle response.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.