Hey there everyone. I’ve got a handful of questions here.
So my non-FRC Robot team is using the Cytron Technologies MD10C DC Motor Controller to control a linear actuator, and we are using a RoboRIO for the on-board microcontroller. Documentation can be found for the Motor Controller at the following link. Just so you are aware, we are using LabVIEW as our programming environment.
MD10C Rev3.0 Documentation
So the documentation states that the controlling pins are Ground, PWM, and Direction. My first question is how do I properly wire this? I originally thought that we would just simply wire it to the PWM port on the RoboRIO, but the middle pin on the RoboRIO PWM pinout is 6V whereas the Cytron Direction and PWM ports want 3.3/5V. Also because of my unfamiliarity with PWM, I wondered if we should connect this to both a Digital Output port and a PWM port, DO going to the Direction and PWM going to Ground and PWM. In any case, does someone with more experience mind telling me how it should be wired, and why?
The second question is how do I program this based on how I wire this? I’ve FRC LabVIEW installed and most of my code is written using it. If it is just simply using PWM or uses both PWM and DO I’m pretty sure through some testing I could figure it out, however, I would prefer someone with more experience in how the RoboRIO works weigh in before I just start wiring at testing.
You will need to use DIO pins to control the Direction and PWM pins. The PWM pin is a duty cycle input; the PWM outputs of the Rio are RC Servo-style PWM outputs and won’t work for this application.
https://tutorial.cytron.io/2013/07/29/controlling-md10c-with-arduino/ is a good starting point for learning how these pins need to be driven; there are actually two control modes–you can use both Direction and PWM pins or just the PWM pin.
Fortunately, the DIO pins on the RIO do have hardware support for duty cycle output. The Nidec Brushless motor uses a similar control approach, so you can look at the NidecBrushless WPILib class for an example of how to use this… it may actually be very close to a drop-in.
Thank you! This actually showed me that there is an advanced DIO palette in the FRC LabVIEW libraries, which I look forward to trying out!
Thanks for letting me know that the PWM ports on the RoboRIO are for RC Servo-style use, I had no idea. File that under all the info I have on the RoboRIO in my brain.
Success! We used two DIO Ports, one for Direction (boolean values) and one for PWM to control Speed. Using one PWM port worked however it starts moving upon startup, not when code starts. We went with the other option of 2 DIO ports.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.