MIAC-RC LawnMower

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Is anyone here knowing what to do in the codes above, to see 0 to 255 in the display?
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Hi,
I would help to see some more values, between the two extremes, as the values look to be the wrong way round (min and max)
As there are a few possibilities, such as the shorter pulses being missed, the pulse being inverted.. etc.,
It is difficult to suggest further without having hardware to test, which you have, so we rely upon your tests and observations

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

LeighM
I can get more values.
By changing the numbers between the two limits, 800 (3523) and 2200 (1517) "
But not from that 800 = 0 and 2200 = 255 bit
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Yes, "changing the numbers between the two limits, 800 (3523) and 2200 (1517)" is what I mean.
So that we can see if the numbers from MIAC go up or down or jump value suddenly at some point.
Example: 1100(?) 1400(?) 1700(?) 2000(?)

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM

No I can not get more!
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM

You can see below at numbers from MIAC go up or down or jump value suddenly at some point.
Example: 1100(?) 1400(?) 1700(?) 2000(?)

From Servo Tester
1100
MAP = 0
TSUM = 741

1400
MAP = 239
TSUM = 2111

1700
MAP = 255
TSUM = 3399

2000
MAP = 0
TSUM = 642

2200
MAP = 131
TSUM = 1517

Hope you can use the above measured data?
And see where it goes wrong..
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Hi Monie,

That definitely looks like a roll over issue, are you sure you are testing with MIACdsPIC-LawnMower-006.fcfx, not 005?

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM

I am testing with MIC dsPIC-LawnMower-006.fcfx
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Hi Monie,
Please try this new version (007)
MIACdsPIC-LawnMower-007.fcfx
(18.92 KiB) Downloaded 333 times
edit: If my calculations are correct, that should give you a tsum range of 7000 to 19250
I which case the parameters of Map should be ...
map.jpg
map.jpg (7.93 KiB) Viewed 17855 times

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM

From file MAC dsPIC-LawnMower-007.cfx
There I get tsum range of 7045 to 19358

Output from Map valus range of 87 to 255
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Looking better then :D
Did you try using 7045 and 19358 as parameters to Map?
I've not checked the maths in Map, but it looked OK on a quick glance.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM

It looks better then :D
I have tried using 7045 and 19358 as parameters to Map - and it works fine.
Ouput MAP Value from 0 to 255 works very well.
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Cool 8)
Thanks for letting me know.
And make sure we get some photos of the Lawnmower in action :wink:

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM
The codes seem very fine now.
Thank you very much for your help and your great diligence.

Proposals:
Since there are many who work with RC servor "Recevier system" for many purposes. I would like to make a suggestion.
Making a component so your work can benefit many people.
Was it a go idea?
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

LeighM wrote:Cool 8)
Thanks for letting me know.
And make sure we get some photos of the Lawnmower in action :wink:
I'll send some pictures...
Best Regard
Monie

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: MIAC-RC LawnMower

Post by jgu1 »

Hi LeighM!

Today I discover some new in your program (FC7).
I see in your program the macro MAP it is possible to add some variable. Never seen before. Are these only for use with local varabel. I can not see you have used these in any calculation other place in the program, what happen, I can¨t figure out :roll: . I try to look in help, but don¨t understand. Will you please (when you get time) explain how to use and feature/benefit by these.( I dare, maybe create a very simple program/example wich is very easy to understand) :D

Thanks in advance

Jorgen
Attachments
ProbMacro.PNG
(27.18 KiB) Downloaded 10898 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: MIAC-RC LawnMower

Post by jgu1 »

Hi Monie!

Concerning these variable in a Macro, maybe, are you able to explain the above, please. :D

Br Jorgen

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: MIAC-RC LawnMower

Post by kersing »

Local variabels can not be accessed from any other part of the program, they are private to the macro where they're declared. The advantage of local variables is that they do not permanently require memory.

Take a program with two macros, a and b. If the main routine call macro a and once a is finished calls b, the local variables of the macros can occupy the same memory locations, saving ram. If the main program calls a and a calls b the memory locations need to be different to make sure the values of a are not overwritten by b. To check which macros are 'exclusive' the compiler analysis the code while generating the compiled program.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: MIAC-RC LawnMower

Post by jgu1 »

Hi Kersing!

Thank's for your explanation. Make sense.

Br Jorgen

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM

2xPWM With MI509-dsPIC
Have worked all weekend to get 2 outputs with PWM but it is not successful.
Please see the attached test program: MIACdsPIC-2xPWM
MIACdsPIC-2xPWM.fcfx
(22.7 KiB) Downloaded 280 times
Do you have a suggestion for setting up the 2 x PWM
Do you have a table or guide on how to set PWM to the 4 OuputON A, B, C and D?
I need an overview of possible PWM channel for MI509-dsPIC.
Can not see any description of the above only MIAC PIC (Old)
Do not hope there were too many questions :D
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Hi Monie,
You are very close, you just need to turn on the output drivers.
See Motor1 and Motor2 (Port F0 and F1) in the Chip View ...
MotorEnable.jpg
MotorEnable.jpg (7.14 KiB) Viewed 17643 times
The solid state drivers are explained in the MIAC (V3) datasheet ...
http://www.flowcode.co.uk/old_site/resources/file ... C-60-3.pdf

Hope that helps
Leigh

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM
Thank you very much.
I must have overlooked this problem :shock: .
Sorry for the inequality.

GO'Arbejdsdag
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi Leigh
So now there are 2 x PWM out on both motors running.
Thank you very much Leigh.

Your answer to jgu1 with MAP, I would like to learn about Setup and options for MAP.
Is it something you could or have time to describe the possibilities with the MAP device?

Many thanks in advance
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: MIAC-RC LawnMower

Post by LeighM »

Hi Monie,

Sorry, I don't understand your question.
kersing explained about local and macro parameter variables.
The Map macro in your program came from your Ardunio example code I think.
It converts one range of values into another range of values, much like reading values from a straight line graph (with offset origin and fixed slope)
Hope that helps.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times

Re: MIAC-RC LawnMower

Post by Monie Jacobsen »

Hi LeighM,
Many thanks for your description.
I would like to learn the use as well as possible.
Best Regard
Monie

Post Reply