PLUS+1 Software > Code sharing

sample code

(1/1)

curtistdc:
Hello, I am new to The guide prorogram and am trying to teach myself how to program with it.  I have a limited experience with this type of application.  I was wondering if anyone had some sample code that they would like to donate to my education.  I am pretty good at learning by examples so any help would be greatly appreciated.  I need to program a PID loop to control the height of an ultrasonic sensor mounted on a boom.  So an example of a PID loop would help a great deal.
Thanks
Scott

Neil:
Hi

so what type of PLUS+1 hardware do you have to train with?

Neil

curtistdc:
50 pin micro
24 pin output module
12 pin input module
2 analog ultrasonic sensors for height measurement
proportional hydraulic valves for height actuation

still waiting on the hardware. just programing.
Thanks
Scott

Neil:
Hi Scott.

I will often use the attached as a demo to PID control.

All is required is a pot on C1P08, supplied via the senor + pin
There are many different techniques applied for fine tuning, it really depends on the function you’re controlling.

This works for me.
Set EE_T1, EE_P, EE_I, EE_D  to zero.
Increase EE_P to a value of 5000 to cause instability monitored on CP_ERROR , then half the value in the NV, 2500, 1200 and so on until it becomes stable.
With smaller increments increase the value until it just fringes on stable/unstable.
Carry out the same process on EE_I.
I think the default entry’s get it somewhere close from memory.

Ideally your CP_SET and CP_FEEDBACK should follow.

Again Scott, this works for me, others may have different methods. Always remember safety if your tuning on a application.

regards Neil

paterianus:
I have the reverse application.  I would like to receive a signal from an ultrasonic sensor 0-19mS in duration based upon distance.  How accurate (and repeatable) is the Plus1 in measuring input signal widths?

Navigation

[0] Message Index

Go to full version