running a DC motor using the arduino motor shield

For general Flowcode discussion that does not belong in the other sections.
peterhalloway
Posts: 11
http://meble-kuchenne.info.pl
Joined: Sat Nov 20, 2021 11:28 am

running a DC motor using the arduino motor shield

Post by peterhalloway »

Hi I am having issues setting up an arduino motor shield in conjunction with an arduino uno R3. I suspect I have some wrong pin assignments, but havent worked it out and couldn't find any help for it. I have attached my very simple program can someone please point me in the right direction.

Pete
Attachments
DC motor.fcfx
(9.53 KiB) Downloaded 85 times

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 506 times
Been thanked: 468 times

Re: running a DC motor using the arduino motor shield

Post by medelec35 »

Hello.
The pins look wrong as they should not be mapping on the Arduino.
I have created a temporary fix.
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.

C:\ProgramData\MatrixTSL\FlowcodeV9\Components
Replace the existing file with the attached file.
The flowchart will need to be refreshed if Flowcode was open when you replaced the file.

It looks like the connections are:

Code: Select all

Function	   Channel A	Channel B
Direction	   Digital 12	Digital 13
Speed (PWM)	   Digital 3	Digital 11
Sorry I only have a motor shield to test with.
Attachments
motor_reversible.fcpx
(51.73 KiB) Downloaded 73 times
Martin

peterhalloway
Posts: 11
Joined: Sat Nov 20, 2021 11:28 am

Re: running a DC motor using the arduino motor shield

Post by peterhalloway »

Thanks for the quick response Martin. I assume once I install the file, as I have I just need to program the arduino with the file I put on the posting. If so its still not working.

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 506 times
Been thanked: 468 times

Re: running a DC motor using the arduino motor shield

Post by medelec35 »

Did you reload the flowchart after?
If you are using channel A have you got Channel 6 selected?
If so, what does it show for port?
Is the Remap Pin greyed out?
Have you got Direction Pin set to either $D12 with Use Chip References unticked, or B4 with it ticked?
If still not working, I will look into it more tomorrow.
Martin

peterhalloway
Posts: 11
Joined: Sat Nov 20, 2021 11:28 am

Re: running a DC motor using the arduino motor shield

Post by peterhalloway »

Hi Martin
I have A connected, channel6 selected, Port shows as $PORTD.3 but is greyed out and the direction pin is $PORTB.4

I have 250 for speed 300 for acceleration and 50 for deceleration

unfortunately it is still not working

Pete

chipfryer27
Valued Contributor
Posts: 1110
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 397 times

Re: running a DC motor using the arduino motor shield

Post by chipfryer27 »

Hi

I've only recently started playing with an Uno, mainly to explore Flowcode Developer, so I'm no expert with it.

Keen to play I downloaded your chart (and Martin's component). Whilst I don't have the motor shield I can monitor the pins with a logic analyser. No matter what I tried I couldn't get a PWM output on any channel (1-6). I could see enable and direction pins change state where applicable as I tried various scenarios, but no actual PWM.

Regards

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 506 times
Been thanked: 468 times

Re: running a DC motor using the arduino motor shield

Post by medelec35 »

We have not forgotten.
This is currently being looked into.
Thank you for your patients.
Martin

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 506 times
Been thanked: 468 times

Re: running a DC motor using the arduino motor shield

Post by medelec35 »

Hello.
The motor component has now been updated and should be available via Library updates.
Thank you for your patience.
Martin

chipfryer27
Valued Contributor
Posts: 1110
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 397 times

Re: running a DC motor using the arduino motor shield

Post by chipfryer27 »

Thanks Martin

I'll try it out later today.

Regards

chipfryer27
Valued Contributor
Posts: 1110
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 397 times

Re: running a DC motor using the arduino motor shield

Post by chipfryer27 »

Hi

Working now sort of....

With Duty set to 128 I get the expected 50% Duty Cycle on the analyser. However irrespective of the frequency set under properties, I always get half of expected. If set at 7.8KHz I get 3.9KHz etc.

Freely admit to only starting to play with the Uno so maybe I'm doing something stupid.

Regards

Post Reply