A short test program for an motor is to be implemented.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
revolution
Level 1
Level 1
First question asked Welcome!

The motor assembly includes a limit switch that operates in both the top and bottom positions

also switches in the lower end position (closed in the end positions, during the

Motor drive open).

The first task:

The motor should be run up and down 1000 times and on each run the limit switch must open and close again. Depending on the test result, a red or green LED should be switched on.

 

 

I have already defined my macros

 

#define LOW 


#define HIGH 


#define LED_GREEN_ON LedGreen_Write(HIGH);


#define LED_GREEN_OFF LedGreen_Write(LOW);


#define LED_RED_ON LedRed_Write(HIGH)


#define LED_RED_OFF LedRed_Write(LOW);


#define MOTOR_UP {MotorDown_Write(LOW);\


MotorUp_Write(HIGH);}


#define MOTOR_DOWN {MotorUp_Write(LOW);\


MotorDown_Write(HIGH);}


#define MOTOR_STOP {MotorUp_Write(LOW);\


MotorDown_Write(LOW);}


#define READ_END_POS EndPosition_Read()

Please help me in approaching this problem. I have to use psoc creator.

0 Likes
1 Solution
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @revolution 

Could you let us know exactly what kind of a motor control algorithm you are looking for ? 

As you may be knowing, there are several motor control algorithms and knowing what you are looking for is important. Also, various other factors need to be considered before developing the code like the type of the motor, motor parameters, motor rating, control architecture that you want to use. 

Before developing the motor control algorithm, please consider preparing a plan for the motor controller considering all the aspects some of which are mentioned above.

If you need any specific help on any issue that you face, I will be happy to help you

Thanks and regards

RupakC

View solution in original post

0 Likes
1 Reply
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @revolution 

Could you let us know exactly what kind of a motor control algorithm you are looking for ? 

As you may be knowing, there are several motor control algorithms and knowing what you are looking for is important. Also, various other factors need to be considered before developing the code like the type of the motor, motor parameters, motor rating, control architecture that you want to use. 

Before developing the motor control algorithm, please consider preparing a plan for the motor controller considering all the aspects some of which are mentioned above.

If you need any specific help on any issue that you face, I will be happy to help you

Thanks and regards

RupakC
0 Likes