Having problems configuring closed loop mode with geared motors

6 years 11 months ago #29531926 by griz11
I have everything working nicely in open loop mode but now its time to go to closed loop on my controllers. So far I haven't had much luck getting them configured that way. The motors I'm using are 84 rpm geared at 100:1 with a 12ppr encoder mounted on the motor shaft. On encoder config it wants pulses per revolution. Is that revolutions of the output shaft or motor shaft in my case ? RPM at 100% is that going to be 84 or 8400? And what exactly is the max and min limit for if you are using incremental encoders? Is that to create soft limit switches? If so it will be perfect for these as they are steering motors. Also I want to hook up a r/c radio. Its a spectrum but not with the reciever that will plug straight in. I've had it working but now I need to move the input pins to different locations to use the encoders. Not quite sure how to do this. I see the chart in the release note but not quite sure how to decode it. I want to use pin 10 and 11 on the 15 pin connector. The way I read the matrix is that I need to set up digital input pin 4 and 3 for the pulse width from the receiver. Is that correct? Whats happening now is the motor will move about 1/4 of a turn stop for a sec then do the same thing again. Sometimes it looks like the stall light goes red but not always when it stops. I'm worried I'm going to fry something so I want to get this all figured out.

Thanks
Dan

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

6 years 11 months ago #29531929 by blake
Dan,
To answer the questions I'm going to need more info. Can you please attach the datasheets for your motor and encoder? Regarding the pinout to incorporate both your RC/pulse input and encoder input I need to know which controller you are using.

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

6 years 11 months ago - 6 years 11 months ago #29531930 by griz11

File Attachment:

File Name: motor.zip
File Size:1,251 KB

Realized I needed to multiply the count value by 4 for quad encoding. But that doesn't seem to fix it either. They work fine in open loop mode. Encoder counts are there and are going in the right direction. Starting to wonder if the rate is too high on the encoder pulses. When I"m running the motors the encoder count seems to go for a bit pause then catch up. Like its in bursts. But they work perfectly fine on a different brand controller. A cheap one so it makes me think that the rate isn't the issue. When I put one of the motors on that controller and measure the counts its 4800 per complete revolution of the output shaft. The controller is a 2130 with can bus. I have the rc radio on pin 3 and 4 everything else is the default config.
Attachments:

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

6 years 11 months ago #29531940 by blake
Dan,
One thing that is unclear from the datasheets you sent me is the PPR of the encoder. I know you said it was 12ppr from the motor shaft but was unable to find that anywhere on the datasheet. Also, it is unclear how the encoder is fixed onto the motor. It is important to know if the encoder is measuring from the output gear shaft or the input shaft (motor shaft). If it is 12ppr on the motorshaft then that would translate to 1200ppr (4800 cpr) on the output shaft. You can review the relevant info of incremental encoders in our manual on page 51.

If you have your RC receiver attached to pin 3 this is incorrect, that is the pin for RxIn. RC inputs are located on pins 1,8,10,11 and 12. You will want to use pins 10 and 15 for your encoder A & B inputs.

If you have additional questions I would recommend calling our tech support line so that we can discuss your application in more detail.

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

6 years 11 months ago - 6 years 11 months ago #29531944 by griz11
The 12ppr figure comes from the webpage www.servocity.com/html/84_rpm_hd_planeta...or.html#.VwbnPBMrK-o Its on the back of the motor so it measures the shaft speed before the gearbox. The pin 3 I'm referring too is the pin labeled RC3 in the app note chart. Its 10 and 11 on the 15 pin connector. Radio isn't connected at this time and the priority is set to serial then radio.

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

6 years 11 months ago #29531945 by blake
Please upload your configuration file so I can take a look.

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

6 years 11 months ago #29531948 by griz11
It was the freaking computer I was trying to use :) A asus t100. Couldn't keep up with the pulses I guess. Working perfectly when I use mac running bootcamp instead. Not a windoze guy. So the tablet was the only win machine in the house. I had it configured properly just needed a decent machine running the software. Smooth and accurate now. This controller is for the steering. The other drives the wheels. The ROS driver put out by clearpath works great too. These controllers are awesome. I tried a couple of others before finding out about these. No comparison. Yea there is a lot of doc to wade through to use them properly but they will do whatever you want. Last mc's I worked with were all register based. A real pain to use. The ability to use the radio and have it override the computer is going to come in very handy training the beast. Thanks for the help.

Dan
The following user(s) said Thank You: blake

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

6 years 11 months ago #29531952 by blake
Glad you were able to get it working! It's always the simple things that get us right? Please let us know if you need any other help.
The following user(s) said Thank You: griz11

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

6 years 11 months ago #29531963 by griz11
Yea and I'm behind getting this thing ready for the AVC in Colorado next summer. But that was the last thing that I was having problems with so should be smooth sailing from now on. I'll be adding one more 2130 soon for 4 wheel steering. It has a Zed and Lidar running on a TX1. www.elroyjetson.info Its changed a bit from those pics. Shorter and it has two motors for steering now. Using hector-slam so no need for encoders on the wheels. Going to use a little script to do the ackerman equations. One wheel isn't exactly the same angle as the other but with the scripting its a no brainer to fix that. Don't know what the deal is with the transformer. Only has 2 gig of memory so I'm thinking that might be it. Has to swap or something like that. But first time through with something you have no idea what is supposed to happen so it always takes more time than you thought. My ROS software stack runs fine in the sim so hoping it won't be long before this beast will be autonomous.

Dan

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

Moderators: tonysantoni
Time to create page: 0.113 seconds