HDC2450S

7 years 9 months ago #29527643 by aerialproducts
HDC2450S was created by aerialproducts
I\'ve got this HDC2450S controller which I\'m using to control a 4HP DC brushless motor. I\'m using an analog joystick to control the motor and I just got an optical encoder to add to the project. What I want to accomplish with the encoder is as follows:
At the end of the motor I have connected a load. At times the load could apply a huge amount of tension that could drive the motor even if there is no user input. If the system has not run at all then there is no problem, because between the motor and the load I have an electric activated magnetic brake. When the brake is active the load can’t pull on the motor. Once the user runs the motor the brake deactivates and it stays that way for as long as the motor is running. (I’m using a digital output to control the brake). If the user let go of the joystick then the motor should come to a stop. If the load is pulling really hard, that’s not going to happen. The brake won’t come on because the controller assumes that the motor is running, even though not as a motor this time but as a generator. I want to be able to incorporate the optical encoder and the (analog input) from the joystick and bring the motor to a stop if the user is not controlling the system. That doesn’t have to be very precise, so I could use time I’m assuming. If there is no user input for 5 sec, then try to stop the motor anyway and apply the brake.
Since the motor might be at high speed after user operation and the load keeps pulling at same speed then, the controller will have to work against the motor so it slows it down before applying the brake. That would be like a robot going down the hill, where it could obtain speed by itself even when we don\'t want it to.
I\'ve seen the closed loop operation in the datasheet, but I\'m not seeing how to actually use that mode with what I\'ve got.
Any feedback would be greatly appreciated.
Thank you very much.

Please Log in or Create an account to join the conversation.

7 years 9 months ago #29527645 by roboteq
Replied by roboteq on topic Re:HDC2450S
SInce you now have an encoder, you should consider running the motor in closed loop speed mode. This will ensure that the speed is controlled and stable regardless of the pulling force. When the joystick is centered, the motor will try to reach speed of 0 RPM. If the motor is pulled, it will try to hold back. Speed will not be 0 if pulled hard but it will be very slow.

We recommend you try this first and see if you are happy with the closed loop speed control.

If that works, we will guide you for the operation of the brake. YOu will most likely need to add a small script that will look for the joystick to be centered for a while and then switch to open loop speed control and activate the brake.

Please Log in or Create an account to join the conversation.

7 years 9 months ago #29527647 by aerialproducts
Replied by aerialproducts on topic Re:HDC2450S
Well thank you very much for the reply. I was playing with the closed loop-speed control. It looks like the controller is very sensitive in that mode. I\'m actually holding the encoder on my hand, because sometime the motor reaches very high speed and I\'m not able to stop it. I mean I have breakers that I could trip for the system to stop, also a main contactor (relay), but I lose control over it. I don\'t know whether I should play with gains or other features to try to make it a little slow in response. I don\'t really need the system to be that responsive (precise). That script you are talking about would be very helpful, because I\'m sure that\'s where this design is headed to. If there is no input from the user then the system should enter the open-loop control and apply the brake.

Thank you very much for all your input.

Please Log in or Create an account to join the conversation.

7 years 9 months ago #29527649 by roboteq
Replied by roboteq on topic Re:HDC2450S
Closed loop speed control can be very stable.

First verify in open loop that the speed that is reported by the encoder is of the same sign as the command: positive commmand = positive speed.

Make sure you enter the correct count parameters for the encoders. If possible, compare the speed that ou see on the motor with this reported by Roborun, in the chart.

Then run the motor at full speed in open loop and see what is the maximum speed that is measured.

Enter that value (or a few % lower) as the MaxRPM parameter, in the motor configuration.

Set the PID with soft values:
P=0
I=1
D=0

Then switch to closed loop mode.

It should now track speed. If the slider is at 100, the motor will go to 10% of max rpm, if 500, 50% of max rpm. etc

Please Log in or Create an account to join the conversation.

7 years 9 months ago #29527651 by aerialproducts
Replied by aerialproducts on topic Re:HDC2450S
Well I have done that. What do I use now to switch between modes. If there is no user input and a certain time has passed to completely stop the motor; or if there is any better way to do please let me know. I was just thinking of time. Since I\'m also using an electric brake I want the brake to active and keep the motor from any movement.

One more thing. How do I reset that counter on the controller if I wanted to. I don\'t understand that part.

Thank you very much for all your help you are providing.

Please Log in or Create an account to join the conversation.

7 years 9 months ago #29527653 by aerialproducts
Replied by aerialproducts on topic Re:HDC2450S
So is there a way to switch between the two mode:
Open-loop and closed-loop?
I mean I don\'t understand; any little movement on the encoder would cause the brake to desable and the motor to rotate. If this is used with a robot, a little push on the robot would it make it go crazy. How could I lock the motor to one position if no input is being entered from the user, but yet have feedback from the encoder?

Please Log in or Create an account to join the conversation.

7 years 9 months ago #29527655 by roboteq
Replied by roboteq on topic Re:HDC2450S
switching between the two modes can be done using the configuration menu.

You can also switch from the console with the following command:

^mmod 1 0 to swich channel 1 to open loop
^mmod 1 1 to switch channel 1 to closed loop speed mode

switching to position mode is a little more delicate because you need to pay attention to the counter. So you should firt clear the counter and then change the mode.

If all you want to do is to keep the motors locked at their current position, you should switch to Position Tracking mode. But before that you need to configure the encoder min and max value. Good numbers will be 10x the number of pulses per revolution. So if you have 100 in PPR, make min limit -1000 and max limit +1000. The PID also needs to be a little different in position mode. Try
P=2
I=1
D=0

Try these different modes from the utility. Then we will help you with a script that changes modes as needed.

Please Log in or Create an account to join the conversation.

7 years 9 months ago #29527661 by aerialproducts
Replied by aerialproducts on topic Re:HDC2450S
I don\'t need a position mode because I don\'t really know the position of the motor, but mostly I don\'t care about it. It could be anywhere for that matter. Maybe I\'m not explaining it well. I\'m using a joystick to control the motor, and I have a digital output (DOut1) to control the brake. When the joystick is moved then so does the motor, in the direction designated, in that case the brake comes off. If I let go of the joystick in open-loop mode after the motor stops the brake locks and there is no way the motor can move. The user has to input some command using the joystick again. That could create a problem considering the fact that the load I\'m using could and is able to drive the motor even after user input has stopped and the brake might never come on.

Now using the encoder and turning into the closed-loop control, the brake is also released when the user sends commands through the joystick. Then the controller tries to bring the motor to a stop. That\'s good because if the load is pulling then the motor will work the opposite direction trying to encounter for that movement.Once the motor comes to a stop finally the brake comes on and locks the motor.

The problem is that when the encoder is shaken a little disables the brake and gives a chance to the motor to free spin. I understand the controller will try to compensate for that, but I don\'t want that to happen. Once there is no more user input and the motor comes to a stop then I want to lock the brake there until there is user input. I want the brake to be activated to hold the motor in position. Using (DOut1) is controlling it when motor is on. A little movement of the encoder turns the motor on, therefore the brake is deactivated at most times. Something I\'m trying to avoid. Even if the motor never comes to a complete stop but there is no user input for a certain time I want the brake to come on and lock it. No matter what the encoder is telling it to do. I guess it is like a little logic design problem. If there is no user input for a certain time ignore the encoder until user input again.

If there is a way to switch between open-loop and closed loop using time as a parameter then I would really want to know how that can be done. If there is some other way of doing it, please let me know.

Thank you very much.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.125 seconds