Hi there, Im have a few issues with the programming code for a circuit that I required to build to control 4 Actuator motors. The microcontroller chip is the PICAXE 40X2. Have trouble understanding the ADCsetup and readADC among other things as I very new to this. I have the manual but the info contained with is very hit and miss. The Program I I've started to work on is at the bottom of this it long way from being first and slow going.
Any help persons can offer would be a help.
There are a number of inputs from varies sources and a few are analog from Potentiometers and a Pulse Signal from the car Speedo sensor.
The Program will have to run on 2 or 3 process at once I think to work.
The first is the Power
Depend what Can be done here will give option with what happens with the circuit. What is need is when the Accessory input (D.3) go High the program will start. When the Accessory input (D.3) go Low a delay will activate say 3 minutes and shutdown the program. Also a later option for car show is to allow the car security system output to control the actuator motors though inputs (A.7, D.5) the only 2 pins not being used.
The Second Part (Height raise the wing)
Turn On Accessory
1. Once the Accessory input (D.3) go High after a 10 sec delaythe Height Motor Up Output(B.0) go High andtheHeight Up Led Output(D.7)go high and run to the set position obtain from theactuator motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) say 250.
2. Once this is reached the Height Motor Up Output(B.0) go Low andtheHeight Up Led Output(D.7) go Low until theAccessory input (D.3) go Low then the Height Motor Down Output(B.1) go High and theHeight Down Led Output(D.6)go high and run to the set position obtain from theactuator motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) = 0.
3. Once this is reached the Height Motor Down Output(B.1) go Low and theHeight Down Led Output(D.6) go Low.
If the Boot is opened
4. As you see in the program flow Ive put the Boot Open input (D.2) ahead of the accessory input this is just to show that it overrider the input from the accessory input.
5. So if the Boot Open input (D.2) go High then it checks the position of the Actuator Height motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) and if >0 turns the Height Motor Down Output(B.1) go High and theHeight Down Led Output(D.6)go high and run to the set position obtain from theActuator Height motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) = 0.
The Actuator Height motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) must also be used to monitor the position of the both motors and if one stops or the distance between either is more than say 5 then it shut down the motor outputs (B.0, B.1) to low and flash both Height led output (D.6, D.7).
6. Once this is reached the Height Motor Down Output(B.1) go Low and theHeight Down Led Output(D.6) go Low. Manual Operation
1. I have also included a manual operation so when the Manual Height Switch Input (A.0) go Highit turn Manual Height LED Input (B.5) High and if possible lock out the Accessory input (D.3) and activates Height up input (A.2) and Height Down input (A.3) (of course when the Manual Height Switch Input (A.0) is low then Height up input (A.2) and Height Down input (A.3) is locked out.
Up Switch
2. When the Height up input (A.2) go high and the Height Up Led Output(D.7)go high and theHeight Motor Up Output(B.0) go High until Height up input (A.2) go Low and the Height Up Led Output(D.7) go Low andthe Height Motor Up Output(B.0) go Low
Down Switch
3. When the Height Down input (A.3)go high and the Height Up Led Output(D.7)go high and theHeight Motor Up Output(B.0) go High until Height Down input (A.3) go Low and the Height Down Led Output(D.6) go Low andthe Height Motor Down Output(B.1) go Low
If in manual operation when the Accessory input (D.3) go Low will go back into auto operation and follow the shutdown.
Any help persons can offer would be a help.
There are a number of inputs from varies sources and a few are analog from Potentiometers and a Pulse Signal from the car Speedo sensor.
The Program will have to run on 2 or 3 process at once I think to work.
The first is the Power
Depend what Can be done here will give option with what happens with the circuit. What is need is when the Accessory input (D.3) go High the program will start. When the Accessory input (D.3) go Low a delay will activate say 3 minutes and shutdown the program. Also a later option for car show is to allow the car security system output to control the actuator motors though inputs (A.7, D.5) the only 2 pins not being used.
The Second Part (Height raise the wing)
Turn On Accessory
1. Once the Accessory input (D.3) go High after a 10 sec delaythe Height Motor Up Output(B.0) go High andtheHeight Up Led Output(D.7)go high and run to the set position obtain from theactuator motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) say 250.
2. Once this is reached the Height Motor Up Output(B.0) go Low andtheHeight Up Led Output(D.7) go Low until theAccessory input (D.3) go Low then the Height Motor Down Output(B.1) go High and theHeight Down Led Output(D.6)go high and run to the set position obtain from theactuator motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) = 0.
3. Once this is reached the Height Motor Down Output(B.1) go Low and theHeight Down Led Output(D.6) go Low.
If the Boot is opened
4. As you see in the program flow Ive put the Boot Open input (D.2) ahead of the accessory input this is just to show that it overrider the input from the accessory input.
5. So if the Boot Open input (D.2) go High then it checks the position of the Actuator Height motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) and if >0 turns the Height Motor Down Output(B.1) go High and theHeight Down Led Output(D.6)go high and run to the set position obtain from theActuator Height motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) = 0.
The Actuator Height motors (1 & 2) potentiometer inputs (D.4 [ADC25], C.7 [ADC19]) must also be used to monitor the position of the both motors and if one stops or the distance between either is more than say 5 then it shut down the motor outputs (B.0, B.1) to low and flash both Height led output (D.6, D.7).
6. Once this is reached the Height Motor Down Output(B.1) go Low and theHeight Down Led Output(D.6) go Low. Manual Operation
1. I have also included a manual operation so when the Manual Height Switch Input (A.0) go Highit turn Manual Height LED Input (B.5) High and if possible lock out the Accessory input (D.3) and activates Height up input (A.2) and Height Down input (A.3) (of course when the Manual Height Switch Input (A.0) is low then Height up input (A.2) and Height Down input (A.3) is locked out.
Up Switch
2. When the Height up input (A.2) go high and the Height Up Led Output(D.7)go high and theHeight Motor Up Output(B.0) go High until Height up input (A.2) go Low and the Height Up Led Output(D.7) go Low andthe Height Motor Up Output(B.0) go Low
Down Switch
3. When the Height Down input (A.3)go high and the Height Up Led Output(D.7)go high and theHeight Motor Up Output(B.0) go High until Height Down input (A.3) go Low and the Height Down Led Output(D.6) go Low andthe Height Motor Down Output(B.1) go Low
If in manual operation when the Accessory input (D.3) go Low will go back into auto operation and follow the shutdown.
Attachments
-
36.3 KB Views: 40
-
204.5 KB Views: 21