0
\$\begingroup\$

I am trying to implement a temperature control system in an Arduino and I also want to know relevant parameters such as settling time, overshoot, etc., so I want to give a unit step input to the Arduino.

I have two questions:

  1. I am confused about how to give a unit step input to the Arduino and through which pins (analog input or digital input).

  2. I have also attached snapshots of the Tinkercad simulator. I am unable to find any option related to a step signal, so how can I can give a step input to the Arduino? (I think we can use a square wave but I don't know how to convert a square wave into a unit step.)

enter image description here

enter image description here

enter image description here

Transistor
187k16 gold badges207 silver badges433 bronze badges
asked Dec 31, 2022 at 10:10
\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

It sounds like you are trying to implement a PID controller with the Arduino.

You would normally apply the unit step to the plant (the system to be controlled.) From the settling time and overshoot, etc. you would then calculate the parameters for the PID controller. In that sense, the simulator can't help you much - you have to apply a step change to some real life parameter (in your case, the temperature) then observe the change in the real system.

If you are trying to measure the response of the PID controller you have already implemented on the Arduino, then you would apply the unit step to the same input as you are using for the PID controller. That would normally be an analog input, though it may be provided digitally by an analog to digital converter.

I don't see any ready made components in Tinkercad to generate a voltage step. You would have to put together a circuit in Tinkercad to generate the voltage step. You could use the simulated Arduino and a bit of program code to make the step.

Something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

You start your program with the digital output set to 0V, then switch it to 5V after a short period. The values of the three resistors will determine what voltage you have when the digital output is high or low. The analog input goes into your PID input. You would monitor the PID output using the oscilloscope function in Tinkercad.

answered Dec 31, 2022 at 11:17
\$\endgroup\$
2
\$\begingroup\$

An alternative to @JRE's solution is to change the setpoint rather than the temperature feedback. I can think of several ways of doing this in real life but not sure which would be easiest in TinkerCAD.

  1. Adjust the setpoint using the serial interface.
  2. Use a digital input. If low, then use the setpoint unaltered. If high, then add an offset (which can be postitive or negative) to the setpoint.
  3. Use an analog input and add the scaled input value to your setpoint. You could combine this with a digital input if you needed to switch between addition and subtraction.

You can then test the reaction to a step change in setpoint.

answered Dec 31, 2022 at 12:08
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.