![]() |
4 wheel pwm drive with encoders for an xbox controller
Does anyone have any code they could share. Our team has been trying to get CAN working on practice bot and we are running out of time so I told them to go back to PWM based code.
They pushed back by saying you can't use encoders with PWM. I think they are a little off with that statement so I am looking to give them an example of code that can do just that. Feel free to personal message me if you want to keep it secret. Thanks JJ |
Re: 4 wheel pwm drive with encoders for an xbox controller
I'm fairly certain that encoders can only be used in CANBus mode. I think it has to do with how PWMs are not accurate enough? I'm not sure, I know in Labview you cannot code with encoders unless you have CAN Jaguars, as far as I know.
|
Re: 4 wheel pwm drive with encoders for an xbox controller
Hunter, I hate to break it to you, but your statements ONLY apply to encoders connected directly to Jaguars.
For any encoder connected to the DSC's digital in/out ports or the Analog Breakout, the above does not apply. Of course, then the cRIO has to do all of the work associated with those particular encoders (or offboard it to a co-processor). |
Re: 4 wheel pwm drive with encoders for an xbox controller
You can only use the encoders connected directly to the JAGs in CANBus mode. You can still use encoders with PWM but you have to connect them to the digital side car's digital inputs or some other input to the cRio and then setup a controller. In LabView there is a PID object and in C++ and Java in WPILib there is a PIDController class you can use.
Edit: What EricH said. I had a hunch someone might beat me to the post. |
Re: 4 wheel pwm drive with encoders for an xbox controller
Ah, I see. I assumed he was talking about connecting direct to jaguars.
|
Re: 4 wheel pwm drive with encoders for an xbox controller
Do you have example code for either option?
|
Re: 4 wheel pwm drive with encoders for an xbox controller
We use a 4 PWM/ 4 Encoder drivetrain with our mecanums. We use talons, not jags, though
|
| All times are GMT -5. The time now is 02:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi