Open pppalain opened 7 years ago
Thanks, I had not seen that. One more question please, one of the encoders has been commented out here https://github.com/paukstelis/dcservo/blob/e0c44d8f1fdccdd1aaf51a02abd32566ae486bc2/dcservostm32/dcservostm32.ino#L66 Is that for a particular reason?
Thanks, I had not seen that. One more question please, one of the encoders has been commented out here https://github.com/paukstelis/dcservo/blob/e0c44d8f1fdccdd1aaf51a02abd32566ae486bc2/dcservostm32/dcservostm32.ino#L66 Is that for a particular reason?
Because I am not very smart! I poorly selected my pin/timer combinations when designing my PCB, so the motor driver PWM ended up on the same timer channel as my Y encoder. You can't have them both.
Which pins would you recommend to use?
Honestly, it has been a long time since I worked on that project, but you could put motor driver pwms on timer 2 (PA0, etc.).
Perfect, thanks for all your help
@ithinkido I am curiously following your conversation. If you find good pin out solution for STM please keep us posted here.
Thanks.
@ithinkido @paukstelis Can either of you publish diagram (hand drawn OK too) like on main page of this repo with bluepill.
How many motors are controllable with one blupill device using motors with optical encoders ?
Thanks.
You can have 3 I believe. Timers 1, 3, and 4. This assumes an open collector type (2 outputs/encoder). You can find the little library here that describes the pins: https://github.com/chrisalbertson/quadratureBluePill Wiring depends on your encoder. Just keep in mind if you want to use PWMs for anything else those must then be on Timer 2. Also, Timer 3 is not 5V-tolerant.
@paukstelis That is brilliant, three motors controlled by a single bluepill. IIRC, timer 2 could create up to four PWM signals.
However, the use of Timer1 means USB port cannot be used for comms, leaving only left USART3 for that purpose.
Thanks @paukstelis .
However, the use of Timer1 means USB port cannot be used for comms, leaving only left USART3 for that purpose.
Hmm...I need to check that, because I just set up a project that has an encoder on Timer 1 and I have been communicated with USB. I haven't noticed any issues at all.
@paukstelis I gathered that insight from STM32CubeMX app for STM32F103C8 chip.
But now that you mention it, I dug a bit deeper and it seems the conflict is only for channel4, which is not needed for TIM1 when used as an Encoder.
@misan if @paukstelis do not have problem can you upload his sketch (3 motors to on a single Bluepill) ? That way people can find it easily when they visit your repo.
Thanks.
@happytm Sure, I can link his project from my README.
Thanks.
it's done
On Fri, Nov 26, 2021 at 8:49 AM happytm @.***> wrote:
Thanks.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/misan/dcservo/issues/37#issuecomment-979759466, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADRZSGHGH5SUEXOACMMDATUN43YTANCNFSM4EE2F2SQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I plan to undertake a two motor / encoder version of the software. Let me know if there are technical issues or if someone tried and failed.
I intend to use the pin change interrupts and the https://github.com/GreyGnome/EnableInterrupt library.